Template:Compact TOC/doc: Difference between revisions

no edit summary
(|{{PAGENAME}})
No edit summary
 
(20 intermediate revisions by 7 users not shown)
Line 1:
{{Documentation subpage}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
-->
{{Intricate template}}
__TOC__
Line 16 ⟶ 20:
 
 
'''For maximum number of features and centered placement''' (leave off a parameter or change it to blank or "no" to disable a feature''')
 
<br /> <nowiki>}}{{</nowiki></code>'''CompactTOC8'''
<code><nowiki>{{</nowiki>'''CompactTOC8'''|side=yes|center=yes|right=|nobreak=yes|top=yes|num=yes|sym=yes|symnum=|seealso=yes|refs=yes|notes=yes|extlinks=yes<nowiki>}}</nowiki></code>
|name=
 
|side=yes
''or''
|center=yes
 
|right=
<code><nowiki>{{</nowiki>'''CompactTOC8'''<br />|side=yes<br />|center=yes<br />|right=<br />|nobreak=yes<br />|top=yes<br />|num=yes<br />|sym=yes<br />|symnum=<br />|seealso=yes<br />|refs=yes<br />|notes=yes<br />|extlinks=yes
|align=center
<br /><nowiki>}}</nowiki></code>
|nobreak=yes
|top=yes
|num=yes
|sym=yes
|symnum=
|custom1=
|custom2=
|custom3=
|seealso=yes
|notesfirst=
|refs=yes
|notes=yes
|extlinks=yes
|a=
...
|z=
}}</code>
 
===Parameters===
*<code>name=</code> &mdash; change the heading to an alternative name instead of "Contents", or hide it completely by entering <code>name=no</code>
*<code>side=yes</code> &mdash; put the "Contents" heading on the left side with a colon, instead of the top without one
*<code>center=yes</code> &mdash; center to ToC in the horizontal middle of the page, instead of floated left
*<code>right=yes</code> &mdash; align the ToC horizontally to the right of the page (may require <code><nowiki><br style="clear:right;" /></nowiki></code> after it, depending on page layout), instead of floated left (this parameter is mutually exclusive with the "center" option above, and should be used sparingly and with good reason)
*<code>align=</code> &mdash; sets the alignment of the ''links'' inside the table; default is left; use <code>center</code>, <code>right</code> or <code>left</code>
*<code>nobreak=yes</code> &mdash; no linebreak between the A-B-C-etc. stuff and the See also/References/etc. stuff (note: does not affect the heading; use <code>side=</code> for that)
*<code>top=yes</code> &mdash; enable the "Top" link; this is only useful if this copy of the ToC is ata thesecondary bottomToC (ornot middle,at theoretically)the top of the page, ase.g. in the middle of a secondarylong ToCglossary. (everyEvery rendered page has a hidden <code><nowiki><a name="top" id="top"></a></nowiki></code> above the sitenotice which makes this link work without having to do anything but enable it in the template.)
*<code>sym=yes</code> &mdash; enable the "!$@" link for symbolic entries section
*<code>num=yes</code> &mdash; enable the "0–9" link for numeric entries section (notecreate thata itheading isof "–",<code><nowiki>==0&amp;ndash;9==</nowiki></code> the en-dash, not "-",for the hyphen-minus at upper right oflink mostto keyboardswork)
*<code>symnum=yes</code> &mdash; enable the "!–9" link for combined symbolic and numeric entries section (notecreate thata itheading isof "–"<code><nowiki>==!&amp;ndash;9==</nowiki></code> not "-", and thatfor the preceding two options are mutually exclusive withlink thisto onework)
*<code>custom1</code>, <code>custom2</code> and <code>custom3</code> &mdash; add up to 3 extra "custom" sections at the end of the list (alternatively <code>Sec1, Sec2, Sec3</code>)
*<code>seealso=yes</code> &mdash; enable link to the "See also" section
*<code>refs=yes</code> &mdash; enable link to the "References" section (noteobserve that it is plural)
*<code>notes=yes</code> &mdash; enable link to the "Notes" section (noteobserve that it is plural)
*<code>notesfirst=yes</code> &mdash; enable link to the "Notes" section, but placed before "References"; ''do not use with <code>notes</code>'' (and do observe that it is plural)
*<code>extlinks=yes</code> &mdash; enable link to the "External links" section
*<code>a=</code> through <code>z=</code> &mdash; individually disable particular letters that have no entries. ''Use with caution'' and check regularly to make sure that new entries do not require the removal of this parameters. Can also be used to create range links, e.g. "X-Z". ''(See [[#Letters]] below for more detailed documentation of this feature.)''
 
====Letters====
Any letter can be deleted (i.e. because it has no entries in the list) by adding it as a '''lower case''' blank parameter
{{tlx|CompactTOC8|side&#61;yes|symj&#61;yes|numq&#61;yes|refs&#61;yes}}
{{CompactTOC8|side=yes|symj=yes|numq=yes|refs=yes}}
 
Or it can be replaced with an unlinked letter by using that letter ('''upper case'''):
{{tlx|CompactTOC8|side&#61;yes|rightj&#61;yesJ|symnumq&#61;yes|seealso&#61;yesQ}}
 
{{CompactTOC8|top=no|refsside=yes|notesj=yesJ|extlinksq=yesQ}}
 
''Note:'' It is often better to create an empty placeholder span (e.g. <code><nowiki><span id="Q" /></nowiki></code> where the letter's heading would be in the page if it existed, since in most cases it is quite possible that it will come to exist in the future.
 
 
This feature can also be used to create range links:
 
{{tlx|CompactTOC8|topside&#61;noyes|refsx&#61;yes<nowiki>[[#X-Z|notesX-Z]]</nowiki>|y&#61;yes|extlinksz&#61;yes}}
 
{{CompactTOC8|side=yes|x=[[#X-Z|X-Z]]|y=|z=}}
 
====Shorthand====
* <code>short1</code> can be used as the very first parameter (before <code>name=</code>) for shortening a common usage:
 
{{tlx|CompactTOC8|short1}}
 
{{CompactTOC8|short1}}
 
It replaces <NOWIKI>{{CompactTOC8|side=yes|center=yes|nobreak=yes|refs=yes}}</NOWIKI>
 
===Examples===
Line 45 ⟶ 99:
 
 
{{tlx|CompactTOC8|name&#61;no|center&#61;yes|top&#61;yes|seealsocustom1&#61;yesNew section|custom2&#61;Additional section}}
{{CompactTOC8|name=no|center=yes|top=yes|seealso=yes|notes=yes|custom1=New section|custom2=Additional section}}
 
 
 
{{tlx|CompactTOC8|side&#61;yes|sym&#61;yes|num&#61;yes|refs&#61;yes|seealso&#61;yes|sec1&#61;Other}}
{{CompactTOC8|side=yes|center=yes|nobreak=yes|topsym=yes|num=yes|sym=yes|seealso=yes|refs=yes|notesSec1=yes|extlinks=yesOther}}
 
 
{{tlx|CompactTOC8|side&#61;yes|sym&#61;yes|num&#61;yes|refs&#61;yes}}
{{CompactTOC8|side=yes|sym=yes|num=yes|refs=yes}}
 
{{tlx|CompactTOC8|name&#61;Directory|top&#61;no|refs&#61;yes|notes&#61;yes|extlinks&#61;yes}}
{{CompactTOC8|name=Directory|top=no|refs=yes|notes=yes|extlinks=yes}}
 
 
{{tlx|CompactTOC8|top&#61;no|refs&#61;yes|notes&#61;yes|extlinks&#61;yes}}
{{CompactTOC8|top=no|refs=yes|notes=yes|extlinks=yes}}
 
{{tlx|CompactTOC8|name&#61;no|side=&#61;yes|right=&#61;yes|symnum=&#61;yes|seealso=&#61;yes}}<br style="clear:right;" />
{{CompactTOC8|name=no|side=yes|right=yes|symnum=yes|seealso=yes}}<br style="clear:right;" />
 
 
{{tlx|CompactTOC8|side&#61;yes|right&#61;yes|symnum&#61;yes|seealso&#61;yes}}
{{CompactTOC8|side=yes|right=yes|symnum=yes|seealso=yes}}<br style="clear:right;" />
 
<code><nowiki>{{</nowiki>'''CompactTOC8'''<nowiki>|side=yes|center=yes|right=|nobreak=yes|top=yesshort1|num=yes|sym=yes|symnum=|seealso=yes|refs=yes|notesnotesfirst=yes|extlinks=yes<nowiki>}}</nowiki></code>
{{CompactTOC8|short1|num=yes|sym=yes|seealso=yes|notesfirst=yes|extlinks=yes}}
 
 
<includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<code><nowiki>{{</nowiki>'''CompactTOC8'''<nowiki>|side=yes|center=yes|nobreak=yes|top=yes|num=yes|sym=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}</nowiki></code>
{{CompactTOC8|side=yes|center=yes|nobreak=yes|top=yes|num=yes|sym=yes|seealso=yes|refs=yes|notes=yes|extlinks=yes}}
 
<noinclude>[[Category:TemplateTOC documentationtemplates|{{PAGENAME}}CompactTOC8]]</noinclude>
[[Category:Templates using ParserFunctions|{{PAGENAME}}CompactTOC8]]
<includeonly>
[[Category:TOC templates|{{PAGENAME}}]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
 
[[nl:Sjabloon:CompactTOC8]]
[[sl:Predloga:CompactTOC3]]
[[es:Plantilla:TOC]]
</includeonly>
Anonymous user