-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Switch to mkdocs, mkdocs-material
# Background When we originally set up the documentation website, there were a couple core requirements: - Inter-linking of documentation pages should be "checked". That is, instead of writing "../foo.html" and hoping that that generated page exists, we wanted to write "../foo.md", have the system check that it exists, and turn it into "foo.html" or equivalent as needed. - It must be possible to include code snippets in documentation from sections of real code. We didn't find anything at the time that met the latter requirement well enough, so we resorted to a custom solution: we used `mdox` and a custom shell script to extract code snippets from source and include them in the documentation. This has worked well okay, but it is a bit annoying to have around. At the time we evaluted these options, mkdocs stood out as the closest winner, except that its snippets plugin only supported line numbers, not named regions of code the way we wanted. The mkdocs snippets plugin has since added support for including named regions of code: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/#snippet-sections This unblocks us from using mkdocs for our documentation. # Description This PR deletes all custom setup, mdox integration, etc. in favor of using mkdocs to generate documentation for Fx. It migrates all documentation as-is over from VuePress to mkdocs. High-level notes: - Navigation tree which was previously specified in docs/.vuepress/config.js is now specified in docs/mkdocs.yml. (It was always weird to have it in a hidden directory anyway.) - mkdocs is configured to verify validity of all interlinking, including links to headers within a page. The build will fail if any links are invalid. - We're using [uv](https://docs.astral.sh/uv/) to manage our Python dependencies. This will also manage the Python version as needed. - There is no longer need for a custom page redirect component. We can use the mkdocs-redirects plugin for this purpose. - The existing Google Analytics tag has been carried over. - The mkdocs-material theme supports a fair bit of customization, including a dark/light mode toggle. This resolves #1071. ## Syntax changes - Admonitions were previously specified as: ``` ::: tip This is a tip. ::: ``` They are now specified as: ``` !!! tip This is a tip. ``` - Tabbed blocks were previously specified as: ``` <code-group> <code-block title="Go"> ... </code-block> <code-block title="Python"> ... </code-block> </code-group> ``` They are now specified as: ``` === "Go" ```go ... ``` === "Python" ```python ... ``` ``` - Code snippets were previously included as: ``` ```go mdox-exec='region ex/path/to/file.go snippet-name' // ... ``` ``` They are now included as: ``` --8<-- "path/to/file.go:snippet-name" ``` - Code regions were previously marked in code as: ``` // region snippet-name ... // endregion snippet-name ``` They are now marked as: ``` // --8<-- [start:snippet-name] ... // --8<-- [end:snippet-name] ``` The snippets are processed at Markdown file-read time, so they don't result in code duplicated into the Markdown file. - Multi-paragraph list items must be indented 4 spaces instead of just aligning to the list item text (which was 2 spaces for `-` and 3 spaces for `1. `). So, before: ``` - First paragraph Second paragraph - Next item ``` Becomes: ``` - First paragraph Second paragraph - Next item ```
- Loading branch information
Showing
79 changed files
with
1,988 additions
and
12,742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
sidebarDepth: 0 | ||
search: false | ||
search: | ||
exclude: true | ||
--- | ||
|
||
# Changelog | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.