Skip to content

0002. Website Generated at Build Time

Date: 2026-12-02. Status: accepted.

Context

docs/architecture.md planned a GitHub Pages site with a gallery of reproductions, one page per reproduction, a component reference, and the records, built with MkDocs Material and pages generated by scripts/. The open choice was how the generated pages reach MkDocs: written to disk by a script before the build, possibly committed, or produced inside the build.

Decision

A single MkDocs hook, scripts/website.py, generates every page in memory during mkdocs build: the home page with the gallery from each meta.yaml and taxonomy.yaml, a page per reproduction (metadata, figures from outputs/, its README.md, its code, and the change records that name it), a page per tencirlab module rendered by mkdocstrings, the records with links to their pull requests, and the project documents with repository links rewritten to site pages or to GitHub. docs/site/ holds only the configuration, the home-page text, the styles, and the filter script. Nothing generated is committed. mkdocstrings reads the package statically, so the build needs only docs/site/requirements.txt, not JAX or TensorCircuit-NG.

The site workflow builds the website with --strict on every pull request, so a broken relative link in a repository document or record, a missing output file, or an unknown meta.yaml key fails before the merge, and publishes it with GitHub Actions on every push to main. Workflow files and the Pages setting are the owner's under docs/autonomy.md.

Alternatives

  • A generator script that writes Markdown into docs/ before the build: two steps, and generated files in the working tree invite hand edits and drift.
  • Committing generated pages: every reproduction change would need a regeneration commit.
  • A static-site generator other than MkDocs: TenCirPauli already uses MkDocs Material, and mkdocstrings gives the component reference for free.

Consequences

A merged reproduction appears on the site with no extra step, and meta.yaml remains the single source. Its text fields are rendered as Markdown. Trend charts are left until there is enough history to plot.