Template:TOC: Difference between revisions
From Space Station 14 Wiki
(Created page with "<includeonly>{{#vardefine: toc_depth_css_class | {{#switch: {{{depth|6}}} | 2 = toclimit-2 | 3 = toclimit-3 | 4 = toclimit-4 | 5 = toclimit-5 }}}}<!-- -->{{#vardefine: toc_float_css|<!-- -->{{#ifeq: {{#vardefineecho: toc_float|{{lc:{{{float|none}}}}}<!--/vardefine-->}}<!-- -->|none<!-- -->|<!-- -->|float: {{#var:toc_float}};<!-- -->}}<!-- -->}}<!-- --><div class="{{#var:toc_depth_css_class}}" style=" {{#var: toc_float_css}} ">__T...") |
(wip) |
||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine: toc_depth_css_class | {{#switch: {{{depth|6}}} | <includeonly><!-- | ||
--><templatestyles src="Template:TOC/styles.css" /><!-- | |||
-->{{#vardefine: toc_depth_css_class | {{#switch: {{{depth|6}}} | |||
| 2 = toclimit-2 | | 2 = toclimit-2 | ||
| 3 = toclimit-3 | | 3 = toclimit-3 | ||
Line 20: | Line 23: | ||
{{documentation|bb= | {{documentation|bb= | ||
{{has alias template|toc}} | {{has alias template|toc}} | ||
{{uses template styles}} | |||
}} | }} | ||
Revision as of 07:38, 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 |