Table of Contents

AsciiDoc table of contents are converted to the table of contents macro of Confluence. The table of contents displays the tree of sections for a specific page.

Table of contents can either be displayed at the very top of a page (default mode), or at a custom-defined location within the page (macro mode):

Table of Contents (Default)

Displaying the table of contents at the top of a page can be done by specifying the toc AsciiDoc attribute:

= Page Title
:toc:

== Some Section

The toc attribute must follow the title without any additional empty line.

Table of Contents (Macro)

Displaying the table of contents in any location other than the top of the page requires the toc AsciiDoc attribute to be set to macro. Once done, the table of content can be displayed in the requested location using the toc::[] macro:

= Page Title
:toc: macro

== Some Section

toc::[]

The toc::[] macro must be surrounded by empty lines for the table of contents to be displayed.

Title for Table of Contents

Specifying a title for the table of contents using the toc-title attribute is currently not supported. Instead, when using the macro mode, a custom title can be emulated using arbitrary AsciiDoc markup.

Custom table of contents title using some bold text:

= Page Title
:toc: macro

*My Table of Contents*

toc::[]

== Some Section

Custom table of contents title using a collapsible block title:

= Page Title
:toc: macro

.My Table of Contents
====
toc::[]
====

== Some Section

Levels

By default, sections of level 1 and 2 are contained in the table of contents. The number of levels displayed can be customized using the toclevels attribute (for both default and macro mode):

= Page Title
:toc:
:toclevels: 4

== Some Section