PluginMakeTOC
maketoc stands for "Make a Table of Contents". It is used to generate a table of contents from the headings (made with !, !!, !!!, etc.) or (!#, !!#..) on the page that it appears on. It is useful for placing links to major sub-sections of a large document.
The tool toc is something similar. It is used for structures of many pages. toc will show a table of contents built from the titles of the pages within that structure of wiki pages.
Creating a Table of Contents List
Use the {maketoc} plugin to automatically create a table of contents, based on the headings on the current wiki page.
For example, using {maketoc title="On This Page" showhide=y} on this page will produce:
On this page
You can use the following options to customize the table of contents list (Default means that the option is not specified as part of {maketoc} ):
| Option | Description | Valid Values |
|---|---|---|
| type | For backwards compatibility from older syntax: {maketoc:box} . Optional. | box |
| maxdepth | Defines how many heading levels to include in the list. If 0, then all headings will be included. Default = 0 | Numeric |
| title | Title (heading) of the table of contents. Use title="" to have no title. Default = "Table of contents" Note: The title will be translated, if available. Introduced in 1.9.10 |
Alphanumeric, enclosed in quotes. |
| showhide | Create a link that will collapse (that is, hide) the table of contents link. Default = n | y or n |
| nolinks | Create the table of contents without links. Default = n (links will be created). | y or n |
| nums | Specify if the items in the table of contents listing should be numbered. Default = n (use bullets instead of numbers). The style of the numbering can be customized to use "i, ii, iii" or others through css (see below) | y, y, Force (same as y) |
The syntax of {maketoc} is:
{maketoc option1=value1 option2=value2} Note the space between each option/value pair.
Remarks:
Example: {maketoc:box} produces a table of contents without respect to the hierarchical order.
Example: {maketoc title="Also On This Page" showhide=y} produces a table of contents with a title of "Also on this Page"
maketoc does not like it when it is used more than once on a page.
Customizing the style of the numbering
You can override the style of the automatic numbering of the headings with CSS (cascading style sheets). Something like
.wikitext ol {list-style-type: lower-roman;}
This can be added to the end of the stylesheet you're using, or put in a custom.css stylesheet in the directory or your theme.
More information
Contributors to this page: sylvie
,
xavi
,
Scot Wilcoxon
,
Marc Laporte
,
lindon
and
gluckfs@yahoo.com
.
Page last modified on Wednesday 12 May, 2010 19:34:02 UTC by sylvie
.
