You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 97171ca
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: RELEASE.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,3 +149,47 @@ The release workflow (`.github/workflows/build-and-publish.yml`) is triggered by
149
149
-**`main`**: Stable releases and release tags
150
150
-**`dev`**: Active development branch
151
151
- Pull requests: `dev` → `main` for releases
152
+
153
+
### Documentation Version Switcher
154
+
155
+
The documentation uses a centralized version switcher that allows users to navigate between different documentation versions (stable, latest, and specific releases). This system is designed to work across all deployed documentation versions automatically.
156
+
157
+
#### Architecture
158
+
159
+
The version switcher uses an **external, centrally-managed approach**:
160
+
161
+
1.**External Storage**: The `switcher.json` file is maintained in a separate repository: [`saezlab/corneto-data`](https://github.com/saezlab/corneto-data)
162
+
- Located at: `assets/docs/switcher.json`
163
+
- Contains entries for all available documentation versions
164
+
- Each entry specifies: version name, version identifier, and documentation URL
165
+
166
+
2.**Dynamic Fetching**: Each documentation build fetches the switcher dynamically from:
- A timestamp parameter is added to bypass browser caching
171
+
- Configured in `docs/conf.py` via the `_switcher_url_with_ts()` function
172
+
173
+
3.**Automated Updates**: When documentation is deployed to GitHub Pages:
174
+
- The `page_build` event triggers (`.github/workflows/dispatch-after-pages-build.yml`)
175
+
- A `repository_dispatch` event is sent to the `corneto-data` repository
176
+
- The `corneto-data` repository automatically updates `switcher.json` with the new version
177
+
- Requires the `SWITCHER_PAT` secret (Personal Access Token) for cross-repository access
178
+
179
+
4.**Version Mapping**: Documentation deployments use the following version identifiers:
180
+
-`dev` branch → deployed as `"latest"`
181
+
-`main` branch → deployed as `"stable"` (typically marked as preferred)
182
+
- Git tags (e.g., `v1.0.0`) → deployed using the tag name
183
+
184
+
The `SPHINX_VERSION_MATCH` environment variable (set in `.github/workflows/deploy-docs.yml`) tells the PyData Sphinx Theme which version is currently being viewed.
185
+
186
+
#### Benefits of This Approach
187
+
188
+
-**Central Management**: One `switcher.json` serves all deployed documentation versions
189
+
-**Automatic Updates**: Old deployed docs automatically show new versions in the switcher dropdown
190
+
-**No Regeneration Needed**: Previously deployed documentation doesn't need to be rebuilt to show new versions
191
+
-**Consistency**: All documentation versions display the same version list
192
+
193
+
#### Manual Switcher Updates
194
+
195
+
If the automatic workflow fails or manual intervention is needed, the `switcher.json` file can be updated directly in the [`saezlab/corneto-data`](https://github.com/saezlab/corneto-data) repository at `assets/docs/switcher.json`.
0 commit comments