Repository navigation
Update version switcher to set 2.0 as preferred version - #25
Conversation
Also adds a 'preferred' keyword to the stable version, which is used to select which pages receive a version warning banner from the PyData Sphinx Theme.
…Theme After numpy/doc#25, this will show a warning banner for past and unreleased versions of the docs. See https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/announcements.html#version-warning-banners The warning banner can be dismissed by the user.
|
@charris can you merge this one? |
|
Well, I didn't expect a silly whitespace fix to cause merge conflicts!? Will look into it, or do you just want to force push @melissawm and then we put it in without things? |
|
I'll update 👍 |
|
Should be good to go - thanks @seberg |
|
Thanks! I guess it might now only be the preferred thing anymore, but that is good anyway. Is it correct that it shows "Choose version" for the stable one? |
|
Hmm this may be pydata/pydata-sphinx-theme#1829? Let me check |
|
Looking at the console for the stable docs I see Not sure if this is interfering with the PyData version switcher. I'll try to debug |
|
stackoverflow says the script is missing a jquery reference, something like And indeed, when I compare the 2.0 directory to the other versions, I see it is missing a |
|
Not sure if that fixes the switcher but let's try |
|
Something else is wrong, I don't see a call to load the script from the HTML. I will try rebuilding the docs. |
|
Let me know if you need help, I'll be around. |
|
Something changed with the format of the version string in <script>
DOCUMENTATION_OPTIONS.theme_version = '0.15.3';
DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://numpy.org/doc/_static/versions.json';
+ DOCUMENTATION_OPTIONS.theme_switcher_version_match = 'doc/2.0';
- DOCUMENTATION_OPTIONS.theme_switcher_version_match = '2.0';
DOCUMENTATION_OPTIONS.show_version_warning_banner = false;
</script>or the versions.json needs to be changed {
"name": "2.0 (stable)",
- "version": "doc/2.0",
+ "version": "2.0",
"url": "https://numpy.org/doc/stable/",
"preferred": true
},
|
|
Are you rebuilding @mattip or would you like me to do it? |
…Theme After numpy/doc#25, this will show a warning banner for past and unreleased versions of the docs. See https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/announcements.html#version-warning-banners The warning banner can be dismissed by the user.
Also adds a 'preferred' keyword to the stable version, which is used to select which pages receive a version warning banner from the PyData Sphinx Theme.
This should be merged after the 2.0 documentation is published, so that "stable" points to the right pages.