This macro is bundled with all the XWiki products by default.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.

Toc Macro

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

NameOptionalAllowed valuesDefault valueDescription
inityes1 - 62an initial level where the TOC generation should start at (the default is level 2 because level 1 is considered as a document title)
maxyes1 - 66maximum level the TOC is generated for
numberedyestrue/falsefalseif 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. This annoyance should be eliminated as soon as there is the new XWiki Syntax Mapping feature implemented.

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

Result

toc-numbered.jpg

Version 6.1 last modified by VincentMassol on 19/06/2008 at 22:13

Comments 0

No comments for this document

Attachments 1

Image
toc-numbered.jpg 1.2
PostedBy: vmassol on 09/12/2007 (23kb )

Creator: vmassol on 2006/12/12 08:42
This wiki is licensed under a Creative Commons license
1.4.1.10194