Skip to content
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 warning banner shows on stable docs #545

Closed
psobolewskiPhD opened this issue Dec 28, 2024 · 8 comments
Closed

Version warning banner shows on stable docs #545

psobolewskiPhD opened this issue Dec 28, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@psobolewskiPhD
Copy link
Member

psobolewskiPhD commented Dec 28, 2024

🐛 Bug

With #531 merged the warning banner now shows on napari.org with stable version:
image
Clicking the switch to stable doesn't do anything, but reloads the page.

The warning banner also correctly shows when the latest version is selected, but not when an old version is selected.

@psobolewskiPhD psobolewskiPhD added the bug Something isn't working label Dec 28, 2024
@psobolewskiPhD
Copy link
Member Author

Note after dismissing it once it never shows up again, even with reload, etc. so maybe that's why we missed this.

@jni
Copy link
Member

jni commented Dec 30, 2024

Hmm. Should we revert this in the meantime?

@jax-sobolewski
Copy link

The version switcher looks ok
https://napari.org/dev/_static/version_switcher.json
vs the docs:
https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html#version-warning-banners
only difference is the order of where preferred is placed?
What's odd is the name replacement does work, which I think also uses the preferred flag.

@jax-sobolewski
Copy link

Here's numpy by comparison:
https://numpy.org/doc/_static/versions.json
again everything the same but the order. and theirs works:
no banner: https://numpy.org/doc/stable/index.html
banner: https://numpy.org/devdocs/index.html

@psobolewskiPhD
Copy link
Member Author

Lol wrong account!

@psobolewskiPhD
Copy link
Member Author

psobolewskiPhD commented Dec 31, 2024

OK, shower thought: it's because of the copying of dev pages.
Looks to be true! The banner doesn't show on /stable pages that weren't copied over.
And it's in the HTML to show the banner on the homepage:
DOCUMENTATION_OPTIONS.show_version_warning_banner = true;
I think there is already a script doing some tweaking of the copied pages, so need to check this too.

@psobolewskiPhD
Copy link
Member Author

psobolewskiPhD commented Dec 31, 2024

Boom: we need a line like this:
https://github.com/napari/napari.github.io/blob/4e4b6c60d2465bccda2f979123147b0f64120457/.github/workflows/unversioned_pages.yml#L41

Except that for whatever reason the show_version_warning_banner on napari.org lines have a line break so sed seems not ideal.

        DOCUMENTATION_OPTIONS.show_version_warning_banner =
            true;

@psobolewskiPhD
Copy link
Member Author

The same line is also broken over 2 lines the same way in the numpy docs, so it's something the theme is doing -- even though that's not the longest <script> section line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants