Expand description
docutils-exact id/name normalization and the document id registry.
Algorithms ported from docutils 0.22.4 nodes.py (make_id,
fully_normalize_name, whitespace_normalize_name, document.set_id,
set_name_id_map/set_duplicate_name_id), with the Sphinx settings
id_prefix='', auto_id_prefix='id' baked in (sphinx/environment
overrides docutils’ '%' default — auto ids are id1, id2, …).
Structs§
- Dupname
Fixup - A deferred “first node loses its name too” fixup: on a duplicate name,
docutils dupnames BOTH nodes, but the first one is already deep in the
tree — the parser applies these after parsing via
apply_dupname_fixups. - IdRegistry
Functions§
- apply_
dupname_ fixups - Post-parse pass: move
namefromnamestodupnameson the node carryingnode_id(the FIRST occurrence keeps its id, loses its name). - fully_
normalize_ name - docutils
fully_normalize_name: lowercase + collapse whitespace. - make_id
- docutils
nodes.make_id. Result grammar:[a-z](-?[a-z0-9]+)*or empty. - whitespace_
normalize_ name - docutils
whitespace_normalize_name: collapse whitespace, keep case.