class Contents(Transform):
This transform generates a table of contents from the entire document tree or from a single branch. It locates "section" elements and builds them into a nested bullet list, which is placed within a "topic" created by the contents directive. A title is either explicitly specified, taken from the appropriate language module, or omitted (local table of contents). The depth may be specified. Two-way references between the table of contents and section titles are generated (requires Writer support).
This transform requires a startnode, which contains generation options and provides the location for the generated table of contents (the startnode is replaced by the table of contents "topic").
Method | apply |
Override to apply the transform to the document tree. |
Method | build_contents |
Undocumented |
Method | copy_and_filter |
Return a copy of a title, with references, images, etc. removed. |
Class Variable | default_priority |
Numerical priority of this transform, 0 through 999 (override). |
Instance Variable | backlinks |
Undocumented |
Instance Variable | toc_id |
Undocumented |
Inherited from Transform
:
Method | __init__ |
Initial setup for in-place document transforms. |
Instance Variable | document |
The document tree to transform. |
Instance Variable | language |
Language module local to this document. |
Instance Variable | startnode |
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 ). |
docutils.transforms.Transform.apply