Skip to main content

build_toc

Function build_toc 

Source
pub fn build_toc(doctree: &Doctree, docname: &str) -> (Node, u32)
Expand description

The document’s local table of contents (env.tocs[docname]) and its entry count (env.toc_num_entries[docname]).

Exact port of TocTreeCollector.process_doc’s nested build_toc: sections (title filtered through [filter_title_children], anchor '' for the first entry and '#' + ids[0] afterwards), only wrappers, and — inside any other element — toctree copies plus the object signatures of desc nodes, which contribute compact_paragraph[skip_section_number] > reference > literal entries.

An empty document yields an empty bullet_list and 0 entries.