Template:TOC limit/doc: Difference between revisions

no edit summary
m (Text replacement - "== ([^=\[{])" to "== $1")
No edit summary
 
Line 2: Line 2:


=== Usage ===
=== Usage ===
<tt><nowiki>{{TOC limit}}</nowiki></tt>
{{tlx|TOC limit}}


The template defaults to including only the first- and second-level headings, i.e. those numbered "1" and "1.1" in the TOC.
The template defaults to including only the first- and second-level headings, i.e. those numbered "1" and "1.1" in the TOC.


You can specify a different limit by adding a header level:
You can specify a different limit by adding a header level:
 
{{tlx|TOC limit|4}}
<tt><nowiki>{{TOC limit|4}}</nowiki></tt>


4 allows for third-level headings, i.e. "1.1.1", but omits any subheadings below that from the TOC.
4 allows for third-level headings, i.e. "1.1.1", but omits any subheadings below that from the TOC.
Line 40: Line 39:
</ul>
</ul>
|}
|}
Using <tt><nowiki>{{TOC limit}}</nowiki></tt> on this page ''would not'' hide header D, because even though it is a level-6 heading it is shown at the second level in the TOC. And it ''would'' hide header G even though it is a level-3 heading just like header B, because header G is shown at the third level in the TOC while header B is shown at the second level.
Using {{tlx|TOC limit}} on this page ''would not'' hide header D, because even though it is a level-6 heading it is shown at the second level in the TOC. And it ''would'' hide header G even though it is a level-3 heading just like header B, because header G is shown at the third level in the TOC while header B is shown at the second level.