From Fedora Project Wiki

m (Created page with '<noinclude>{{TOCright|num=nonumtoc}} {{PAGENAME}} </noinclude>{| cellspacing="0" cellpadding="0" style="clear: {{{clear|right}}}; margin-bottom: .5em; ...')
 
(Add noautonum parameter)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{TOCright|num=nonumtoc}}
<div {{#if:{{{show|{{{num|}}}}}}{{{noautonum|}}}|class="toclimit-{{#expr:1 + {{{show|{{{num|6}}}}}}}} {{#ifeq:{{{noautonum|}}}|yes|noautonum}}"}} style="clear: {{{clear|right}}}; float: {{{align|right}}}; margin: 0.25em 0.25em 0.5em 2em; width: {{{width|{{{1|auto}}}}}};">__TOC__</div><noinclude>
[[Category:TOC templates|{{PAGENAME}}]]
{{Documentation|content=The <big>[[Template:TOCright|&lbrace;&lbrace;TOCright&rbrace;&rbrace;]]</big> template can be used to position a page's Table of Contents box on its right margin, allowing the text content to wrap around it rather than start beneath it.
</noinclude>{| cellspacing="0" cellpadding="0" style="clear: {{{clear|right}}}; margin-bottom: .5em; float: right; padding: .5em 0 .8em 1.4em; background: none; width: {{{1|auto}}};" class="toclimit-{{#expr: 1 + {{{show|11}}} }} {{{num|}}}"
|__TOC__
|}<noinclude>


== Introduction ==
== Usage ==
Enter '''<code><nowiki>{{TOCright}}</nowiki></code>''' on the page where you want the top of the table of contents box to appear.


This template can be used to wrap page text around a right-side table of contents box.  
=== Parameters ===
{{{!}} class="wikitable"
! Name !! Description
{{!}}-
! style="text-align: center; width: 7em;" {{!}} <code>&verbar;align=</code>
{{!}} Supplies a value to the [https://www.w3schools.com/css/css_float.asp <code>float:</code> CSS property]; can be one of: <code>left</code>, <code>right</code> (default), <code>none</code> or <code>inherit</code>.
{{!}}-
! style="text-align: center; width: 7em;" {{!}} <code>&verbar;clear=</code>
{{!}} Supplies a value to the [https://www.w3schools.com/css/css_float_clear.asp <code>clear:</code> CSS property]; can be one of: <code>left</code>, <code>right</code> (default), <code>both</code>, <code>none</code> or <code>inherit</code>.
{{!}}-
! style="text-align: center; width: 7em;" {{!}} <code>&verbar;noautonum=</code>
{{!}} When assigned the value <code>yes</code>, hides the section numbers in the ToC; all other values are ignored.
{{!}}-
! style="text-align: center; width: 7em;" {{!}} <code>&verbar;num=</code><br /><code>&verbar;show=</code>
{{!}} Sets the maximum depth of the table of contents, i.e. the deepest heading level (number of equality symbols surrounding the heading) that will be shown; accepts integer values between 1 and 6, inclusive.
{{!}}-
! style="text-align: center; width: 7em;" {{!}} <code>&verbar;width=</code><br /><code>&verbar;1=</code>
{{!}} Defines the width of the ToC box; accepts any [https://www.w3schools.com/cssref/css_units.php valid CSS length unit] value, defaults to <code>auto</code>. Can also be supplied as the sole unnamed parameter, as in <code><nowiki>{{TOCright|12.5vw}}</nowiki></code>.
{{!}}}


==Common usage==
=== Examples ===
* <code><nowiki>{{TOCright}}</nowiki></code> - Entered on the page where you want the top of the table of contents box to appear.
* <code><nowiki>{{TOCright|align=right|clear=both|show=4|width=20%}}</nowiki></code>
</noinclude>
* <code><nowiki>{{TOCright|24em|num=3}}</nowiki></code>
* <code><nowiki>{{TOCright|clear=none|noautonum=yes}}</nowiki></code>
 
== See also ==
* &lbrace;&lbrace;[[Template:TOClimit|TOClimit]]&rbrace;&rbrace;
 
 
[[Category:Content templates]]}}</noinclude>

Latest revision as of 01:03, 19 July 2024

Template documentation

The {{TOCright}} template can be used to position a page's Table of Contents box on its right margin, allowing the text content to wrap around it rather than start beneath it.

Usage

Enter {{TOCright}} on the page where you want the top of the table of contents box to appear.

Parameters

Name Description
|align= Supplies a value to the float: CSS property; can be one of: left, right (default), none or inherit.
|clear= Supplies a value to the clear: CSS property; can be one of: left, right (default), both, none or inherit.
|noautonum= When assigned the value yes, hides the section numbers in the ToC; all other values are ignored.
|num=
|show=
Sets the maximum depth of the table of contents, i.e. the deepest heading level (number of equality symbols surrounding the heading) that will be shown; accepts integer values between 1 and 6, inclusive.
|width=
|1=
Defines the width of the ToC box; accepts any valid CSS length unit value, defaults to auto. Can also be supplied as the sole unnamed parameter, as in {{TOCright|12.5vw}}.

Examples

  • {{TOCright|align=right|clear=both|show=4|width=20%}}
  • {{TOCright|24em|num=3}}
  • {{TOCright|clear=none|noautonum=yes}}

See also