=Toc is a block that inserts a table of contents (TOC). Usually a table of contents is an index of headers in a document.
=Toc block inserts header with all levels. For example for document which contains
=head3 TOC may be:
About Intro Start Continue Content Story 1 First step Second step Story 2 First step Second step Links
The number of levels (i.e., depth) of the TOC is configurable. For example, to place a table of contents listing only top- and second-level headings:
=Toc head1, head2
Its produce TOC like this:
About Intro Content Story 1 Story 2 Links
To add title for TOC use
=for Toc :title<"Table of content"> head1, head2
Table of content About Intro Content Story 1 Story 2 Links
=Toc block support comma separated list of block names to build TOC for. It is possible to mix various block.
=Toc head1, table, item1
For example, to place a index of images, diagrams (assuming a user-defined
=for Toc :title<"Table of visuals"> Image, Diagram =for Image :caption<Logo image> 256x256.png =for Diagram :caption<Flow diagram> ...
Will render to:
Table of visuals Logo image Flow diagram
Here are is few notes about how TOC is builds:
for blocks such as
=Diagram( or any user-defined) to make TOC, content of
:titleattribute is used. If no suitable content is found to be shown in the TOC, "do not have :caption" is used instead.
only headings switch indent level for TOC. Other blocks uses level relative to current heading level.
each SEMANTIC block is equivalent to
A document may have as many
=Tocblocks as necessary.