@@ -9,7 +9,7 @@ This folder contains the Sphinx documentation source and build tooling for local
99- [ Multiversion Implementation (No sphinx-multiversion)] ( #multiversion-implementation-no-sphinx-multiversion )
1010 - [ What Gets Built] ( #what-gets-built )
1111 - [ Version Selection Rules] ( #version-selection-rules )
12- - [ How the Sidebar Switcher Works] ( #how-the-sidebar-switcher -works )
12+ - [ How the Version Dropdown Works] ( #how-the-version-dropdown -works )
1313- [ Purge and Rebuild Behavior] ( #purge-and-rebuild-behavior )
1414- [ Local Build and Testing] ( #local-build-and-testing )
1515- [ GitHub Pages Deployment] ( #github-pages-deployment )
@@ -40,7 +40,7 @@ The `docs/Makefile` supports these explicit targets:
4040- ` make html-multiversion `
4141 - Builds versioned docs without ` sphinx-multiversion ` using ` scripts/build_versioned_docs.sh ` .
4242- ` make html-multiversion-preview `
43- - Same as above, plus local branches for preview/testing .
43+ - Same as above, plus the current git branch as ` local-branch- preview` .
4444
4545Catch-all behavior is enabled:
4646
@@ -59,6 +59,10 @@ Versioned docs are generated by:
5959
6060- ` main ` branch is always built and published as ` current ` .
6161- Selected release tags are built from git tags.
62+ - ** Docs IA cutover at v0.21.0:**
63+ - ** ` current ` and tags ` >= v0.21.0 ` ** use ** main's** ` docs/conf.py ` with that ref's ` docs/source ` (sphinx-immaterial / section-folder IA).
64+ - ** Tags ` <= v0.20.x ` ** use ** ` v0.20.0 ` 's** ` docs/conf.py ` (RTD / flat layout) with each tag's own ` docs/source ` .
65+ - ** ` local-branch-preview ` ** (optional) uses the current branch's own conf + source (pre-merge validation).
6266- Output layout:
6367 - ` docs/build/html/current/index.html `
6468 - ` docs/build/html/vX.Y.Z/index.html `
@@ -70,9 +74,10 @@ Versioned docs are generated by:
7074` scripts/select_versions.py ` applies these rules:
7175
72761 . Identify the highest major version present in tags.
73- 2 . Include the latest patch release for the last 5 minor series in that major.
74- 3 . Include the latest available release for each of the last 3 majors.
75- 4 . De-duplicate and sort descending (newest first).
77+ 2 . For major ` 0 ` , include the latest patch release for every minor from the current minor down to ` 0.12 ` (inclusive).
78+ 3 . For other majors, include the latest patch release for the last 5 minor series in that major.
79+ 4 . Include the latest available release for each of the last 3 majors.
80+ 5 . De-duplicate and sort descending (newest first).
7681
7782Example ordering:
7883
@@ -82,13 +87,27 @@ Example ordering:
8287- ` v0.14.0 `
8388- ` v0.13.0 `
8489- ` v0.12.1 `
90+ - … through ` v0.12.x ` when older minors exist
8591
86- ### How the Sidebar Switcher Works
92+ ### How the Version Dropdown Works
8793
88- - ` scripts/build_versioned_docs.py ` writes ` versions.json ` with ` name ` , ` url ` , and ` is_latest ` .
89- - ` docs/conf.py ` loads this manifest via ` DOCS_VERSIONS_FILE ` .
90- - ` docs/_templates/versions.html ` renders the version list in the RTD sidebar.
91- - Links target ` .../index.html ` explicitly to avoid directory-listing behavior in local ` file:// ` browsing.
94+ - ` scripts/build_versioned_docs.py ` writes a ** superset** ` versions.json ` with:
95+ - mike / sphinx-immaterial fields: ` version ` , ` title ` , ` aliases `
96+ - legacy RTD fields: ` name ` , ` display_version ` , ` url ` , ` status ` , ` is_latest ` , ` release_date `
97+ - RTD-era refs load the manifest at build time via ` DOCS_VERSIONS_FILE ` into ` versions.html ` .
98+ - Immaterial refs enable ` version_dropdown ` and fetch the parent ` ../versions.json ` over HTTP (` version_json ` in ` conf.py ` ).
99+ - Use a local HTTP server to test the immaterial switcher (see below).
100+
101+ ### Preview builds
102+
103+ ``` bash
104+ make -C docs html-multiversion-preview
105+ ```
106+
107+ - Still publishes ` current ` from ` main ` .
108+ - Also builds the ** current git branch** once as ` local-branch-preview ` (skipped if you are on ` main ` or detached HEAD).
109+ - To review a feature branch before merge, check it out, run preview, then select ` local-branch-preview ` in the version menu.
110+ - Preview builds from the ** working tree** (uncommitted conf/theme/source edits are included).
92111
93112## Purge and Rebuild Behavior
94113
@@ -122,7 +141,7 @@ make -C docs spelling
122141make -C docs html-multiversion
123142```
124143
125- 1 . If you need to test branch previews in the version menu :
144+ 1 . If you need to preview the current branch against ` main ` / release tags :
126145
127146``` bash
128147make -C docs html-multiversion-preview
@@ -132,7 +151,7 @@ Practical rule of thumb:
132151
133152- Doc text/layout change only: ` html ` + ` spelling `
134153- Versioning/switcher/build-script change: ` html ` + ` spelling ` + ` html-multiversion `
135- - Branch preview verification: add ` html-multiversion-preview `
154+ - Branch theme/IA preview: ` html-multiversion-preview ` , then select ` local-branch -preview`
136155
137156### Open docs
138157
@@ -145,7 +164,9 @@ cd docs/build/html
145164python3 -m http.server 8000
146165```
147166
148- Then open [ http://localhost:8000 ] ( http://localhost:8000 ) .
167+ Then open [ http://localhost:8000/current/index.html ] ( http://localhost:8000/current/index.html ) to exercise the version dropdown.
168+
169+ Note: ` make html ` builds a single-version tree without a parent-level ` versions.json ` ; use ` html-multiversion ` to test version switching.
149170
150171## GitHub Pages Deployment
151172
0 commit comments