Template:TOC: Difference between revisions
From Space Station 14 Wiki
(wip) |
(cats) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
--><templatestyles src="Template:TOC/styles.css" /><!-- | --><templatestyles src="Template:TOC/styles.css" /><!-- | ||
-->{{#vardefine: toc_depth_css_class | {{#switch: {{{depth|6}}} | -->{{#vardefine: toc_depth_css_class| {{#switch: {{{depth|6}}} | ||
| 2 = toclimit-2 | | 2 = toclimit-2 | ||
| 3 = toclimit-3 | | 3 = toclimit-3 | ||
Line 9: | Line 9: | ||
}}}}<!-- | }}}}<!-- | ||
-->{{#ifeq: {{#vardefineecho: toc_float|{{lc:{{{float|none}}}}}<!--/vardefine-->}}|none<!-- | |||
-->|<!-- | |||
-->|{{#vardefine: toc_depth_css_class|float-{{#var:toc_float}}<!--/vardef-->}}<!-- | |||
-->}}<!-- | -->}}<!-- | ||
--><div class="custom-toc {{#var:toc_depth_css_class}}" style=" | --><div class="custom-toc {{#var:toc_depth_css_class}}" style=" | ||
{{#var: toc_float_css}} | {{#var: toc_float_css}} | ||
Line 26: | Line 23: | ||
}} | }} | ||
[[Category:TOC templates]] | |||
[[Category:Template starter-kit]] | |||
<templatedata> | <templatedata> | ||
{ | { | ||
Line 64: | Line 63: | ||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> |
Latest revision as of 10:56, 24 August 2024
Has an alias
This template has an alternative name:
Uses template styles
This template uses template styles found in:
Since TOC relies on a page contents and can only be used once, the examples isolated into separate pages:
Page | Description |
---|---|
Template:TOC/examples/basic | Basic usage with no params. |
Template:TOC/examples/depth param | "depth" param example. |
Template:TOC/examples/float param | "float" param example. |
TOC with extra shenanigans, such as hiding deep headers or floating the TOC right or left. Note that this template forces the TOC onto the page, regardless of the number of headers on the page. This template uses the regular TOC, so all its quirks and limitation apply too (e.g. displaying only the latest TOC).
Parameter | Description | Type | Status | |
---|---|---|---|---|
Depth | depth | The depth of headers shown in the TOC. Default is «6» (all headers).
| Line | suggested |
Float | float | Floating of the TOC. Any casing (including lowercase) is supported.
| String | suggested |