Skip to main content

find_section_by_path

Function find_section_by_path 

Source
pub fn find_section_by_path(doc: &Document, path: &str) -> Option<BlockId>
Expand description

Find a section by path (e.g., “Section 1 > Subsection 2”).

The path uses “ > “ as a separator between heading names.

§Arguments

  • doc - The document to search
  • path - The path to the section (e.g., “Introduction > Getting Started”)

§Returns

  • Some(BlockId) - The block ID of the found section
  • None - If the path doesn’t match any section