Versioned docs with a version switcher#738
Open
cailmdaley wants to merge 2 commits into
Open
Conversation
The docs site publishes only from `master`, which is currently ~78 commits behind `develop`. The practical effect is that the public docs describe an old release while everyone runs `develop`, and recently written pages (`container.md`, `canfar.md`, four others) have simply never been published. This makes the site track every long-lived ref, with a switcher to move between versions. Layout on gh-pages (additive, non-destructive to existing URLs): - master/main -> site root (stable; every current /installation.html-style link keeps working) - develop -> /latest/ - tags v* -> /<tag>/ (e.g. /v1.1.0/) - /switcher.json at the root drives the dropdown. cd.yml now triggers on master/main, develop, and v* tags; resolves the ref to a version slug; builds each ref in its own dev image (the right model here, since autodoc imports shapepipe — one shared env across refs, as sphinx-multiversion would use, breaks autodoc on old tags); and deploys into the ref's directory with keep_files: true so a deploy only ever writes its own slice. Pull requests that touch the docs build and upload the HTML as an artifact but do not deploy, so a broken docs build is caught before merge and reviewers can preview it. conf.py gains the pydata/sphinx-book-theme switcher (json_url + version_match from a DOCS_VERSION env the workflow sets) and now reads the version from the installed package metadata instead of a hand-maintained string that had gone stale (1.0.1 vs the actual 1.1.0). Verified with a local sphinx-book-theme 1.2.0 build: the switcher chrome renders, json_url and version_match are wired correctly. The populated dropdown resolves at runtime from the deployed switcher.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The docs build only ever ran on `master` (old flat layout), so the stale `sphinx-apidoc … shapepipe` path went unnoticed when the package moved to src-layout. Running the docs build on `develop` for the first time surfaces it: `/app/shapepipe is not a directory`. Point apidoc at `src/shapepipe` (and the runner exclusion at `src/shapepipe/modules/*_runner.py`). Verified locally: apidoc now generates the `shapepipe.*` stubs cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cailmdaley
added a commit
that referenced
this pull request
May 31, 2026
Three fibers from this session's docs work: - docs-versioning: the versioned-site + switcher design (#738) and the recurring unexercised-path bit-rot pattern. - docs-cluster-tree: the machine-specific clusters.md decision (#739) and why a single page beat a thin standalone general page. - v2-run-plan: the v2.0 run wishlist rescued from the deleted work_flow_v2.0.md docs page before removal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The docs site (
cosmostat.github.io/shapepipe) publishes only frommaster, which is currently ~78 commits behinddevelop. So the public docs describe an old release while everyone actually runsdevelop, and several recently written pages —container.md,canfar.md, and four others — have never been published at all (container.html→ 404 today).Rather than just flipping the trigger to
develop(which would make the public site silently track integration), this makes the site versioned, with a switcher to move between releases and the development tip — the conventional answer when both "what's released" and "what's current" matter.What
gh-pages layout — additive, and non-destructive to existing URLs:
master/main…/installation.htmllink keeps workingdevelop/latest/v*/<tag>//v1.1.0/, additiveA
switcher.jsonat the site root drives the dropdown.cd.ymlnow triggers onmaster/main,develop, andv*tags; resolves the ref to a version slug; builds each ref in its own dev image and deploys into that ref's directory withkeep_files: true, so a deploy only ever writes its own slice and never clobbers the others. Building per-ref (rather than one shared env across all refs, assphinx-multiversionuses) is deliberate: autodoc importsshapepipe, so an old tag must build against its own dependencies — which it does, at its own time.Pull requests that touch the docs now build + upload the HTML as an artifact but do not deploy — so a broken docs build is caught before merge, and reviewers can download and preview the rendered site. (This PR exercises that path on itself.)
conf.pygains the switcher config and now reads the version from installed package metadata instead of a hand-maintained string that had already gone stale (1.0.1vs the actual1.1.0).Verification
Local
sphinx-book-theme1.2.0 build: the switcher chrome renders, andjson_url(…/switcher.json) andversion_match(from theDOCS_VERSIONthe workflow sets) are wired correctly. The populated dropdown resolves at runtime from the deployedswitcher.json, so it's fully observable only after the first deploy — which is safe: the firstdevelopdeploy only adds/latest/+/switcher.jsonand leaves the existing root untouched.Note — a small policy shift
After this lands, the public docs site will publish
developaslatest(alongside stable + tagged releases) — so our in-development docs become publicly visible. That seems right for an actively developed pipeline with a growing external audience, but it's worth a conscious nod since it changes what doc readers see.Two follow-ups it enables, not included here: (1) seeding
switcher.jsonwith the first real release entry when the next version is tagged; (2) a one-timemasterrelease to refresh the root with the current docs.— Claude on behalf of Cail