-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Redirect old whatsnew links #23695
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
Comments
I can write a script for this, but where exactly are the HTML template files defined, from which the script can be called? Or do you just want the code? |
Thanks. I think in |
I've written a script to replace the URL links, which makes some assumptions:
If these assumptions are correct, I can make the PR. Since this PR includes no changes to Python code, are running / passing the tests necessary? Also, is there any page with many such links to test it on? |
Thanks. The The "version number" for your second bullet is hand-written.
Some inconsistencies. 060 vs. 0700. #21599 will hopefully be merged soon. If not, you can apply your changes on top of it to check the actual URLs. |
Ok so this update should deal with the variable version numbers, so reformatting links to either v0.6.0 or v0.24.0. About #21599 , how would you like me to proceed? |
Just merged it into master, so you you merge that then you're good to go. FYI, the doc build will be live in ~1 hour, whenever https://travis-ci.org/pandas-dev/pandas/jobs/455198927 finishes. Those will be uploaded to http://pandas-docs.github.io/pandas-docs-travis/ (you don't have to worry about redirecting anything on that domain) |
Thanks for this! A redirect map with a hook for parsing uri fragments could be a useful addition to Sphinx, as well. You can add custom JavaScript to Sphinx templates with https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_js_file |
In #21599 we're chagning the structure of our whatsnew. Previously the whatsnew for each version was concatenated into a single large file.
Consider a link to the anchor
#whatsnew-0190-enhancements-other
. There are three cases:/stable
(which is probably more common), or to version 0.24.0 or higher will break. http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#whatsnew-0190-enhancements-other won't be a valid reference. We would need to rewrite it to http://pandas.pydata.org/pandas-docs/stable/releases/#whatsnew-0190-enhancements-otherWe use nginx for our webserver at pandas.pydata.org. But AFAICT, we can't use a rewrite rule to redirect this links, since nginx doesn't see the anchor.
We should be able to detect this in Javascript. When we're on the whatsnew for 0.24.0 or greater, we want to look for anchors pointing to
/whatsnew.html#whatsnew-<version>
for 0.23.4 or older. Then we'd rewrite/whatsnew.html#whatsnew-<version>-<title>
to/whatsnew/<version>.html#<title>
. So a test case isThe text was updated successfully, but these errors were encountered: