Template:Compact TOC/doc: Difference between revisions

no edit summary
(→‎Shorthand: documented for clarity that {{CompactTOC8|short1}} equals {{CompactTOC8|side=yes|center=yes|nobreak=yes|refs=yes}})
No edit summary
 
(15 intermediate revisions by 6 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''')
 
<code><nowiki>{{</nowiki>'''CompactTOC8'''|name=Contents|side=yes|center=yes|right=|align=center|nobreak=yes|top=yes|num=yes|sym=yes|symnum=|custom1=|custom2=|custom3=|seealso=yes|notesfirst=|refs=yes|notes=yes|extlinks=yes<nowiki>}}</nowiki></code>
 
''or''
<nowiki>{{</nowiki>'''CompactTOC8'''
|name=
Line 52 ⟶ 53:
*<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>'' (noteand 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 '''lowercaselower case''' blank parameter, or replaced with an unlinked letter by using that letter:
{{tlx|CompactTOC8|side&#61;yes|j&#61;|q&#61;}}
{{CompactTOC8|side=yes|j=|q=}}
 
Or it can be replaced with an unlinked letter by using that letter ('''upper case'''):
{{tlx|CompactTOC8|side&#61;yes|j&#61;J|q&#61;Q}}
 
{{CompactTOC8|side=yes|j=J|q=Q}}
 
''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.
With a little more work, one can create range links:
 
 
WithThis afeature littlecan morealso work,be oneused canto create range links:
 
{{tlx|CompactTOC8|side&#61;yes|x&#61;<nowiki>[[#X-Z|X-Z]]</nowiki>|y&#61;|z&#61;}} (or <code>x=|y=|z=<nowiki>[[#X-Z|X-Z]]</nowiki></code> etc.)
 
{{tlx|CompactTOC8|side&#61;yes|x&#61;<nowiki>[[#X-Z|X-Z]]</nowiki>|y&#61;|z&#61;}} (or <code>x=|y=|z=<nowiki>[[#X-Z|X-Z]]</nowiki></code> etc.)
{{CompactTOC8|side=yes|x=[[#X-Z|X-Z]]|y=|z=}}
 
====Shorthand====
For quicker referencing common usage,* <code>short1</code> can be enteredused as the very first parameter (before <code>name=</code>) for shortening a common usage:
 
{{tlx|CompactTOC8|short1}} equals <NOWIKI>{{CompactTOC8|side=yes|center=yes|nobreak=yes|refs=yes}}</NOWIKI>
 
{{CompactTOC8|short1}}
 
It replaces <NOWIKI>{{CompactTOC8|side=yes|center=yes|nobreak=yes|refs=yes}}</NOWIKI>
 
===Examples===
Line 114 ⟶ 123:
 
 
<includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
 
<includeonly>
[[Category:TOC templates|{{PAGENAME}}CompactTOC8]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}CompactTOC8]]
 
[[nl:Sjabloon:CompactTOC8]]
[[sl:Predloga:CompactTOC3]]
[[es:Plantilla:TOC]]
</includeonly>
Anonymous user