Repository navigation
DOCS: Adopt sphinxext-rediraffe for redirects - #3043
Merged
Merged
Conversation
Redirects for moved/deleted docs pages can now be added to rediraffe_redirects in docs/conf.py.
Contributor
Author
|
merging, will test in the other PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adopts sphinxext-rediraffe so that docs pages can be moved or deleted without breaking existing links.
sphinxext-rediraffeto thedocsPixi environment and enables it indocs/conf.py.rediraffe_redirects = {}dict todocs/conf.py. Entries map old paths to new paths, relative todocs/, e.g."user_guide/examples/tutorial_old.ipynb": "user_guide/examples/tutorial_new.ipynb". It's empty for now because no pages have been moved or deleted since v4.0.0. URLs from the v3 docs aren't redirected, since they still work under their own Read the Docs version.During the HTML build, rediraffe writes a small redirect page for each entry, e.g.
old.htmlthat forwards tonew.htmland keeps the query string and anchor. Chained redirects are resolved, so users are redirected at most once.This follows CPython's setup, which also keeps a dict in
conf.pyand relies on review to catch missing redirects. rediraffe also has builders that check git for renamed or deleted pages without a redirect, but I left those out to keep this simple. Pages rarely move, and a reviewer can spot renames and deletions in the PR's file list.Testing: I built the HTML docs (without running the notebooks) with:
"old_installation.md": "user_guide/getting_started/installation.md"(not included in this PR): the build createsold_installation.html, which redirects to the installation page.Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure
🤖 Generated with Claude Code