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
Rewrite GitHub anchor links to user-content-
#372
Conversation
I don't understand why we want this, can you explain a bit please? |
For some reason, the linkcheck builder fails when it tries to check heading anchors on a GitHub page with Markdown This PR simply removes the GitHub specific cases with a more generic "ignore all pages from GitHub". For example, |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2022-10-28-documentation-team-meeting-13/22806/1 |
Found the upstream (Sphinx) issue on this: sphinx-doc/sphinx#9016 It seems the regex option to capture github.com URLs won't work because linkcheck_anchors_ignore only captures the anchor part of the URL: https://github.com/sphinx-doc/sphinx/blob/master/sphinx/builders/linkcheck.py#L585-L587 |
There's a workaround where Though, the heading won't be visible as it's covered by some GitHub UI element. |
There are two options as far as I see:
I'm gonna opt for the second option on this pull-request for now and add a note in |
3d232b7
to
bed572b
Compare
user-content-
I'd very much like to keep anchor links checks. It's really discouraging to newcomers when docs point to bad URLs. There is a third way too: fix/patch/monkeypatch or even fork Sphinx so link checking works for us. |
Due to an Sphinx issue[1], linkcheck fails on GitHub anchors for GitHub rendered documents. This change rewrites the anchors to the ones that can be verified by linkcheck. [1]: sphinx-doc/sphinx#9016
bed572b
to
7ba7bb2
Compare
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.
Awesome find 👍 👍
Due to an Sphinx issue, linkcheck fails on GitHub anchors for
GitHub rendered documents.
This change rewrites the anchors to the ones that can be verified by
linkcheck.