@@ -136,7 +136,12 @@ These are listed roughly in order of decreasing importance.
136
136
137
137
## Previewing the HTML documentation
138
138
139
- <!-- -- Short-term TODO: More docs follow in a subsequent commit ---->
139
+ The documentation for ` jj ` is automatically published to the website
140
+ < https://martinvonz.github.io/jj/ > . At the moment, this is experimental,
141
+ but we hope to advertise this website to our users soon.
142
+
143
+ When editing documentation, we'd appreciate it if you checked that the
144
+ result will look as expected when published to the website.
140
145
141
146
### Setting up the prerequisites
142
147
@@ -184,6 +189,65 @@ occasionally check the terminal from which you ran `mkdocs serve` for
184
189
any build errors or warnings. Warnings about
185
190
` "GET /versions.json HTTP/1.1" code 404 ` are expected and harmless.
186
191
192
+ ### How to build the entire website (not usually necessary)
193
+
194
+ The full ` jj ` website includes the documentation for several ` jj ` versions
195
+ (` prerelease ` , latest release, and the older releases). The top-level
196
+ URL < https://martinvonz.github.io/jj > is hardcoded to redirect to
197
+ < https://martinvonz.github.io/jj/latest > , which in turn redirects to
198
+ the docs for the last stable version.
199
+
200
+ The different versions of documentation are managed and deployed with
201
+ [ ` mike ` ] ( https://github.com/jimporter/mike ) , which can be run with
202
+ ` poetry run -- mike ` .
203
+
204
+ On a POSIX system, one way to build the entire website is as follows (on
205
+ Windows, you will have to understand the shell script and run the corresponding
206
+ commands):
207
+
208
+ 1 . Check out ` jj ` as a Git repository or a co-located ` jj + git ` repository
209
+ (` jj clone --colocate ` ), cloned from your fork of ` jj ` (e.g. ` jjfan.github.com/jj ` ).
210
+
211
+ 2 . Make sure ` jjfan.github.com/jj ` includes the ` gh-pages ` branch of the jj repo
212
+ and run ` git fetch origin gh-pages ` .
213
+
214
+ 3 . Go to the Github repository settings, enable Github Pages, and configure them
215
+ to use the ` gh-pages ` branch (this is usually the default).
216
+
217
+ 4 . Run the same ` sh ` script that is used in Github CI (details below):
218
+
219
+ ``` shell
220
+ .github/scripts/docs-build-deploy ' https://jjfan.github.io/jj/' \
221
+ prerelease main --push
222
+ ```
223
+
224
+ This should build the version of the docs from the current commit,
225
+ deploy it as a new commit to the ` gh-pages` branch,
226
+ and push the ` gh-pages` branch to the origin.
227
+
228
+ 5. Now, you should be able to see the full website, including your latest changes
229
+ to the ` prerelease` version, at ` https://jjfan.github.io/jj/prerelease/` .
230
+
231
+ 6. (Optional) When you are done, you may want to reset the ` gh-branches` to the same
232
+ spot as it is in the upstream. If you configured the ` upstream` remote and are in a
233
+ colocated repo, this can be done with:
234
+
235
+ ` ` ` shell
236
+ jj git fetch --remote upstream
237
+ jj branch set gh-pages -r gh-pages@upstream
238
+ jj git push --branch upstream
239
+ ` ` `
240
+
241
+ # ### Explanation of the `docs-build-deploy` script
242
+
243
+ The script sets up the ` site_url` mkdocs config to
244
+ ` ' https://jjfan.github.io/jj/' ` . If this config does not match the URL
245
+ where you loaded the website, some minor website features (like the
246
+ version switching widget) will have reduced functionality.
247
+
248
+ Then, the script passes the rest of its arguments to ` potery run -- mike deploy` , which does
249
+ the rest of the job. Run ` poetry run -- mike help` to find out what the arguments do.
250
+
187
251
# # Modifying protobuffers (this is not common)
188
252
189
253
Occasionally, you may need to change the ` .proto` files that define jj' s data
0 commit comments