-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
DOC: fix version switcher #22258
DOC: fix version switcher #22258
Conversation
I followed the link and found the JSON file, but firefox is giving me |
Maybe, looks like there is a stray comma at the end. However, not sure if that is breaking things.... |
fixed the comma, but of course that won't be in the devdocs version, so we would have to merge that to see if that helps |
90% sure this will work now - apparently you have to specify the version field. However, they seem to do some fancy stuff to compare the desired page to the current page, so the full list of versions doesnt' seem to get populated? Perhaps will if it is put on devdocs, but I can't tell. Maybe @choldgraf would have a minute to stop by and tell us if we are doing it right. |
@drammock is probably in a better place to provide input than me, since he built the feature! 😅 |
The button now has some version info. I'm hoping that when it is pushed to devdocs it will work. However, I'm not sure - there seems to be a fair bit of JS logic checking for page consistency that I'm not sure applies to our docs. |
Yes.
The comparison of desired page to current page does this: if you're viewing "contributing guide" and use the version switcher to go to version 2.2, it looks for the contributing guide within the v-2.2 docs folder subtree. If the page isn't there, it takes you to the 2.2 homepage instead. The JSON and One thing to watch out for is that there can be cross-domain resource restrictions (CORS) that prevent pages in the circleCI build (at Another strange thing I see in the browser console is a request for a One other random thing I happened to notice is that the 2.2 entry goes to version 2.2.4, but what is displayed is actually the 2.2.5 docs. Not likely to cause any problems for users though. |
This a long standing thing we do on the top-level index for the built docs that links to the latest version. It is a way that we can inject changes into the old dcos without re-rendering them. |
Thanks @drammock That helps. Hopefully the domain crossing stuff works - I think our devdocs and main site are basically the same (github pages). Understood about the existing pages check.... We actually have a bunch fo redirects in our current docs to pages that have moved, but of course the old docs don't have redirects to new pages. |
yeah, we have the same issue over at MNE-Python. Users viewing old docs and using the switcher to get to current stable/dev will benefit (because the redirect page exists, the switcher will point to that), but using the switcher to go from stable/dev to older doc versions will soft-fail (go to target version's homepage) from pages that have moved. |
See #22261 for just changing the json |
069a068
to
2d58163
Compare
PR Summary
Fix version switcher now that json file is in place.
Note that changes to the json file itself will have to be merged, but the switcher is still not quite working, so lets make sure we understand that first.
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).