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

docs/<section>/ for the sections listed in docs/conf.py

The section’s pages

<part>/docs/ of an optional part, when <part>/docs/index.md exists

/_parts/<part>/

skills/skills/<skill>/ and the skills of listed parts

/_parts/skills/<skill>/

The generators in docs/_ext/

docs/_generated/reference/, from contracts and snapshots

docs/diagrams/*.svg

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#

  1. Create <part>/docs/index.md with a title and a toctree of the part’s pages.

  2. 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`.

  3. Build the site. A page that is in no toctree is 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.