{toc-zone}
Plugin: Table of Contents Plugin
Generates a table of contents based on what headings are present within its body.
Description
The difference between this macro and toc is that the toc macro will list all headings on the page, while this macro will only list those within its body.
Each heading level is indented progressively.
Usage
Parameters
| Name |
Required |
Default |
Description |
| location | | both | This parameter allows you to specify where the table of contents should be displayed, either the 'top' or 'bottom' of the content contained within the macro. If you do not specify anything with this parameter then the contents will be displayed at both the top and bottom of the content. |
| 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 | | | An optional extra CSS class to apply to the table of contents. This will be applied to a <div> wrapped around the TOC. |
Examples
This example will only list headings which occur in inside the macro body - that is, 'Level 1.1' through 'Level 1.2.1'. You can specify if the TOC should appear at the top, bottom or in both locations. Otherwise, it has the same options as the regular {toc} macro.
See Also