You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add utility for clean builds and link checks; update README accordingly (#53)
* Resolve issues #24 & #43
- Add a powershell script to clean files and check links
- Add stuff in README regarding the bullet point above including a dedicated section
- Fix typos in README
Miscellaneous:
- docfx.json files entry refactored to be more succinct
- index.md configured with landing page metadata in docfx.json and
removed relevant metadata from the file itself
Copy file name to clipboardExpand all lines: README.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ Download and install [git](https://git-scm.com/downloads) if it is not installed
31
31
``` console
32
32
git submodule update --recursive --init
33
33
```
34
+
In particular, the source code is available in this repo as a submodule. This will update the source code to the latest commit on main.
34
35
1. Configure the docfx version and restore docfx companion tools such as [DocLinkChecker](https://github.com/Ellerbach/docfx-companion-tools/tree/main/src/DocLinkChecker).
35
36
36
37
``` console
@@ -49,10 +50,7 @@ Download and install [git](https://git-scm.com/downloads) if it is not installed
49
50
50
51
## Build Documentation Locally
51
52
52
-
> [!NOTE]
53
-
> The following steps should be be performed in Powershell.
54
-
55
-
To build the docs and serve locally, run:
53
+
To build the docs and serve locally, run in PowerShell:
The following three commands are run remotely by remote GitHub Actions serve upon pushing to a branch. The branch will not be able to merge to main unless all three commands completely successfully without any errors. Confirm that that they can complete successfully without errors locally before committing and pushing. Otherwise, the branch becomes cluttered with potentially several attempts to pass the link-check process. Run:
75
+
The following three commands are run remotely by remote GitHub Actions serve upon pushing to a branch. The branch will not be able to merge to main unless all three commands complete successfully without any errors. Confirm that they can complete successfully without errors locally before committing and pushing. Otherwise, the branch becomes cluttered with potentially several attempts to pass the link-check process. Run:
If the above command fails because "you must install or update .NET", follow the URL from the failed command's output or [this one](https://dotnet.microsoft.com/en-us/download/dotnet/6.0/runtime?cid=getdotnetcore&os=windows&arch=x64) to download and install .NET runtime 6. Dotnet supports simultaneous installation of several .NET runtime versions, and version 6 is required to run the DocLinkChecker.
85
83
84
+
The above set of commands can also be run using the `docfx-util.ps1` Powershell script. Specifically, run `./docfx-util.ps1 -d` in the repo's root directory.
85
+
86
86
To run the next command, install [Lychee](https://github.com/lycheeverse/lychee?tab=readme-ov-file) by following [these instructions](https://github.com/lycheeverse/lychee?tab=readme-ov-file#installation). If you are use Windows and download a Lychee executable, amend the below command according to the location and version of your Lychee executable, and run it.
87
87
88
88
```console
@@ -91,6 +91,26 @@ To run the next command, install [Lychee](https://github.com/lycheeverse/lychee?
91
91
92
92
If you use a different operating systems and a different methods of installation, the above command might require additional amendments.
93
93
94
+
The above command can also be run using the `docfx-util.ps1` Powershell script. Specifically, run `./docfx-util.ps1 -l <path/to/lychee.exe>` in the repo's root directory.
95
+
96
+
All three link-checking commands can be run with the following command: `./docfx-util.ps1 -a` in the repo's root directory. This command additionally cleans remaining artifacts from past builds before performing all the link-checking commands. This is the most robust and expedient way to confirm that the repo will pass the link checks when pushed.
97
+
98
+
### docfx-utils.ps1
99
+
100
+
This is summary of docfx-utils.ps1 list members. They are described above, but they are also described below for ease-of-finding:
101
+
102
+
-`docfx-utils.ps1 -c` cleans cached files/removes artifacts from previous builds.
103
+
-`docfx-utils.ps1 -b` exports SVGs and builds the docs.
104
+
-`docfx-utils.ps1 -l <path/to/lychee.exe>` checks for broken/missing links and references.
105
+
-`docfx-utils.ps1 -a <path/to/lychee.exe>` performs all of the above steps.
106
+
107
+
`docfx-utils.ps1 -l` and `docfx-utils.ps1 -a` will not run without a path to a lychee executable.
108
+
109
+
> [!NOTE]
110
+
> The docfx-utils.ps1 script (.ps1 PowerShell scripts in general) must be run in PowerShell.
111
+
112
+
These commands do not serve the docs. Serve them by running `dotnet docfx serve`.
113
+
94
114
## `dotnet docfx`
95
115
96
116
Running `dotnet docfx` runs both the `dotnet docfx metadata` command and the `dotnet docfx build` command in that order. Unless specified otherwise, `dotnet docfx` uses the `docfx.json` as its config file.
@@ -152,7 +172,7 @@ If local html pages don't appear to be updating, hard refresh website pages in b
152
172
If there are discrepancies between local and remote builds:
153
173
154
174
* Confirm local and remote docfx versions are consistent. This inconsistency can occur when, for example, running `docfx` instead of `dotnet docfx` or running `dotnet tool restore --configfile <configfile>` on another config file other than the one in this repo.
155
-
* Clear the local files to remove any cached files that aren't available remotely. Such files exist in the `api` directory (though care to not delete the `.gitignore` in that directory), the `_site` directory, and the workflows directory.
175
+
* Clear any locally cached files that aren't available remotely. Such files exist in the `api` directory (though care to not delete the `.gitignore` in that directory), the `_site` directory, and the workflows directory. Run `./docfx-util.ps1 -c` to clean artifacts from previous builds.
0 commit comments