Skip to content

SectionMap

Handsdown API Index / Handsdown / Processors / SectionMap

Auto-generated documentation for handsdown.processors.section_map module.

SectionMap

Show source in section_map.py:11

Dict-based storage for parsed Section list.

Used for BaseDocstringProcessor.

Key is a Section title. Value is a related Section instance.

Signature

class SectionMap:
    def __init__(self) -> None:
        ...

SectionMap().iter

Show source in section_map.py:95

Iterate over existing Section objects.

Yields

Section objects in order of appearance.

Signature

def __iter__(self) -> Iterator[Section]:
    ...

See also

SectionMap().add_block

Show source in section_map.py:65

Add new SectionBlock to section section_name.

If Section does not exist - it is not created.

Arguments

  • section_name - Target section title

Signature

def add_block(self, section_name: str) -> None:
    ...

SectionMap().add_line

Show source in section_map.py:42

Add new line to the last SectionBlock of section section_name.

If line and section are empty - section is not created.

Arguments

  • section_name - Target section title
  • line - Line to add

Signature

def add_line(self, section_name: str, line: str) -> None:
    ...

SectionMap().add_line_indent

Show source in section_map.py:26

Add line respecting indent of the current section block.

Arguments

  • section_name - Target section title
  • line - Line to add

Signature

def add_line_indent(self, section_name: str, line: str) -> None:
    ...

SectionMap().trim_block

Show source in section_map.py:79

Delete last empty lines from the last SectionBlock.

If Section does not exist - it is not created.

Arguments

  • section_name - Target section title.

Signature

def trim_block(self, section_name: str) -> None:
    ...