Proposal: check if hardcoded URLs can be replaced with extlinks#9800
Merged
tk0miya merged 4 commits intosphinx-doc:4.xfrom Nov 29, 2021
Merged
Proposal: check if hardcoded URLs can be replaced with extlinks#9800tk0miya merged 4 commits intosphinx-doc:4.xfrom
tk0miya merged 4 commits intosphinx-doc:4.xfrom
Conversation
tk0miya
requested changes
Nov 11, 2021
sphinx/ext/extlinks.py
Outdated
| We treat each ``reference`` node without ``internal`` attribute as an external link. | ||
| """ | ||
|
|
||
| default_priority = 900 |
Member
There was a problem hiding this comment.
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
Member
There was a problem hiding this comment.
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
Contributor
Author
hoefling
added a commit
to hoefling/sphinx
that referenced
this pull request
Nov 12, 2021
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
hoefling
added a commit
to hoefling/sphinx
that referenced
this pull request
Nov 12, 2021
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
tk0miya
approved these changes
Nov 29, 2021
Member
|
Thank you for update. Merging now. |
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this pull request
Nov 29, 2021
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this pull request
Nov 29, 2021
tk0miya
added a commit
that referenced
this pull request
Nov 29, 2021
Fix flake8 and isort errors (refs: #9800)
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this pull request
Nov 29, 2021
tk0miya
added a commit
that referenced
this pull request
Nov 29, 2021
extlinks: Adjust priority (refs: #9800)
hoefling
added a commit
to hoefling/sphinx
that referenced
this pull request
Dec 9, 2021
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
hoefling
added a commit
to hoefling/sphinx
that referenced
this pull request
Dec 11, 2021
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
hoefling
added a commit
to hoefling/sphinx
that referenced
this pull request
Dec 20, 2021
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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
extlinksinstead ofintersphinx.Feature or Bugfix
Purpose
If a hardcoded link can be replaced with a crossref,
sphinxwill emit a warning like this:Example output from running over Sphinx repository
Relates