-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version warningbar #1354
Version warningbar #1354
Conversation
c852909
to
6aa43a6
Compare
all green! ready for review/merge. You can see the warning bar here: https://pydata-sphinx-theme--1354.org.readthedocs.build/en/1354/ cc @stefanv (sorry it's taken this long to get it finalized!) |
This is great, thanks @drammock! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR reads well, and the code is easy to follow; thanks!
There will be a warning on older versions that were built after the inclusion of this feature, and had the feature turned on at build time. Any older versions will not show the warning unless someone goes in and hard-codes one, or they already include something similar to the JS that this PR is based on (i.e. MNE-Python's version, sklearn's version). I suppose we could add to the docs some template HTML that people could copy-paste as a one-time addition to older versions of their docs? Or a standalone JS script and the associated |
Yes, I think that's be a great addition! |
adding a crossref here to @bryevdv's comments in #780 about what it would take for this to work with bokeh (key bit pullquoted below):
This is a note-to-self (or possibly note-to- @12rambau ) to double check that what we're doing here will work for Bokeh, before merging. |
After looking at Bokeh's current switcher.json file I'm fairly sure the implementation here should work fine for their use case (namely: two entries in However it revealed an interesting/subtle bug which is that if multiple entries in Below are the necessary changes to the Bokeh JSON to make it work optimally with this PR (not valid JSON because I put in comments to point out the new lines): [
{
"name": "latest",
"version": "3.2.0", // <--- NEW LINE
"url": "https://docs.bokeh.org/en/latest/",
"preferred": true // <--- NEW LINE
},
{
"version": "3.2.0",
"url": "https://docs.bokeh.org/en/3.2.0/"
},
{
"version": "3.1.1",
"url": "https://docs.bokeh.org/en/3.1.1/"
},
{
"version": "3.0.3",
"url": "https://docs.bokeh.org/en/3.0.3/"
},
{
"version": "2.4.3",
"url": "https://docs.bokeh.org/en/2.4.3/"
},
{
"version": "2.3.3",
"url": "https://docs.bokeh.org/en/2.3.3/"
},
{
"version": "2.2.3",
"url": "https://docs.bokeh.org/en/2.2.3/"
},
{
"version": "2.1.1",
"url": "https://docs.bokeh.org/en/2.1.1/"
},
{
"name": "dev (3.3)",
"version": "dev", // <--- NEW LINE
"url": "https://docs.bokeh.org/en/dev-3.3/"
}
] |
Nice catch, Dan! I hope this can be rolled out now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm arriving after the war, sorry for the delay. I checked the code, nothing to see there @drammock and @stefanv, you did a very good job at coding and evaluating this modification. It's unfortunate that we cannot automatically backport the version number for version build prior from this modification but boh....
Not that I also like the design and it will continue to work with the "bak to top" widget (it listens to an empty pixel under the navbar). I think it should be merged as soon as possible and released so that it's included in new builds.
I'll take that as permission to press the green button. Now we just have a few |
Third time's the charm! It is very satisfying to see this finally get in. Thanks all! I think we are overdue for a release! |
(supersedes) closes #1335
(supersedes) closes #780
This PR adds an optional specialized announcement banner to warn users who are viewing versions of the docs other than the latest stable release. It can coexist with the generic announcement banner (it gets stacked above it) and is styled similarly except that it has the "danger" background color.
preferred=true
is usedconf.py
/html_context
crossref: scientific-python/summit-2023#10 (comment)