Difference between revisions of "Template:Headless TOC"
Jump to navigation
Jump to search
imported>Codehydro (optional second parameter for alternate display) |
imported>Codehydro (Non-breaking outside of paragraph) |
||
| Line 1: | Line 1: | ||
| − | <div style="overflow:hidden;width:0;height:0;display:inline-block;position:relative;z-index:99;vertical-align:text-top;top:-1em"> | + | {| style="border-collapse:collapse;display:inline;margin:0;padding:0;" |
| + | |<div style="overflow:hidden;width:0;height:0;display:inline-block;position:relative;z-index:99;vertical-align:text-top;top:-1em"> | ||
==={{{2|{{{1}}}}}}=== | ==={{{2|{{{1}}}}}}=== | ||
| − | </div>{{{1}}}<noinclude> | + | </div>{{{1}}} |
| + | |}<noinclude> | ||
__TOC__ | __TOC__ | ||
==Example== | ==Example== | ||
{| style="border-collapse:collapse" | {| style="border-collapse:collapse" | ||
| − | |This template allow {{TOC tab|words or desired phrases}} to be {{TOC tab|linked in the table of contents}} {{TOC tab| without a new section}} | + | |This template allow {{TOC tab|words or desired phrases}} to be {{TOC tab|linked in the table of contents}} {{TOC tab| without a new section}}. |
|} | |} | ||
| − | + | For now, this must be placed under a {{TOC tab|subhead}}. | |
{{doc}}</noinclude> | {{doc}}</noinclude> | ||
Revision as of 12:35, 23 April 2013
| {{{1}}} |
Example
| This template allow Template:TOC tab to be Template:TOC tab Template:TOC tab. |
For now, this must be placed under a Template:TOC tab.
| This template uses Lua: |
This template is for creating a link in the Table of Contents (TOC) without creating a visible break in the text. This can be especially useful where there are many hidden sections in close proximity, such as in the page Android version history.
==Example==
{| style="border-collapse:collapse"
==Example==
{| style="border-collapse:collapse"
|This template allow {{TOC tab|words or desired phrases}} to be {{TOC tab|linked in the table of contents}} {{TOC tab| without a new section}} but must be enclosed in a table to avoid creating line breaks.
|}
However, as shown in the preceding line, it is easy to make a table look like a normal paragraph. {{tl|TOC tab}} is an alias.
{| style='border-collapse:collapse'
|With the <code>{{TOC tab|depth|depth=2}}</code> parameter, you can set this to {{TOC tab|deeper|depth=3}} {{TOC tab|and deeper|depth=4}} subhead levels.
|}
TOC Depth
New Feature added 30 Dec 2014:
- By default, the link in the table is at the first sub-level (as would be produced by
===text===).
- You may set
|depth=2to link under the next sub level (like====text====), or as deep as you wish. You may also set it as a top-level heading with|depth=0. If omitted, depth will be equal to 1.
Alternative label
{{TOC tab|By default, the text in the first parameter would be used as both the in-line text and the TOC title. If a second parameter is provided then the first parameter would be the text that displays in the body of the article and the second parameter in the TOC.|second parameter}}
See also
| The above documentation is transcluded from Template:Headless TOC/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |