DOC: Add version switcher to documentation - #153
AbhiRKeesara wants to merge 1 commit into
Conversation
|
Cool. Creating the index.html is a once-off, no need to do it repetitively in CI. Also creating the version json need only happen on release, not on dev builds. |
|
@mattip - Thanks for the feedback! I'll remove the Regarding |
My mistake.
Why not change index.html as part of this PR? |
|
Thanks for confirming on For
|
|
Ahh, I see. That file only lives on gh-pages, so yes, a separate PR is needed. |
Add a version dropdown to the documentation navbar, modeled after NumPy's official docs pattern. This allows users to easily switch between different documentation versions. Changes: - Add versions.json with entries for dev, 1.1.0, 0.2.0, 0.1.0 - Update conf.py with html_theme_options for version switcher - Add GitHub icon link to navbar - Update copyright year to dynamic range (2005-current) per LICENSE.txt - Extend publish_docs_to_pages.yml to: - Build versioned docs on release tags (v*) - Auto-update versions.json when new releases are published - Deploy dev docs to /dev/ and releases to /version/X.Y.Z/ - Update 'latest' symlink to point to newest release - Add root index.html redirect to /latest/ - Update RELEASE.md to reflect automated docs deployment Closes numpy#78
83d329f to
1073f61
Compare
|
I think this PR can be simplified significantly. We can unconditionally generate the list of versions on each docs build without penalty. The docs repo, into which we're pushing, contains the list of versions already, and the latest version is stable. I am on a phone now, but can review a bit more carefully later. If this feels urgent, go ahead and merge then I will refactor. Otherwise polishing it up a bit will, I think, make the flow easier to follow. |
|
@stefanv - Thanks for the feedback! No urgency on my end. Happy to wait for your detailed review and simplify based on your suggestions. The cleaner the final implementation, the better. |
PR summary
Closes #78
What problem does this PR solve?
The documentation currently has no way for users to switch between versions. Users visiting the homepage see a static landing page rather than being directed to the latest stable docs.
Why are you interested in working on this PR?
I'm participating in the NumFOCUS Sustaining Open Source Series program and picked this issue to help improve the documentation experience.
Changes:
versions.jsonwith entries for dev and 1.1.0 (stable)html_theme_optionsinconf.pyfor the version switcher (modeled after NumPy's pattern)publish_docs_to_pages.ymlworkflow to:v*)versions.jsonwhen new releases are published/dev/and releases to/version/X.Y.Z/latestsymlink to point to newest releaseindex.htmlredirect to/latest/(per maintainer suggestion in DOC: Documentation should be available for different versions #78)RELEASE.mdto reflect automated docs deploymentTesting:
make htmland verified the version switcher appears in the navbarversions.jsonNotes:
latestsymlink and root redirect will take effect on the first release tag push after this is mergedversions.jsonby the workflowAI Disclosure
Used Kiro (AI assistant) for implementation guidance, workflow YAML generation, and drafting this description. Changes were verified locally through docs builds and manual testing.