Template:TOC: Difference between revisions

From Workers & Resources: Soviet Republic Official Wiki
(add toc limit styles)
 
m (1 revision imported)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#if:{{{limit|}}}|<templatestyles src="TOC/limit-styles.css"/>}}<div style="{{#if:{{{clear|}}}{{{align|}}}| clear: {{{clear|both}}}; }} margin-bottom: .5em; float: {{{align|none}}}; {{#ifeq: {{lc:{{{align|}}}}} | right | margin-left:2em; | {{#ifeq: {{lc:{{{align|}}}}} | left | margin-right:2em; | <!-- align=none --> }} }} width: {{{width|auto}}};" {{#if:{{{limit|}}}|class="toclimit-{{{limit}}}"}}>__TOC__</div><noinclude>
<onlyinclude><includeonly><!--
{{doc}}
 
[[Category:Utility templates|{{PAGENAME}}]]
--><div class="va-toc-template{{#if:{{{limit|}}}|&#032;va-toclimit-{{{limit}}}}}" style="background: transparent; max-width: 320px;<!--
</noinclude>
-->{{#switch:{{lc:{{#if:{{{float|}}}|{{{float}}}|{{{1|}}}}}}}<!--
  -->|right=float: right; clear: right; padding: 0 0 5px 10px;<!--
  -->|left=float: left; clear: left; padding: 0 10px 5px 0;<!--
-->}}<!--
-->">__TOC__</div><!--
 
--></includeonly></onlyinclude>
{{Documentation}}
{{Copyright Nukapedia|Template:TOC}}
[[Category:Navigation templates]]

Latest revision as of 19:25, 14 June 2024

Template documentation (for the template shown above, sometimes hidden or invisible)

Template for manipulating the table of contents (TOC) of an article: a maximum level for shown headlines can be specified, and the TOC can be aligned to the left/right of an article (with text flowing around it).

Usage

Simply place the following where you want the TOC to appear:

{{TOC}}

Parameters

Neutral
<unnamed 1> or float
Specifies alignment of the TOC; sets CSS "float" (and "clear") attribute for the box.

Available options:

  • left: TOC will be aligned to the left, and text will flow around it on the right.
  • right: TOC will be aligned to the right, and text will flow around it on the left.
Neutral
limit
If specified, subheadings with a level lower than limit will not be shown in the TOC. For example, with limit set to 3, only headings up to level 3 (===) will be displayed. Usually used for articles with a lot of subheadings in order to downsize the TOC.

Technical

Documentation transcluded from Template:TOC/doc.