Automatic Table of Contents
A table of contents (TOC) is an index of section titles in an AsciiDoc document. When the TOC is enabled, the AsciiDoc processor automatically generates the TOC from the document’s structure and inserts it into the output document. The number of levels (i.e., depth) of the TOC is configurable.
To enable the autogenerated TOC, set the
toc document attribute.
toc attribute is activated with an attribute entry in the document header.
= The Intrepid Chronicles
Kismet Lee; B. Steppenwolf; Pax Draeke
== Certain Peril
Daylight trickles across the cobblestones...
=== A Recipe for Potion
We have to harvest the leaves by the light of the teal moons...
==== Searching for Ginseng
Crawling through the twisted understory...
== Dawn on the Plateau
toc attribute in the header using an attribute entry.
When the value of
toc is empty, the processor will use the attribute’s default value.
By default, the TOC is rendered directly below the document header, is titled Table of Contents, and contains section 1 and section 2 level titles only. The result of Example 1 is displayed below.