<toc>

Description

Configure the automatic generation of a table of contents.

This metadata element enables the automatic generation of a table of contents from part, chapter and heading elements in the BDML document.

The table of contents can be globally enabled by adding a <toc /> element to the document's metadata, or can be configured to start and/or finish at a specified chapter/heading level.

When a <toc> element is present for a target, the automatically generated table of contents is enabled. When one or both of the start and finish attributes is present, the table of contents will be generated between the levels indicated by these attributes.

Attributes

Attribute name Description
finish Enable automatic table of contents generation and specify the level to finish at. Level 0 specifies chapters. Levels 1 to 5 specify the headings.
start Enable automatic table of contents generation and specify the level to start at. Level 0 specifies chapters. Levels 1 to 5 specify the headings.
target Apply this metadata element only to the specified targets. See BDML schema for more information on metadata elements.
variant Apply this metadata element only when the variant is specified during translation. See BDML schema for more information on metadata elements.

Immediate descendants

No element descendants are defined for the <toc> element.

Immediate ancestors

Element name Relation
<metadata> The metadata element enclosing the table of contents specification.

Examples

Globally enable table of contents generation for all levels.

<document xmlns="http://boradoc.org/1.0">
  <metadata>
    <toc />
  </metadata>
</document>

Enable table of contents generation up to heading 3 for the PDF target.

<document xmlns="http://boradoc.org/1.0">
  <metadata>
    <toc finish="3" target="pdf" />
  </metadata>
</document>

Enable table of contents generation from heading 1 to heading 4 for the HTML target.

<document xmlns="http://boradoc.org/1.0">
  <metadata>
    <toc start="1" finish="4" target="html" />
  </metadata>
</document>