[Docs] Versioned documentation with mike (latest/stable selector)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 17
- Avg merge
- 21h 36m
- Merged PRs (30d)
- 22
Description
Summary
The MkDocs site publishes a single rolling version from main. As the
project approaches Beta/1.0 with explicit stability promises, docs should
be versioned: a latest (development) and per-minor (0.14, 0.15, …)
selector via mike, so adopters on a released version read docs that
match their installed package.
Why this matters
- The stability page (
docs/stability.md) makes compatibility promises
per surface; those promises are hard to honor when docs always describe
main. - Rolling docs regularly document features that aren't on PyPI yet (the
changelog's Unreleased section is substantial) — a classic source of
adopter confusion and support load. - Version selectors are an expected maturity signal for
production-oriented Python libraries (mkdocs-material supports mike
natively).
Proposed scope
- Add
miketo the[docs]extra; configureextra.version.provider: mikeinmkdocs.yml(mkdocs-material version selector). - Update
docs.ymlworkflow:- on push to
main:mike deploy dev(aliaslatestconfigurable); - on release publish:
mike deploy <major.minor> stable --update-aliases.
- on push to
- Default URL serves
stable; banner ondevnoting it tracksmain
(mkdocs-materialoutdated/version banner). - Document the scheme in CONTRIBUTING (when to backport doc fixes).
- One-time backfill: deploy current state as both the current minor and
dev.
Implementation notes
- Workflow:
.github/workflows/docs.ymlcurrently builds and deploys to
GitHub Pages directly; mike manages thegh-pagesbranch itself —
migrate carefully to avoid clobbering existing pages (mike adopts the
branch; do a dry run on a fork or with--push --remoteoff first). docs/gen_ref_pages.py(API reference generation) runs at build time —
verify it behaves under mike's multi-version builds.- Keep the version dropdown list short (stable, dev, plus 2–3 recent
minors) by pruning old versions withmike deletepolicy documented. - The README version drift check (
scripts/check_readme_version.py)
already enforces version consistency — extend it or document the
release checklist step for docs deployment.
Acceptance criteria
- Docs site shows a version selector with at least
stableand
dev. - Release workflow publishes versioned docs automatically on GitHub
release. -
devshows a banner that it documents unreleased changes. - CONTRIBUTING documents the docs-versioning workflow.
- Existing URLs keep working (redirect or default alias).
Out of scope
- Backfilling docs for already-released historical versions.
- Hosting changes beyond GitHub Pages.
References
- mike: https://github.com/jimporter/mike
- mkdocs-material versioning guide:
https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/ - Related: #324 (API stability visibility),
docs/stability.md
Priority: P2 · Effort: M · Impact: Medium
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .github/workflows/docs.yml and mkdocs.yml, then inspect docs/gen_ref_pages.py and scripts/check_readme_version.py. Trace the current GitHub Pages deployment before evaluating mike's dev and release commands, including the existing URL behavior. Done means the selector, release publishing, dev banner, CONTRIBUTING guidance, and URL compatibility meet the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python
- Domain
- ci-cd, documentation, release
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100