lib.roles.transforms.toc

Django docutils table of contents helpers.

class django_docutils.lib.transforms.toc.Contents(document, startnode=None)[source]

Bases: Contents

Helpers for rendering docutils table of contents from document tree.

Changes: - Remove unused autonum - PEP8 - Removed extra nodes.paragraph wrapping of list_item’s.

startnode: Optional[Node]

Node from which to begin the transform. For many transforms which apply to the document as a whole, startnode is not set (i.e. its value is None).

build_contents(node, level=0)[source]

Build nested bullet list from doctree content.

Return type:

Union[bullet_list, List[Any]]