Skip to main content

Module resolve

Module resolve 

Source
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§

DocumentResolution
What resolving one document produced.
NitpickConfig
Nitpick configuration, as warn_missing_reference consults it (post_transforms/__init__.py:255-282).
ResolvedXref
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.
XrefRequest
One pending_xref to resolve — the attributes Sphinx’s resolvers read off the node.

Enums§

Inner
The reference’s child node(s).
XrefOutcome
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_xref in one document, rewriting the tree the way ReferencesResolver.run does: the node is replaced by the reference that resolution built, or by its own content node when it failed.