-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Proposal: check if hardcoded URLs can be replaced with extlinks #9800
Conversation
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 with nits.
sphinx/ext/extlinks.py
Outdated
We treat each ``reference`` node without ``internal`` attribute as an external link. | ||
""" | ||
|
||
default_priority = 900 |
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.
Is there any reason for this priority? It's invoked on a very late step.
https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_transform
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.
IMO, there is no special reason to invoke this feature earlier or later. So it would be better to put it on the normal priority: 500. I'll modify it after merging.
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: Oleg Hoefling <oleg.hoefling@gmail.com>
2a03252
to
7b318d8
Compare
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Thank you for update. Merging now. |
Fix flake8 and isort errors (refs: #9800)
extlinks: Adjust priority (refs: #9800)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Subject: This PR adds checks for hardcoded URLs whether they can be replaced with an extlink. This is a feature similar to #9626, but for
extlinks
instead ofintersphinx
.Feature or Bugfix
Purpose
If a hardcoded link can be replaced with a crossref,
sphinx
will emit a warning like this:Example output from running over Sphinx repository
Relates