Template:TOC: Difference between revisions

From Handhelds Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
<onlyinclude>
<onlyinclude>
<div class="custom-toc" style="margin: 1em 0;">
<templatestyles src="Template:TOC/styles.css" />
<div class="custom-toc limit-{{{limit|3}}}">
   __TOC__
   __TOC__
</div>
</div>
</onlyinclude>


<templatestyles src="Template:TOC/styles.css" />
{{#if: {{{limit|}}} |
  {{#ifeq: {{{limit}}} | 2 |
    .custom-toc .toclevel-3, .custom-toc .toclevel-4, .custom-toc .toclevel-5, .custom-toc .toclevel-6 { display: none; }
  }}
  {{#ifeq: {{{limit}}} | 3 |
    .custom-toc .toclevel-4, .custom-toc .toclevel-5, .custom-toc .toclevel-6 { display: none; }
  }}
  {{#ifeq: {{{limit}}} | 4 |
    .custom-toc .toclevel-5, .custom-toc .toclevel-6 { display: none; }
  }}
}}
</onlyinclude>
<noinclude>
<noinclude>
This template creates a dynamic Table of Contents with a limit for the depth of the TOC.
This template generates a dynamic Table of Contents with a limit for the depth of the TOC.
Usage: `{{TOC|limit=3}}`
Usage: `{{TOC|limit=3}}`
Supported limits: 2, 3, 4
Supported limits: 2, 3, 4
</noinclude>
</noinclude>

Revision as of 18:06, 10 May 2025


This template generates a dynamic Table of Contents with a limit for the depth of the TOC. Usage: `

` Supported limits: 2, 3, 4