class documentation

class Contents(Transform):

View In Hierarchy

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).
def apply(self):
Override to apply the transform to the document tree.
def build_contents(self, node, level=0):

Undocumented

def copy_and_filter(self, node):
Return a copy of a title, with references, images, etc. removed.
default_priority: int =
Numerical priority of this transform, 0 through 999 (override).
backlinks =

Undocumented

toc_id =

Undocumented