0011 — Versioned documentation¶
- Status: Proposed
- Date: 2026-11-19
- Amends: ADR 0003 (which docs builds regenerate the Roadmap)
- Amended: 2026-11-20 —
devremoved; each version's data views read its own data line; a Previous Releases page (below)
Context¶
The docs site was one build. Every docs merge to main overwrote the whole gh-pages branch, so the live site
described main: the 1.2.0 profiles were documented before 1.2.0 was released, and a reader of the 1.1.0 data
had no way to see the docs that matched it. A release deploy showed the tag's docs only until the next main
run. Data lines already have folders (v1/1.1/, v1/1.2/, ADR 0009); the docs had nothing to match.
The maintainer set five requirements (2026-11-19), to be in place with the 1.1.0 docs before 1.2.0 ships:
one docs version per minor line; the site root and the default are the latest release; main is still
published, as dev, with its own colour and notice; existing unversioned links keep working; older releases are
grey and say they aren't current.
Decision¶
- One docs version per release line,
1.1,1.2, … — the same{major}.{minor}as the data line folder. A patch release (1.2.1) rebuilds its line's docs in place; patches never get their own version. The line's docs are built from its newest tag. devismain, rebuilt on every docs merge, as today. It is never the default.- Layout on
gh-pages. One folder per version (1.1/,dev/), each a complete Zensical build withsite_urlset to…/clinvar-gkm/<version>/, so canonical links andsitemap.xmlare per version. At the root, written bysrc/scripts/docs-versions.py:versions.json(the formatmikewrites) lists the versions. The highest release line carries the aliaslatest, so a patch to an older line can't takelatestfrom a newer one, anddevnever has it.index.htmlredirects to the latest release, keeping the query and#fragment.404.htmlis what GitHub Pages serves for any missing path. An unversioned link — every URL from before this change — goes to the same page in the latest release, or to its home when that page doesn't exist there.…/latest/<page>goes to that page in the latest release. A missing page inside a version goes to that version's home.- Anything else at the root is removed on every deploy (the first deploy removes the unversioned site);
CNAMEand.nojekyllare kept.
- The version selector is the theme's.
[project.extra.version] provider = "mike"makes Zensical render the Material version selector fromversions.json; switching versions keeps the reader on the same page when it exists in the other version. Themiketool itself isn't used: the workflow builds each version withzensical buildand writesversions.jsonitself. - Old / dev / latest is decided in the browser.
docs/assets/js/versions.jsreadsversions.jsonon every page and compares the page's version to thelatestalias. Ondevit colours the header and tabs orange and shows a notice that the pages describe unreleased changes and aren't for production use; on an older release it colours them grey and shows a notice that this isn't the current version. Both notices link to the same page in the latest release, or its home. The latest release keeps the normal indigo. Nothing is baked into a build, so an older version turns grey on its own when a newer release ships, without being rebuilt. The result is cached for the browser tab so the next page doesn't flash indigo first. - Older tags get the feature by overlay.
src/scripts/build-versioned-docs.sh <ref> <version> <out>exports the ref's tree (the tag is never changed), copies in the files this feature owns (docs/overrides/main.html,partials/header.html,partials/source.html,404.html,versions.js,versions.css) from the checkout running the build, setssite_url, adds the[project.extra.version]table if missing, regenerates the Roadmap, and runszensical build --clean --strictandcheck-site-links.py. This is how1.1, whose config predates versioning, gets the selector. A line whose tag lacks its docs is built from another ref.src/scripts/docs-line-sources.txtmaps a release line to the ref its pages are built from and the release its header shows. The build script applies it on every trigger (release, schedule, dispatch), so the daily rebuild can't bring the tag's docs back. The1.1.0tag was cut on1.0withoutmain's 1.1.0 docs: its pages give the pre-1.1v1/datasets/…download URLs, which return 404, and its changelog has no 1.1.0 section.1.1is therefore built from036bec2(mainright after the 1.1.0 forward-merge, #188) and shown as1.1.0. Remove a line's entry when a newer tag of that line has correct docs; after changing the file, dispatch the line to rebuild it. - Each version shows and links its own ref. The build sets
[project.extra.source]to the ref it was built from:main(labelled with the build commit) fordev, the tag (or the line's label) for a release. The header's repository widget (partials/source.html) shows that ref and links…/tree/<ref>, instead of the latest GitHub release the theme fetches from the GitHub API; the stars and forks counts, which come from the same lookup, are dropped.edit_urifollows the ref the pages come from (edit/main/docs/fordev,blob/<ref>/docs/for a release, since a tag can't be edited); the edit and view buttons aren't enabled today. For a release,src/scripts/pin-repo-links.pyrewrites the pages' links to this repository's files onmain(/blob/main/…,/tree/main/…,/raw/main/…) in the exported tree to the ref the pages come from (the tag, or the line's source ref, so a1.1page links the036bec2files, where each linked path exists); a path the ref doesn't have stays onmainand is listed in the build log. Links to issues, discussions, pull requests and releases stay as written: they are live, not versioned. -
When each version is deployed (
.github/workflows/deploy-docs.yml):Trigger Builds pushtomaintouching the docs pathsdevrelease: publishedfor tagX.Y.Z(not a prerelease)X.Yfrom the tag;versions.jsonandlatestupdateddaily scheduleanddiscussioneventsdev, and the latest release from its newest tagworkflow_dispatch, no inputs (onmain)devworkflow_dispatchwithrefandversionthat ref as that version, e.g. 1.1.0as1.1The latest release is rebuilt on the Roadmap triggers because the Roadmap is a live page (ADR 0003) and the latest release is the version most readers see. Older releases keep the Roadmap they had. 9. Publishing keeps the other versions. A run builds only its versions, then checks out
gh-pages, replaces those folders, rewrites the root files and pushes; if another run pushed first, it starts again from the new tip. Runs are serialized per version (concurrency: deploy-docs-<version>), so a main merge can't cancel a release deploy.
Consequences¶
- Readers land on the docs for the data they can download today; unreleased changes are visible but marked. Every existing link and bookmark keeps working through the redirect.
- A new release needs no docs step: publishing the GitHub release for
X.Y.0buildsX.Y, makes itlatest, and turns the previous line grey. - The
releaseevent runs the workflow file at the tag. A tag whose tree has the old whole-sitedeploy-docs.ymlwould overwrite every version with one unversioned build. Before publishing a release from a branch that predates this ADR — the1.0branch today — bring this workflow and its scripts (build-versioned-docs.sh,docs-versions.py,pin-repo-links.py) onto that branch, or remove itsreleasetrigger. - The overlay files must keep building against the oldest published docs version. A change to them is checked
by building
1.1from its tag (build-versioned-docs.sh 1.1.0 1.1 <out>). - Search is per version; results come from the version being read.
gh-pagesgains one commit per deploy, as before.- One-time bootstrap after merge: the merge's own deploy publishes
devand removes the unversioned site (the root redirects todevuntil a release exists); then dispatch the workflow withref = 1.1.0,version = 1.1to publish1.1aslatest.
Amended 2026-11-20¶
The sections above are kept as decided on 2026-11-19. The maintainer changed three things on 2026-11-20.
- No
devversion (replaces §2 and thedevrows of §3, §5, §7 and §8). Thedevdocs weren't useful to readers, somainis no longer published.deploy-docs.ymlhas nopushtrigger; the dailyschedule, thediscussionevents and aworkflow_dispatchwith no inputs rebuild only the latest release, from its newest tag; areleaseevent and a dispatch withref+versionare unchanged.build-versioned-docs.shanddocs-versions.pyaccept only release linesX.Y.docs-versions.pydrops any other entry fromversions.json, so the next deploy removes thedev/folder fromgh-pages. Links to it already sent to readers (an announcement email links…/clinvar-gkm/dev/parquet/migrating-from-1.1/) keep working: the root404.htmlsends…/dev/<page>to the same page in the latest release, or its home.versions.jsandversions.csshave only the latest and older states. A docs change reaches the site with a release, or by mapping the line to the fixed commit indocs-line-sources.txt(§6) and dispatching it. - Each docs version shows its own data line. The download tables (
r2-browser.js) and the live query console (duckdb-console.html) read the release line of the docs version in the page URL: the path segment after/clinvar-gkm/(1.1) is looked up in the rootindex.json'sversions. A URL without a version (a local build) or a version with no data line reads the current line. Before, every version showed the current line's files under prose about its own line. On a frozen line, the views whose files the freeze deleted (weekly fulls, Parquet) say so, with the freeze date from the line'sMANIFEST.json, and link to the same page in the latest docs; the console no longer falls back to a hard-coded line. Both files join the overlay (§6), so rebuilding an older version ships them; they must keep the mount types older pages use. - A Previous Releases page in Get the Data (
docs/data-access/previous-releases.md) lists every line the rootindex.jsonmarksfrozen, newest first: its schema version,superseded_by, freeze date, links to itsindex.json,feed.xml,README.txtandMANIFEST.json, its monthlies and its deltas. The list is read at page load, so a line frozen later appears with no docs edit. It renders only on the docs of the current line; an older version's copy points to the latest docs.
The 1.2 docs gain the page by mapping 1.2 in docs-line-sources.txt to the 1.0 commit that adds it, shown
as 1.2.0 (§6), and dispatching 1.2; dispatching 1.1 rebuilds it with the new data views.
Amended 2026-11-21¶
The 2026-11-20 amendment is kept as written. The maintainer changed its item 3 on 2026-11-21, after reviewing
the published 1.2 and 1.1 docs: the earlier lines were hard to find, and the 1.1 docs sent readers to the
1.2 docs for them.
- Each docs version lists the lines before its own (replaces "renders only on the docs of the current
line"). On docs version
X.Y, the Previous Releases list shows the lines the rootindex.jsonmarksfrozenwhose number is lower thanX.Y, newest first; neverX.Yitself or a newer line. The latest (1.2) docs list1.1and1.0; the1.1docs list only1.0; a version with no earlier line says so. A page whose URL has no version (a local build) uses the current line. The download tables and the console still readX.Y's own line (item 2). - The Get the Data landing page shows them inline.
download.mdhas a Previous Releases section with a compact table of the same lines (data-r2-type="previous-summary": line, schema, status withsuperseded_byand freeze date, links toindex.json,feed.xml,README.txtandMANIFEST.json), each linking to its monthlies and deltas on the Previous Releases page. The monthly, weekly full, delta and Parquet pages carry a one-line pointer to it. - The
1.1docs get the page too. Their content comes from036bec2(§6), which predates it, sodocs-line-sources.txtmaps1.1to the tip of the long-lived branchdocs/line-1.1:036bec2plus the Previous Releases page, its nav entry, the landing-page section and the pointers, worded for the 1.1 line. Every other1.1page is unchanged. A later fix to the1.1docs is a commit on that branch, then a remap to its new tip and a dispatch of1.1. Keep the branch:deploy-docs.ymlchecks out withfetch-depth: 0, which fetches every branch, andgit archiveneeds the commit to be reachable. - A frozen line's console shows no tables. A frozen line keeps no Parquet (ADR 0008), and the console's examples are written for the current tables, so on a frozen line's docs the console says at once that the line keeps no Parquet set and links the latest docs' console and Parquet Files page, even while the line's old set is still on R2 before its deletion.