Expand description
Cross-reference resolution: the std half of Sphinx’s
ReferencesResolver post-transform
(transforms/post_transforms/__init__.py:60-160) plus
StandardDomain.resolve_xref (domains/std/__init__.py:1034-1293) and
the dangling-reference warnings both of them can raise
[ENV §4, §8 #4-#13].
Sphinx resolves references while writing each document, over a fresh
copy of its doctree; this port does the same at the end of the resolve
phase, once numbering has run (:numref: reads env.toc_fignumbers).
Structs§
- Document
Resolution - What resolving one document produced.
- Nitpick
Config - Nitpick configuration, as
warn_missing_referenceconsults it (post_transforms/__init__.py:255-282). - Resolved
Xref - The reference node a successful resolution builds.
- Resolver
- Everything resolution reads: the environment, the numbering configuration, the other documents’ doctrees, and the builder’s URI policy.
- Xref
Request - One
pending_xrefto resolve — the attributes Sphinx’s resolvers read off the node.
Enums§
- Inner
- The reference’s child node(s).
- Xref
Outcome - What resolution did with a reference. Sphinx expresses these three as
“returned a node” / “returned the contnode” / “returned None”: the
middle case still counts as resolved to the caller, which is why a
:numref:that gives up never also raises a dangling-reference warning.
Functions§
- resolve_
document - Resolve every
pending_xrefin one document, rewriting the tree the wayReferencesResolver.rundoes: the node is replaced by the reference that resolution built, or by its own content node when it failed.