Skip to content

docs: publish versioned documentation to GitHub Pages - #75

Draft
dengqiaoyu wants to merge 1 commit into
apple:mainfrom
dengqiaoyu:u/qiaoyu_deng/docs-improve
Draft

docs: publish versioned documentation to GitHub Pages#75
dengqiaoyu wants to merge 1 commit into
apple:mainfrom
dengqiaoyu:u/qiaoyu_deng/docs-improve

Conversation

@dengqiaoyu

Copy link
Copy Markdown
Contributor
  • Serve one doc set per version: /main/ rebuilt on every push to main, /vX.Y.Z/ published when a GitHub Release is created, and / redirecting to /main/. Publishing one version rewrites only its own directory, so each release keeps the docs it shipped with.
  • docs/scripts/assemble_versioned_site.py assembles the site in two phases because the version picker is rendered into every page at build time: plan computes the version list before Sphinx runs, assemble installs the built HTML afterwards.
  • Fail closed rather than silently dropping docs. actions/deploy-pages replaces the entire artifact each run, so a truncated gh-pages checkout would take published releases offline; assemble aborts when the tree lacks a version its own versions.json lists, or holds a directory the picker cannot reach.
  • Track docs/src/api/index.md and guard it with a verify-only check-api-doc-coverage hook, mirroring the internal repo. Run make render-api-index to regenerate.
  • Add make test-docs as a pull-request gate (mirroring internal docs-build-check) and make docs-open-multiversions to preview the published layout locally.

@dengqiaoyu
dengqiaoyu requested a review from aseemw August 21, 2026 00:06
@dengqiaoyu dengqiaoyu added the documentation Improvements or additions to documentation label Aug 21, 2026
@dengqiaoyu

dengqiaoyu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

This draft prepares us to build multi-version gh-pages when needed.

By default, readers land on the main version of the doc, with a blue banner:
Screenshot 2026-08-20 at 5 09 40 PM

Readers can land on the v0.2.1 version of the doc. This version shows no banner, since it is the latest release:
Screenshot 2026-08-20 at 5 09 51 PM

Readers can land on the v0.2.0 version of the doc. This version shows a red banner, since it indicates an old doc:
Screenshot 2026-08-20 at 5 16 38 PM

Readers can also select the version that they want to view:
Screenshot 2026-08-20 at 5 14 12 PM

@dengqiaoyu
dengqiaoyu force-pushed the u/qiaoyu_deng/docs-improve branch 4 times, most recently from 3607263 to c5f56d2 Compare August 21, 2026 18:09
- Serve one doc set per version: `/main/` rebuilt on every push to `main`, `/vX.Y.Z/` published when a GitHub Release is created, and `/` redirecting to `/main/`. Publishing one version rewrites only its own directory, so each release keeps the docs it shipped with.
- `docs/scripts/assemble_versioned_site.py` assembles the site in two phases because the version picker is rendered into every page at build time: `plan` computes the version list before Sphinx runs, `assemble` installs the built HTML afterwards.
- Fail closed rather than silently dropping docs. `actions/deploy-pages` replaces the *entire* artifact each run, so a truncated `gh-pages` checkout would take published releases offline; `assemble` aborts when the tree lacks a version its own `versions.json` lists, or holds a directory the picker cannot reach.
- Track `docs/src/api/index.md` and guard it with a verify-only `check-api-doc-coverage` hook, mirroring the internal repo. Run `make render-api-index` to regenerate.
- Add `make test-docs` as a pull-request gate (mirroring internal `docs-build-check`) and `make docs-open-multiversions` to preview the published layout locally.
- Install pandoc into the repo's gitignored `.local/bin` instead of `/usr/local`, so the docs build needs no root. Unprivileged CI runners cannot write a system prefix, and extracting the upstream tarball's root-owned entries there failed the build. `PATH` is exported from the Makefile because `make docs` ensures pandoc and runs `sphinx-build` in separate recipe lines.
@dengqiaoyu
dengqiaoyu force-pushed the u/qiaoyu_deng/docs-improve branch from c5f56d2 to b39c19b Compare August 21, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant