Difference between revisions of "Template:TOC"

From GodWiki
Jump to navigation Jump to search
m (Pipe template in piped links)
m (Trick the parser functions into stripping whitespace for us)
Line 3: Line 3:
 
|+ Table of Contents
 
|+ Table of Contents
 
| {{#if: {{{1|}}}|
 
| {{#if: {{{1|}}}|
# [[#{{{1}}}{{!}}{{{1}}}]]}}{{#if: {{{2|}}}|
+
# [[#{{#if:{{{1}}}|{{{1}}}}}{{!}}{{#if:{{{1}}}|{{{1}}}}}]]}}{{#if: {{{2|}}}|
# [[#{{{2}}}{{!}}{{{2}}}]]}}{{#if: {{{3|}}}|
+
# [[#{{#if:{{{2}}}|{{{2}}}}}{{!}}{{#if:{{{2}}}|{{{2}}}}}]]}}{{#if: {{{3|}}}|
# [[#{{{3}}}{{!}}{{{3}}}]]}}{{#if: {{{4|}}}|
+
# [[#{{#if:{{{3}}}|{{{3}}}}}{{!}}{{#if:{{{3}}}|{{{3}}}}}]]}}{{#if: {{{4|}}}|
# [[#{{{4}}}{{!}}{{{4}}}]]}}{{#if: {{{5|}}}|
+
# [[#{{#if:{{{4}}}|{{{4}}}}}{{!}}{{#if:{{{4}}}|{{{4}}}}}]]}}{{#if: {{{5|}}}|
# [[#{{{5}}}{{!}}{{{5}}}]]}}{{#if: {{{6|}}}|
+
# [[#{{#if:{{{5}}}|{{{5}}}}}{{!}}{{#if:{{{5}}}|{{{5}}}}}]]}}{{#if: {{{6|}}}|
# [[#{{{6}}}{{!}}{{{6}}}]]}}{{#if: {{{7|}}}|
+
# [[#{{#if:{{{6}}}|{{{6}}}}}{{!}}{{#if:{{{6}}}|{{{6}}}}}]]}}{{#if: {{{7|}}}|
# [[#{{{7}}}{{!}}{{{7}}}]]}}{{#if: {{{8|}}}|
+
# [[#{{#if:{{{7}}}|{{{7}}}}}{{!}}{{#if:{{{7}}}|{{{7}}}}}]]}}{{#if: {{{8|}}}|
# [[#{{{8}}}{{!}}{{{8}}}]]}}{{#if: {{{9|}}}|
+
# [[#{{#if:{{{8}}}|{{{8}}}}}{{!}}{{#if:{{{8}}}|{{{8}}}}}]]}}{{#if: {{{9|}}}|
# [[#{{{9}}}{{!}}{{{9}}}]]}}{{#if: {{{10|}}}|
+
# [[#{{#if:{{{9}}}|{{{9}}}}}{{!}}{{#if:{{{9}}}|{{{9}}}}}]]}}{{#if: {{{10|}}}|
# [[#{{{10}}}{{!}}{{{10}}}]]}}{{#if: {{{11|}}}|
+
# [[#{{#if:{{{10}}}|{{{10}}}}}{{!}}{{#if:{{{10}}}|{{{10}}}}}]]}}{{#if: {{{11|}}}|
# [[#{{{11}}}{{!}}{{{11}}}]]}}{{#if: {{{12|}}}|
+
# [[#{{#if:{{{11}}}|{{{11}}}}}{{!}}{{#if:{{{11}}}|{{{11}}}}}]]}}{{#if: {{{12|}}}|
# [[#{{{12}}}{{!}}{{{12}}}]]}}{{#if: {{{13|}}}|
+
# [[#{{#if:{{{12}}}|{{{12}}}}}{{!}}{{#if:{{{12}}}|{{{12}}}}}]]}}{{#if: {{{13|}}}|
# [[#{{{13}}}{{!}}{{{13}}}]]}}{{#if: {{{14|}}}|
+
# [[#{{#if:{{{13}}}|{{{13}}}}}{{!}}{{#if:{{{13}}}|{{{13}}}}}]]}}{{#if: {{{14|}}}|
# [[#{{{14}}}{{!}}{{{14}}}]]}}{{#if: {{{15|}}}|
+
# [[#{{#if:{{{14}}}|{{{14}}}}}{{!}}{{#if:{{{14}}}|{{{14}}}}}]]}}{{#if: {{{15|}}}|
# [[#{{{15}}}{{!}}{{{15}}}]]}}{{#if: {{{16|}}}|
+
# [[#{{#if:{{{15}}}|{{{15}}}}}{{!}}{{#if:{{{15}}}|{{{15}}}}}]]}}{{#if: {{{16|}}}|
# [[#{{{16}}}{{!}}{{{16}}}]]}}{{#if: {{{17|}}}|
+
# [[#{{#if:{{{16}}}|{{{16}}}}}{{!}}{{#if:{{{16}}}|{{{16}}}}}]]}}{{#if: {{{17|}}}|
# [[#{{{17}}}{{!}}{{{17}}}]]}}{{#if: {{{18|}}}|
+
# [[#{{#if:{{{17}}}|{{{17}}}}}{{!}}{{#if:{{{17}}}|{{{17}}}}}]]}}{{#if: {{{18|}}}|
# [[#{{{18}}}{{!}}{{{18}}}]]}}{{#if: {{{19|}}}|
+
# [[#{{#if:{{{18}}}|{{{18}}}}}{{!}}{{#if:{{{18}}}|{{{18}}}}}]]}}{{#if: {{{19|}}}|
# [[#{{{19}}}{{!}}{{{19}}}]]}}{{#if: {{{20|}}}|
+
# [[#{{#if:{{{19}}}|{{{19}}}}}{{!}}{{#if:{{{19}}}|{{{19}}}}}]]}}{{#if: {{{20|}}}|
# [[#{{{20}}}{{!}}{{{20}}}]]}}
+
# [[#{{#if:{{{20}}}|{{{20}}}}}{{!}}{{#if:{{{20}}}|{{{20}}}}}]]}}
 
|}{{#ifeq:{{yesno-no|{{{spacer}}}}}|yes|{{spacer}}}}<noinclude>{{doc|content=
 
|}{{#ifeq:{{yesno-no|{{{spacer}}}}}|yes|{{spacer}}}}<noinclude>{{doc|content=
 
==Quick & Dirty Docs==
 
==Quick & Dirty Docs==

Revision as of 08:04, 25 August 2020

📝Under active creation
This article is the target of an editor's creative exploration.
Their message is: This template is experimental and may change. I'll avoid making breaking changes if possible, but cannot guarantee it. If you choose to use it on a User: page, I will leave a message on your User talk: notifying you if changes are needed; otherwise I will make any necessary changes on any page using this template as required.
If you have something to add to this article, please discuss it on the talk page. [07:51, 25 August 2020 (UTC)]
Table of Contents
📚 Documentation

Quick & Dirty Docs

First draft, Djonni (talk) 07:51, 25 August 2020 (UTC)

Currently supported parameters:

Unnamed parameters 1..20
Up to 20 headers in the document to include in the ToC. The text must match the header text exactly or linking won't work. Note that an {{anchor}} in the article text may be used instead of a header, if necessary; in which case, the text in the ToC must exactly match the {{anchor}} text instead.
table-class
Additional text to insert into the table's class= attribute. E.g., |table-class=mw-collapsible
table-style
Additional text to insert at end of the table's style attribute. Will override default style properties if relevant. E.g., |table-style=font-size: large;
spacer=yes/no
Enables or explicitly disables a {{spacer}} at end of ToC, if necessary for mobile layout. Current default behaviour is |spacer=no, but this is subject to testing and shouldn't be relied upon. Any valid {{yesno}} value works here.