tableofcontents

.tableofcontents title:{InlineMarkdownContent? = null}
maxdepth:{Int = 3}
breakpage:{Boolean = true}
headingdepth:{Int? = null}
numberheading:{Boolean = false}
indexheading:{Boolean = false}
focus:{InlineMarkdownContent? = null}
-> Node

Generates a table of contents, based on the headings in the document, organized in a hierarchical structure defined by each heading's depth.

Return

an AstRoot containing an optional heading and a TableOfContentsView

Parameters

title

title of the table of contents. If unset, the default localized title is used. If blank, no title is displayed.

maxdepth

maximum depth of the table of contents. Only headings with a depth (number of leading #s) equal to or less than this value are included.

breakpage

whether the heading preceding the table of contents triggers an automatic page break. Enabled by default.

headingdepth

depth of the heading preceding the table of contents. If unset, the depth is determined by the document type.

numberheading

whether the heading preceding the table of contents should be numbered and have its position tracked in the document hierarchy. Implicitly enabled when indexheading is enabled.

indexheading

whether the heading preceding the table of contents should itself be indexed in the document's table of contents.

focus

if set, adds focus to the item of the table of contents with the same text content as this argument. Inline style (strong, emphasis, etc.) is ignored when comparing the text content. When at least one item is focused, non-focused items are visually de-emphasized.

Wiki page

Table of contents