Documentation#
How the documentation site is built and where a page belongs. The rules for what to write are in Writing docs.
Build the site#
Python 3.12 and uv are required. From the repository root:
uv sync --project docs --frozen
uv run --project docs sphinx-build -W --keep-going -n -b html docs docs/_build/html
The build fails on any warning, including a broken link or cross-reference. Open
docs/_build/html/index.html to read the result. sh ci/validate.sh docs runs the same
two commands.
How pages are collected#
Source |
Published as |
|---|---|
|
The section’s pages |
|
|
|
|
The generators in |
|
|
Diagrams |
docs/_parts/ and docs/_generated/ are written by the build and are git-ignored. Edit
the sources, not the copies. Folders named changes and internal inside a part’s docs/
are not published, and neither are docs/changes/, docs/design/ and docs/internal/.
Publish a part’s pages#
Create
<part>/docs/index.mdwith a title and atoctreeof the part’s pages.Write pages as Markdown with an SPDX header. Link to other pages in the part with relative
{doc}paths, and to the rest of the site with root-absolute ones, such as{doc}`/architecture/parts`.Build the site. A page that is in no
toctreeis a warning.
Add or move a page#
Put the page in the section’s folder and add it to that section’s index.md toctree.
When you delete or move a page, search the repository for links to it and fix them. Reference
pages are generated; change the contract, the snapshot or the generator instead.
Before you push, run the checks listed in Writing docs, plus python3 -m unittest tests.test_docs_site.