pub enum TocMode {
Disabled,
Auto,
Left,
Right,
Top,
Bottom,
Preamble,
Macro,
}Expand description
Where (and whether) a document’s table of contents (TOC) is generated,
resolved from the toc attribute and, when toc carries no placement
keyword, the toc-placement attribute.
The toc/toc-placement attributes are header-only, so this value is fixed
once a document’s header has been processed. A nested AsciiDoc table cell
behaves as its own standalone document and resolves its own TocMode
independently – it does not inherit the parent document’s setting.
The auto, left, right, top, and bottom placements all render the
TOC automatically near the top of the document;
left/right/top/bottom additionally request a fixed side (or
top/bottom) column when converting to standalone HTML (a presentation detail
outside this crate’s scope). preamble places the TOC immediately below the
preamble, and macro defers placement to a toc::[] block macro.
The positional placement can be selected by a keyword or a direction
shorthand in the toc value (</>/^/v for left/right/top/
bottom), by the separate toc-position attribute, or by the legacy toc2
alias, mirroring Asciidoctor’s header normalization.
Variants§
Disabled
The toc attribute is unset: no table of contents is generated.
Auto
The toc attribute is empty (the value an empty :toc: resolves to) or
set to auto. The TOC is generated automatically near the top of the
document.
Left
The toc attribute is set to left (or the legacy toc2 alias is
set): an automatically placed TOC that, in standalone HTML, is rendered
as a fixed left-hand side column.
Right
The toc attribute is set to right: an automatically placed TOC that,
in standalone HTML, is rendered as a fixed right-hand side column.
Top
The placement resolves to top (via :toc: top / :toc: ^, or a
toc-position of top): an automatically placed TOC rendered as a
fixed top column in standalone HTML.
Bottom
The placement resolves to bottom (via :toc: bottom / :toc: v, or a
toc-position of bottom): an automatically placed TOC rendered as a
fixed bottom column in standalone HTML.
Preamble
The placement resolves to preamble (via :toc: preamble or
:toc-placement: preamble): the TOC is generated immediately below the
document’s preamble.
Macro
The placement resolves to macro (via :toc: macro or
:toc-placement: macro): the table of contents is generated only where
a toc::[] block macro appears.