TOC – Template
| Lou Montana (talk | contribs) m (Fix description) | Lou Montana (talk | contribs)  m (Text replacement - "<tt>([^ =]+)<\/tt>" to "{{hl|$1}}") | ||
| Line 30: | Line 30: | ||
| ** horizontal - a horizontal TOC, where full titles are kept | ** horizontal - a horizontal TOC, where full titles are kept | ||
| ** normal - the normal TOC - can be placed at the wanted position with this | ** normal - the normal TOC - can be placed at the wanted position with this | ||
| ** none - no TOC on the page (similar to  | ** none - no TOC on the page (similar to {{hl|<nowiki>__NOTOC__</nowiki>}}) | ||
| ** side - sets the TOC to the right | ** side - sets the TOC to the right | ||
| ** subtoc - creates a TOC-like box. Additional parameters: | ** subtoc - creates a TOC-like box. Additional parameters: | ||
| Line 39: | Line 39: | ||
| * 3. {{HashLink|#Title 3}} | * 3. {{HashLink|#Title 3}} | ||
| </syntaxhighlight> | </syntaxhighlight> | ||
| * size: (Optional, default 1) size in em (e.g  | * size: (Optional, default 1) size in em (e.g {{hl|.9}} for 90%) | ||
| * limit: (Optional, default empty) sub-level limit (e.g  | * limit: (Optional, default empty) sub-level limit (e.g {{hl|2}}) | ||
| * nonum: (Optional, default empty)  | * nonum: (Optional, default empty) {{hl|y}} to hide numbers | ||
| {| style="width: 100%" | {| style="width: 100%" | ||
Revision as of 10:34, 16 November 2021
Usage
{{TOC|mode|size|limit|nonum|title=|content=}}
- mode: (Optional, default: "normal"; case-insensitive) one of:
- abc - a horizontal A..Z TOC (more of an index)
- horizontal - a horizontal TOC, where full titles are kept
- normal - the normal TOC - can be placed at the wanted position with this
- none - no TOC on the page (similar to __NOTOC__)
- side - sets the TOC to the right
- subtoc - creates a TOC-like box. Additional parameters:
- title: (Optional, default empty) subTOC title
- content: subTOC content, usually a list of HashLink internal links in format:* 1. {{HashLink|#Title 1}} * 2. {{HashLink|#Title 2}} * 3. {{HashLink|#Title 3}}
 
 
- size: (Optional, default 1) size in em (e.g .9 for 90%)
- limit: (Optional, default empty) sub-level limit (e.g 2)
- nonum: (Optional, default empty) y to hide numbers
| Code | Result | 
|---|---|
| {{TOC|abc}} | |
| {{TOC|subtoc
|content=
* 1. {{HashLink|#Title 1}}
* 2. {{HashLink|#Title 2}}
* 3. {{HashLink|#Title 3}}
}} | |
| {{TOC|subtoc
|title= The sub-TOC title
|content=
* 1. {{HashLink|#Title 1}}
* 2. {{HashLink|#Title 2}}
* 3. {{HashLink|#Title 3}}
}} | 
