-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 #6914: Emit a detailed warning when failed to resolve :ref: #8075
Fix #6914: Emit a detailed warning when failed to resolve :ref: #8075
Conversation
@@ -1106,8 +1104,27 @@ def note_labels(self, env: "BuildEnvironment", docname: str, document: nodes.doc | |||
RemovedInSphinx40Warning, stacklevel=2) | |||
|
|||
|
|||
def warn_missing_reference(app: "Sphinx", domain: Domain, node: pending_xref) -> bool: |
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.
Alternatively, it is also good to add a new method to the Domain like Domain.warn_missing_reference(node)
. I don't have a special reason to choose an event for such a purpose. Okay to move the method.
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.
I think it is not necessary > Domain.warn....
1ab0e35
to
42df70e
Compare
42df70e
to
3863ab3
Compare
3863ab3
to
4472286
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.
LGTM!
@@ -1106,8 +1104,27 @@ def note_labels(self, env: "BuildEnvironment", docname: str, document: nodes.doc | |||
RemovedInSphinx40Warning, stacklevel=2) | |||
|
|||
|
|||
def warn_missing_reference(app: "Sphinx", domain: Domain, node: pending_xref) -> bool: |
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.
I think it is not necessary > Domain.warn....
3964d50
to
cd54210
Compare
…ref: To be clear the ambiguous warning for missing-reference :ref:, this separates the warning to missing-label and missing-caption. To emit a warning dynamically, this also adds a new event: `warn-missing-reference` to customize warning messages via event handlers.
cd54210
to
0e98e9b
Compare
Feature or Bugfix
Purpose
this separates the warning to missing-label and missing-caption.
warn-missing-reference
to customize warning messages via eventhandlers.