Table of Contents Macro

The Table of Contents macro generates a table of contents based on XWiki headings. This macro can also be used with the Box macro.

Usage

{{toc start="<start>" depth="<depth>" numbered="<true|false>" scope="<local|page>" /}}

Parameters

NameOptionalAllowed valuesDescriptionDefault value
startYes1 to 6The initial level where the table of contents generation should start at. The reason why the second level is the default value is the fact that level 1 is considered as the document title.2
depthYes1 to 6The maximum level the table of contents is generated for.6
numberedYes
  • true
  • false
A flag stating whether the macro should generate numbering for titles.false
scopeYes
  • page
  • local
If the scope is local, only the sections in the current scope will be listed. For instance, in case the macro is called within a section, only its subsections will be listed.page

Examples

Numbered ToC

{{toc start="1" depth="2" numbered="true" scope="page"/}}
= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

will display

TocMacro.png

Using the scope parameter

{{toc start="1" depth="3" scope="page"/}}
= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

will display

TocMacro2.png

The ToC macro used with the Box macro

{{box cssClass="floatinginfobox" title="**Summary**"}}
{{toc/}}
{{/box}}
= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

TocMacro3.png

Using a custom CSS

The custom CSS can be included in a StyleSheetExtension object attached to the page. For the below example the CSS rules for the ".box.floatinginfobox" class are:

.box.floatinginfobox ul{
 list-style-type: lower-greek;
 color: #480000;
}

.box.floatinginfobox a:link{
 color: #480000;
}
{{toc /}}

= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

will display

TocMacro4.png

Related Pages

Search this space