-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cooperate with linkcheck builder #6
Conversation
Redirect links that direct to an HTTP or HTTPS URL (as opposed to relative links inside the same website) are now passed to the linkcheck builder so that it can do its checking work on them. This necessitates requiring Sphinx >= 7.1 due to a restructuring of the linkcheck builder code. Fixes documatt#3
ping... this looks super helpful. anything to be done to get this in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice job! Thanks and so much sorry for waiting.
This is nice, but in practice most redirects are to the same documentation. Does sphinx-reredirects check if these are correct? |
No — this is the limitation mentioned in the documentation added by this PR. It's been a while since I prepared this, but I seem to recall checking internal links was more difficult. |
I think ideally you'd want to check those when the build happens. |
This nice improvement released in v0.1.5. Thanks again @jeanas for this PR. Yes, @asmeurer, at this moment it checks redirects to external URLs only. Mentioned in the docs https://documatt.com/sphinx-reredirects/usage.html#checking-your-redirects. I have created #10 for internal link checking. Hopefully, you @asmeurer, @jeanas, or somebody else will help soon. |
Redirect links that direct to an HTTP or HTTPS URL (as opposed to relative links inside the same website) are now passed to the linkcheck builder so that it can do its checking work on them.
This necessitates requiring Sphinx >= 7.1 due to a restructuring of the linkcheck builder code.
Fixes #3
tox
passes.I haven't added tests because it's not clear to me how/if they should be written: if the tests do an actual build with the linkcheck builder, they will be sensitive to network connectivity and external websites, which is probably undesired.
If wanted, this could also be made to work on Sphinx <7.1 with slightly different code.