Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Doc implement reredirects#19456
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
74331a4
toabeef9d
CompareThe placeholders cause the build to fail:
|
Yep. Those can be orphaned. Looks like the links need to be relative to the directory that they are being made in as well (despite what the docs say). Making them absolute to root probably works too, but doesn't work in the artifacts html... |
Well, that works. I'm not a huge fan to be honest, and almost wish we could just have a new sphinx directive. Is that easy? |
To see how this work, navigate tohttps://53094-1385122-gh.circle-artifacts.com/0/doc/build/html/api/backend_gtk3agg_api.html and it will take you to |
I'll have a look at the directive possibility. |
Cool, it should be pretty straightforward. I may look at it as well, but probably a bit of learning curve. For reference, all the reredirects does is change the html to: <html><head><metahttp-equiv="refresh"content="0; url=${to_uri}"></head></html> It might be nice to spice that up a bit (add a canonical?) but I think even as-is search engines will recognize that this is not supposed to be indexed. |
@jklymak Seehttps://github.com/anntzer/sphinx-redirectfrom (quick hack, barely tested, unlikely to eat your dog though). I went for what I think is a slightly nicer approach of not actually requiring to keep the old files in the source tree and having a |
Nice, I think I agree thats better, because if we delete the new target, it would be nice to know we have to redirect again. I'll play with that over the w/e. Thanks a lot! |
8087a9d
to3af306c
CompareAs an example from the build above:
So now if you navigate to: https://53162-1385122-gh.circle-artifacts.com/0/doc/build/html/api/backend_qt4agg_api.html you are immediately redirected to: https://53162-1385122-gh.circle-artifacts.com/0/doc/build/html/api/backend_qt_api.html |
beec731
to9289f61
Compareanntzer commentedFeb 7, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I guess you could support both |
9289f61
to4a205db
Compare
Sure, well we could cross that bridge when we come to it. For now we have a pretty easy way to redirect if we move, so I think this can wait. |
Uh oh!
There was an error while loading.Please reload this page.
In the meeting, or is it okay to merge now? |
This is fine from my end. I think folks have had lots of time to voice concerns. Plus its not an irrevocable change if we decide this is a bad way to go. |
@timhoffm@story645@dstansby@brunobeltran This make sense to all of you? |
Need to add warning for an overwrite.... |
7049b88
tocf7f0bb
CompareENH: add redirect_from sphinx extensionCo-authored-by: Antony Lee <anntzer.lee@gmail.com>Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
cf7f0bb
to7e4a922
Comparea00a2bf
to58f495a
Compare58f495a
to47145d1
Compare.. added a redirect from |
Uh oh!
There was an error while loading.Please reload this page.
Did we mean to take out |
Ooops! No, I mean we could ;-) It crashes on my machine when I do the doc build. |
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
I think this is still in good shape? I wouldn't mind it being merged so we can start doing more manual redirects |
…456-on-v3.4.xBackport PR#19456 on branch v3.4.x (Doc implement reredirects)
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
UPDATE:
This is based off#19440 just because that is a good example where some existing files were deleted.
This now uses a vendored versionhttps://github.com/anntzer/sphinx-redirectfrom@anntzer put together. In#19440
doc/api/backend_qt4agg_api.rst
was removed, and the info is now indoc/api/backend_qt_api.rst
sodoc/api/backend_qt4agg_api.rst
now has aredirect-from
directive:When the build is made this makes
build/html/backend_qt4agg_api.html
which has a refresh:so the old link still exists.
(probably not super necessary for this example, but in general should be quite useful).
I think there are in general some major disadvantages compared with the
reredirect
approach. Namely that moving whole directories will require each file in the directory getting this directive to its new location. OTOH, that is pretty easy to script up if someone needs to do a bulk move.PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).