-
Notifications
You must be signed in to change notification settings - Fork 25
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
Better checking for external links #619
Merged
maddenp-noaa
merged 10 commits into
ufs-community:main
from
maddenp-noaa:gh614-external-links
Oct 22, 2024
Merged
Better checking for external links #619
maddenp-noaa
merged 10 commits into
ufs-community:main
from
maddenp-noaa:gh614-external-links
Oct 22, 2024
Conversation
This file contains 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
maddenp-noaa
commented
Oct 22, 2024
maddenp-noaa
commented
Oct 22, 2024
maddenp-noaa
requested review from
NaureenBharwaniNOAA,
christinaholtNOAA,
elcarpenterNOAA,
fgabelmannjr,
WeirAE and
Byrnetp
as code owners
October 22, 2024 21:18
elcarpenterNOAA
approved these changes
Oct 22, 2024
WeirAE
approved these changes
Oct 22, 2024
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.
Nice & clean, looks good
NaureenBharwaniNOAA
approved these changes
Oct 22, 2024
christinaholtNOAA
approved these changes
Oct 22, 2024
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.
LGTM.
maddenp-noaa
commented
Oct 22, 2024
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.
Synopsis
Fixes #614 by replacing link checking using the built-in Sphinx link checker, which operates on the RST files, with a more capable external link checker that operates on the generated HTML files. This results in raw HTML links in e.g.
<a>
or, pertinently,<iframe>
tags being checked the same as links generated by Sphinx from RST code.As a test, I introduced a typo into one of the URLs defined in
docs/confg.py
:The typo is detected and the checker exits with non-zero status after displaying this error:
I also updated a couple
Makefile
s to make generation of CLI example output less noisy, reducing the volume of output frommake docs
. I haven't found that additional output useful in the past.Finally, and unfortunately, note that this only partially helps with the core issue reported in #614 -- that links to YouTube videos were not being checked. They will be checked now, but not every incorrect URL is considered an error by YouTube. For example:
Here, although no video named
foo
is available, youtube.com returns an HTTP 200 success code. Open that link in your browser and you'll see that it returns content.On the other hand, a typo in an earlier part of a YouTube URL does result in an error:
This is down to YouTube's API design: They have decided not to send an HTTP error response even if a requested video does not exist.
Nevertheless, I think the changes in the PR are helpful and worth moving forward with.
Type
Impact
Checklist