Skip to main content

assign_figure_numbers

Function assign_figure_numbers 

Source
pub fn assign_figure_numbers<'d>(
    env: &mut BuildEnvironment,
    numfig: bool,
    numfig_secnum_depth: u32,
    load_doctree: &DoctreeLoader<'d>,
) -> Vec<String>
Expand description

Assign a figure number to every enumerable node reachable from the root document.

Exact port of assign_figure_numbers (collectors/toctree.py:285-378). Note the ordering Sphinx relies on: env.toc_fignumbers is cleared unconditionally, but only refilled when numfig is on — so turning numfig off drops every figure number (and, quirk included, reports nothing as changed).

Must run after assign_section_numbers: figure numbers are scoped by the section numbers that pass assigns.