Skip to main content

Module std_domain

Module std_domain 

Source
Expand description

The std domain: cross-reference labels, glossary terms, program options and generic objects — Sphinx’s StandardDomain (domains/std/__init__.py).

This module owns the collection half (Sphinx’s process_doc, note_object, _note_term, add_program_option); the resolution half lives in crate::env::resolve.

See docs/superpowers/plans/2026-08-31-m2-wave4-research-spec-sphinx-env-toctree-domains.md §4 for the attribute-by-attribute mapping this port is drawn from.

Structs§

DocumentSource
One document’s parse output, as process_doc consumes it.
StdDomainData
Standard-domain (std) registries: cross-reference labels, generic objects (:option:, :envvar:, …), program options, and glossary terms. Field shapes mirror Sphinx’s StandardDomain.data exactly (domains/std/__init__.py:768-781).

Functions§

process_doc
StandardDomain.process_doc (domains/std/__init__.py:937-993) plus the registrations Sphinx performs from directives at parse time, which our parse layer has no domain callbacks to run: glossary terms (make_glossary_term) are replayed from the finished doctree, and the option/envvar/confval registrations (ObjectDescription.add_target_and_index) from the records the parse layer kept — see RegistryExport::program_options for why the doctree cannot carry those. The py domain’s registrations ([crate::env::py_domain::collect_registrations]) replay in the same parse-time pass, because that is where they fire in Sphinx — their duplicate warnings interleave with std’s in document order.