Skip to end of metadata
Go to start of metadata

{toc}

Plugin Version: from version

Generate a table of contents based on what headings are present in the current page.

Description

The difference between this and toc-zone is that the this macro will list all headings on the page, while toc-zone will only list those within its body.

Each heading level is indented progressively.

Usage

Wiki Markup

{toc:type=[list, flat]|outline=[true, false]|style=[style option]|indent=[css quantity]}

Parameters

Name

Required

Default

Description

type

'list'

The type of TOC to output. May be *'list'* or *'flat'*.

outline

false

If {{true}} each item will be prefixed by a hierarcical number (e.g. '1.3').

style

'none'

The style of bullet-point to use for each item. Any CSS styles are valid.

separator

'brackets'

The type of separator when in 'flat' mode. May be any of the following: * {{'brackets'}} - Each item is surrounded by square brackets ('\[', '\]'). * {{'braces'}} - Each item is surrounded by curly braces ('\{', '\}'). * {{'parens'}} - Each item is surrounded by parentheses ('(', ')'). * {{'pipe'}} - Each item is separated by a pipe ('\|'). * {{_anything_}} - Each item is separated by the value supplied. Nothing is placed on the outsides of the list.

indent

When displayed as a 'list', the amount to indent each heading level. *Note:* This is a CSS quantity, so make sure you use the quantity type (eg. '10px' not '10').

minLevel

1

The minimum level to report headings for, inclusive. Eg. '2' will list 'h2.' and 'h3.' headings, but not 'h1.'.

maxLevel

7

The maximum level to report headings for, inclusive. Eg. '2' will list 'h1.' and 'h2.' headings, but not 'h3.' or above.

include

If set, any headings not matching the regular expression will be ignored. Due to '\|' being the parameter separator in macros, use a comma (',') where you would have usually used '\|'. If you need to match a comma, use its escape code - {{\\x2C}}.

exclude

If set, any headings which _do_ match the regular expression will be ignored. Due to '\|' being the parameter separator in macros, use a comma (',') where you would have usually used '\|'. If you need to match a comma, use its escape code - {{\\x2C}}.

name

Parameter description goes here.

printable

true

If set to {{false}}, the TOC will not be visible when printing.

class

Macro Rendering Error

See Also

Labels