Difference between revisions of "Template:TOC/doc"

From EVE University Wiki
Jump to: navigation, search
m (Sample is not being shown on the Template Page)
m (Add comment on the sample only working in a specific situation.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{cleanup|Sample is not being shown on the Template Page}}
 
 
; Description
 
; Description
 
: This template changes the way the table of contents is rendered.
 
: This template changes the way the table of contents is rendered.
Line 6: Line 5:
 
:; Uses
 
:; Uses
 
:: [[MediaWiki:Common.css]]
 
:: [[MediaWiki:Common.css]]
 +
:: <nowiki>__TOC__</nowiki>
  
 
; Syntax
 
; Syntax
Line 11: Line 11:
  
 
; Parameters
 
; Parameters
:; limit
+
:; limit : Number indicating the highest heading level to show in the table of contents. The lower, the fewer heading levels are shown. Note that in articles, the main level for headings starts at 2 (the article title is H1). Valid values 2 till 6. Defaults to no limit.
:: How many heading levels to show in the table of contents. The lower, the fewer headings are shown. Note that in articles, the main level for headings starts at 2 (the article title is H1, so limit=1 would generally show no headings at all).
+
:; align : Whether to align the table of contents to the "right" or "left". The default is left.
:; align
 
:: Whether to align the table of contents to the "right" or "left". The default is left.
 
  
 
; Sample  
 
; Sample  
:<code><nowiki>{{TOC|limit=2|align=right}}</nowiki></code>
+
:<code><nowiki>{{TOC|limit= 3|align= right}}</nowiki></code>
::gives...
+
::gives... (Note: Due to the way this template, the documentation template and the table of contents code works the sample does <em>not</em> function when not looking directly on the doc page.)
{{TOC|limit=2|align=right}}
+
{{TOC|limit= 3|align= right}}
  
 
== section 1 ==
 
== section 1 ==
Line 29: Line 27:
 
===== section 1.1.1.1 =====
 
===== section 1.1.1.1 =====
  
;See also:
+
; See also:
 
:* [https://www.mediawiki.org/wiki/Template:TOC Template:TOC]
 
:* [https://www.mediawiki.org/wiki/Template:TOC Template:TOC]
  
 
<includeonly>[[Category:Link templates]]</includeonly>
 
<includeonly>[[Category:Link templates]]</includeonly>
 
<noinclude>[[Category:Template documentation]]</noinclude>
 
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 11:12, 29 February 2024

Description
This template changes the way the table of contents is rendered.
Dependencies
Uses
MediaWiki:Common.css
__TOC__
Syntax
{{TOC|<limit=>|<align=>}}
Parameters
limit
Number indicating the highest heading level to show in the table of contents. The lower, the fewer heading levels are shown. Note that in articles, the main level for headings starts at 2 (the article title is H1). Valid values 2 till 6. Defaults to no limit.
align
Whether to align the table of contents to the "right" or "left". The default is left.
Sample
{{TOC|limit= 3|align= right}}
gives... (Note: Due to the way this template, the documentation template and the table of contents code works the sample does not function when not looking directly on the doc page.)

section 1

section 1.1

section 1.1.1

section 1.1.1.1
See also