Add version selector to Docs#1356
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1356 +/- ##
=======================================
Coverage 89.75% 89.75%
=======================================
Files 58 58
Lines 8529 8529
Branches 8529 8529
=======================================
Hits 7655 7655
Misses 561 561
Partials 313 313 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1084f2a to
17d6346
Compare
alexdewar
left a comment
There was a problem hiding this comment.
This looks great and I'm all for this approach. I suggest we merge this branch directly into main and close #1355.
I do think it would be better if we could avoid displaying the warning on the v2.1.0 page though, as it's a little confusing. I've made a suggestion -- let me know if you think it's workable.
| { label: "stable" }, | ||
| {%- for release in releases %} | ||
| { label: "{{ release }}" }, | ||
| {%- endfor %} |
There was a problem hiding this comment.
Instead of having a separate stable/ folder, I'm wondering if we can figure out which is the stable version on the frontend.
For example, maybe you could change the objects in versions to have separate label and path fields. After this jinja business, you could append (stable) to the label of the first release. We could not show the banner for anything with a label that contains stable. What do you think?
There was a problem hiding this comment.
Ok, I have done similar to this. I have made the objects include an additional stable field that is a boolean that is determined in the generate_header.py python script. With the most recent release being the only one labelled as stable.
This has resulted in not needing to build the separate stable/ folder and also being able to label the stable version as such and not include the banner.
So, currently we'll only see a banner for version 2.0.0 and the development version.
I closed the other PR and deleted the branch and it automatically closed this PR. Silly unexpected behaviour.
Yea, I think there is something workable there. Will try it out |
Assisted-by: Copilot Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Assisted-by: Copilot Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Assisted-by: Copilot Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1e8f9ef to
9575438
Compare
Description
This PR extends on #1355 by adding a version selector widget to the bottom right of the docs (inspired by the Django docs and the MUSE1 documentation).
The widget is built by adding HTML and CSS components to the
theme/header.hbswith some JS to dynamically determine which version of the docs we are currently in (just like the banner in #1355, this was LLM-assisted). But the list of versions needs to be generated dynamically, so this is achieved following the same pattern pre-existing in the documentation:headeroption in the justfile to run the scriptI also have removed the "Other versions of documentation" section of the docs. I believe this widget supersedes the need for that section, which was already a little buggy/confusing because it would always redirect to the development version of the docs.
Screenshots:



An extension on #1188
Close #1188
Assisted-by: Claude Sonnet 4.6
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks