-
Notifications
You must be signed in to change notification settings - Fork 340
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
Fix hyperlinks and define redirects & anchors to avoid checking #1267
Conversation
Before this, the change log linked to the issue being addressed rather than the pull request.
@@ -91,7 +91,7 @@ Features | |||
- For `plasmapy.plasma.grids` functionality, improve interpolation performance on | |||
non-uniform grids. (`#963 <https://github.com/plasmapy/plasmapy/pull/963>`__) | |||
- Added the `~plasmapy.formulary.drifts.diamagnetic_drift` function to | |||
`~plasmapy.formulary.drifts`. (`#966 <https://github.com/plasmapy/plasmapy/pull/966>`__) | |||
`~plasmapy.formulary.drifts`. (`#972 <https://github.com/plasmapy/plasmapy/pull/972>`__) |
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.
Codecov Report
@@ Coverage Diff @@
## main #1267 +/- ##
=======================================
Coverage ? 97.06%
=======================================
Files ? 73
Lines ? 7093
Branches ? 0
=======================================
Hits ? 6885
Misses ? 208
Partials ? 0 Continue to review full report at Codecov.
|
docs/conf.py
Outdated
linkcheck_allowed_redirects = { | ||
r"https://.+\.(org|io|com)": r".+(org|io|com)/en/.+", # to different doc branches | ||
r"https://doi\.org/.+": r"https://.+", # DOI links are more persistent | ||
r"https://.+": r".+(google|github).+[lL]ogin.+", # some links require logins | ||
} |
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.
Since I didn't know this beforehand, .+
is effectively a wildcard marker, (...|...)
is either/or, and [ ]
means matching any one of these characters.
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.
PDD label much? :D
One quick question, otherwise LGTM!
docs/conf.py
Outdated
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
todo_include_todos = False | ||
|
||
default_role = "obj" | ||
|
||
# Customizations for make linkcheck using regular expressions | ||
linkcheck_allowed_redirects = { | ||
r"https://.+\.(org|io|com)": r".+(org|io|com)/en/.+", # to different doc branches |
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.
Wouldn't this allow redirects to any website on the top level .org
, .io
or .com
domains, rather than just different doc branches?
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.
Yeah, I had been wondering how to handle this. I couldn't find a way in the linkcheck configuration options to specify that the domain name be the same between the link and the redirect without giving every domain name. My thinking has been that with the /en/
in the second part, chances are the redirect is going to be for a docs page or otherwise somehow related to internationalization. I'll make this a bit more specific...we'll catch more things links that need to be updated, with the caveat that we'll need to add some special cases in there.
Me? No, never! 😶 |
…maPy#1267) * Fix broken links in braginskii.py * Update redirects & anchors to ignore in make linkcheck * Update hyperlinks in testing_guide.rst * Update hyperlinks in vision_statement.rst * Update hyperlinks in mathematics.py * Update hyperlinks in install.rst * Update hyperlinks in install_dev.rst * Update hyperlinks in particles/index.rst * Update hyperlinks in docs.rst * Update hyperlinks in CONTRIBUTING.rst * Update hyperlinks in collisions.py * Update hyperlinks in code of conduct * Update hyperlinks in code guide * Add chat room to common links * Fix pull request number Before this, the change log linked to the issue being addressed rather than the pull request. * Add changelog entries * Use past tense * Minor updates to links * Minor updates to common links * Be more specific about allowed redirects * Minor updates to links * Point out make linkcheck in doc guide
…maPy#1267) * Fix broken links in braginskii.py * Update redirects & anchors to ignore in make linkcheck * Update hyperlinks in testing_guide.rst * Update hyperlinks in vision_statement.rst * Update hyperlinks in mathematics.py * Update hyperlinks in install.rst * Update hyperlinks in install_dev.rst * Update hyperlinks in particles/index.rst * Update hyperlinks in docs.rst * Update hyperlinks in CONTRIBUTING.rst * Update hyperlinks in collisions.py * Update hyperlinks in code of conduct * Update hyperlinks in code guide * Add chat room to common links * Fix pull request number Before this, the change log linked to the issue being addressed rather than the pull request. * Add changelog entries * Use past tense * Minor updates to links * Minor updates to common links * Be more specific about allowed redirects * Minor updates to links * Point out make linkcheck in doc guide
To get ready for a time when we can have
make linkcheck
be part of our test suite (#1266), this PR fixes hyperlinks, defines allowable redirects (like fordoi.org
, tolatest
orstable
or `v3.9.3 versions of docs, and login pages for GitHub and Google), and specifies anchors to avoid checking (like for specific lines in a page showing source code or for our Matrix room).This should be a fairly quick review, so if it looks good to you, feel free to merge it so it can go in 0.7.0.