0
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[toc]] | [[toc]] | ||
<noinclude>{{Pp-semi-vandalism|small=yes}}</noinclude> | |||
{{Article creation}} | |||
==Creation and numbering of sections== | ==Creation and numbering of sections== | ||
Line 34: | Line 36: | ||
When either <code><nowiki>__FORCETOC__</nowiki></code> or <code><nowiki>__TOC__</nowiki></code> (with two underscores on either side of the word) is placed in the wikitext, a TOC is added even if the page has fewer than four headings. | When either <code><nowiki>__FORCETOC__</nowiki></code> or <code><nowiki>__TOC__</nowiki></code> (with two underscores on either side of the word) is placed in the wikitext, a TOC is added even if the page has fewer than four headings. | ||
====Floating the TOC==== | ====Floating the TOC==== | ||
Line 40: | Line 41: | ||
# If an article will be adversely affected by the change, don't float the TOC. | # If an article will be adversely affected by the change, don't float the TOC. | ||
# If floating the TOC, it should be placed at the end of the lead section of the text, before the first section heading. Users of [[screen reader]]s do not expect any text between the TOC and the first heading, and having no text above the TOC is | # If floating the TOC, it should be placed at the end of the lead section of the text, before the first section heading. Users of [[screen reader]]s do not expect any text between the TOC and the first heading, and having no text above the TOC is | ||
===Limiting the depth of the TOC=== | ===Limiting the depth of the TOC=== | ||
When an article or project page has a very large number of subsections, it may be appropriate to hide lower-level subsections from the TOC. You can specify a limit for the lowest-level section that should be displayed using {{tlx|TOC limit|<var>n</var>}}, where <code><var>n<var></code> is the number of <code>=</code> signs that are used on each side of the lowest-level section header that should be displayed (e.g. <code>3</code> to show <code><nowiki>===sub-sections===</nowiki></code> but hide <code><nowiki>====sub-sub-sections====</nowiki></code>). The <code>limit=<var>n</var></code> parameter can also be given to {{tlnull|TOC left}} or {{tlnull|TOC right}} the same way. | When an article or project page has a very large number of subsections, it may be appropriate to hide lower-level subsections from the TOC. You can specify a limit for the lowest-level section that should be displayed using {{tlx|TOC limit|<var>n</var>}}, where <code><var>n<var></code> is the number of <code>=</code> signs that are used on each side of the lowest-level section header that should be displayed (e.g. <code>3</code> to show <code><nowiki>===sub-sections===</nowiki></code> but hide <code><nowiki>====sub-sub-sections====</nowiki></code>). The <code>limit=<var>n</var></code> parameter can also be given to {{tlnull|TOC left}} or {{tlnull|TOC right}} the same way. | ||
Line 68: | Line 60: | ||
In the HTML code for each section there is "id" attribute holding the section title. This enables [[w:hyperlink|linking]] directly to sections. These section anchors are automatically used by MediaWiki when it generates a table of contents for the page, and therefore when a section heading in the ToC is clicked, it will jump to the section. Also, the section anchors can be manually linked directly to one section within a page. | In the HTML code for each section there is "id" attribute holding the section title. This enables [[w:hyperlink|linking]] directly to sections. These section anchors are automatically used by MediaWiki when it generates a table of contents for the page, and therefore when a section heading in the ToC is clicked, it will jump to the section. Also, the section anchors can be manually linked directly to one section within a page. | ||
To link to a section in the same page you can use <tt><nowiki>[[#section name|displayed text]]</nowiki></tt>, and to link to a section in another page <tt><nowiki>[[page name#section name|displayed text]]</nowiki></tt>. | To link to a section in the same page you can use <tt><nowiki>[[#section name|displayed text]]</nowiki></tt>, and to link to a section in another page <tt><nowiki>[[page name#section name|displayed text]]</nowiki></tt>. |