Skip to content

0011 — Versioned documentation

  • Status: Proposed
  • Date: 2026-11-19
  • Amends: ADR 0003 (which docs builds regenerate the Roadmap)
  • Amended: 2026-11-20 — dev removed; 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

  1. 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.
  2. dev is main, rebuilt on every docs merge, as today. It is never the default.
  3. Layout on gh-pages. One folder per version (1.1/, dev/), each a complete Zensical build with site_url set to …/clinvar-gkm/<version>/, so canonical links and sitemap.xml are per version. At the root, written by src/scripts/docs-versions.py:
    • versions.json (the format mike writes) lists the versions. The highest release line carries the alias latest, so a patch to an older line can't take latest from a newer one, and dev never has it.
    • index.html redirects to the latest release, keeping the query and #fragment.
    • 404.html is 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); CNAME and .nojekyll are kept.
  4. The version selector is the theme's. [project.extra.version] provider = "mike" makes Zensical render the Material version selector from versions.json; switching versions keeps the reader on the same page when it exists in the other version. The mike tool itself isn't used: the workflow builds each version with zensical build and writes versions.json itself.
  5. Old / dev / latest is decided in the browser. docs/assets/js/versions.js reads versions.json on every page and compares the page's version to the latest alias. On dev it 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.
  6. 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, sets site_url, adds the [project.extra.version] table if missing, regenerates the Roadmap, and runs zensical build --clean --strict and check-site-links.py. This is how 1.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.txt maps 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. The 1.1.0 tag was cut on 1.0 without main's 1.1.0 docs: its pages give the pre-1.1 v1/datasets/… download URLs, which return 404, and its changelog has no 1.1.0 section. 1.1 is therefore built from 036bec2 (main right after the 1.1.0 forward-merge, #188) and shown as 1.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.
  7. 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) for dev, 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_uri follows the ref the pages come from (edit/main/docs/ for dev, 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.py rewrites the pages' links to this repository's files on main (/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 a 1.1 page links the 036bec2 files, where each linked path exists); a path the ref doesn't have stays on main and is listed in the build log. Links to issues, discussions, pull requests and releases stay as written: they are live, not versioned.
  8. When each version is deployed (.github/workflows/deploy-docs.yml):

    Trigger Builds
    push to main touching the docs paths dev
    release: published for tag X.Y.Z (not a prerelease) X.Y from the tag; versions.json and latest updated
    daily schedule and discussion events dev, and the latest release from its newest tag
    workflow_dispatch, no inputs (on main) dev
    workflow_dispatch with ref and version that ref as that version, e.g. 1.1.0 as 1.1

    The 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.0 builds X.Y, makes it latest, and turns the previous line grey.
  • The release event runs the workflow file at the tag. A tag whose tree has the old whole-site deploy-docs.yml would overwrite every version with one unversioned build. Before publishing a release from a branch that predates this ADR — the 1.0 branch today — bring this workflow and its scripts (build-versioned-docs.sh, docs-versions.py, pin-repo-links.py) onto that branch, or remove its release trigger.
  • The overlay files must keep building against the oldest published docs version. A change to them is checked by building 1.1 from its tag (build-versioned-docs.sh 1.1.0 1.1 <out>).
  • Search is per version; results come from the version being read.
  • gh-pages gains one commit per deploy, as before.
  • One-time bootstrap after merge: the merge's own deploy publishes dev and removes the unversioned site (the root redirects to dev until a release exists); then dispatch the workflow with ref = 1.1.0, version = 1.1 to publish 1.1 as latest.

Amended 2026-11-20

The sections above are kept as decided on 2026-11-19. The maintainer changed three things on 2026-11-20.

  1. No dev version (replaces §2 and the dev rows of §3, §5, §7 and §8). The dev docs weren't useful to readers, so main is no longer published. deploy-docs.yml has no push trigger; the daily schedule, the discussion events and a workflow_dispatch with no inputs rebuild only the latest release, from its newest tag; a release event and a dispatch with ref + version are unchanged. build-versioned-docs.sh and docs-versions.py accept only release lines X.Y. docs-versions.py drops any other entry from versions.json, so the next deploy removes the dev/ folder from gh-pages. Links to it already sent to readers (an announcement email links …/clinvar-gkm/dev/parquet/migrating-from-1.1/) keep working: the root 404.html sends …/dev/<page> to the same page in the latest release, or its home. versions.js and versions.css have only the latest and older states. A docs change reaches the site with a release, or by mapping the line to the fixed commit in docs-line-sources.txt (§6) and dispatching it.
  2. 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 root index.json's versions. 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's MANIFEST.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.
  3. A Previous Releases page in Get the Data (docs/data-access/previous-releases.md) lists every line the root index.json marks frozen, newest first: its schema version, superseded_by, freeze date, links to its index.json, feed.xml, README.txt and MANIFEST.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.

  1. 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 root index.json marks frozen whose number is lower than X.Y, newest first; never X.Y itself or a newer line. The latest (1.2) docs list 1.1 and 1.0; the 1.1 docs list only 1.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 read X.Y's own line (item 2).
  2. The Get the Data landing page shows them inline. download.md has a Previous Releases section with a compact table of the same lines (data-r2-type="previous-summary": line, schema, status with superseded_by and freeze date, links to index.json, feed.xml, README.txt and MANIFEST.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.
  3. The 1.1 docs get the page too. Their content comes from 036bec2 (§6), which predates it, so docs-line-sources.txt maps 1.1 to the tip of the long-lived branch docs/line-1.1: 036bec2 plus the Previous Releases page, its nav entry, the landing-page section and the pointers, worded for the 1.1 line. Every other 1.1 page is unchanged. A later fix to the 1.1 docs is a commit on that branch, then a remap to its new tip and a dispatch of 1.1. Keep the branch: deploy-docs.yml checks out with fetch-depth: 0, which fetches every branch, and git archive needs the commit to be reachable.
  4. 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.