TOC Macro (Radeox)
Last modified by Vincent Massol on 2016/06/05 22:25
Generates a Table Of Content for titles (headings) in a document.
Each title has an anchor associated to it. It also shows the TOC in PDF output with working links to the corresponding destinations of the PDF document.
Usage
#toc("init" "max" "numbered")
Parameters definition
Name | Optional | Allowed values | Default value | Description |
---|---|---|---|---|
init | yes | 1 - 6 | 2 | an initial level where the TOC generation should start at (the default is level 2 because level 1 is considered as a document title) |
max | yes | 1 - 6 | 6 | maximum level the TOC is generated for |
numbered | yes | true/false | false | if should generate numbering (1.2.3 format) for titles (see also Note 2) |
Note: you must always specify all three arguments and use an empty string ("") when the default value supposed to be used.
Note 2: to have the numbering rendered as a leading part of heading text (see the following picture), the author of the page must have programming rights. Such rights are required due to the XWiki security restrictions when working with XWiki Context (the TOC implementation sets some data to the Context).
Example
#toc("" "" "")
1 Level 1
1.1 Level 2
1 Level 1
1.1 Level 2