lib.roles.transforms.toc

Django docutils table of contents helpers.

class django_docutils.lib.transforms.toc.Contents[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.

Initial setup for in-place document transforms.

startnode: Node | None

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:

bullet_list | list[Any]

Parameters:
  • node (Node)

  • level (int)