Difference between revisions of "Template:SideTOC"

From Savage Game Design Wiki
Jump to navigation Jump to search
(Page creation)
 
(-)
 
Line 1: Line 1:
<includeonly><div style="float: right; font-size: {{{1|1}}}em; margin: 0 0 0.5em 1.5em; max-width: 25%;">__TOC__</div></includeonly><noinclude>{{SideTOC}}
+
<includeonly><div style="float: right; font-size: {{{1|1}}}em; margin: 0 0 0.5em 1.5em; max-width: 25%">__TOC__</div></includeonly><noinclude>{{SideTOC}}
== Description ==
 
This template places the '''T'''able '''o'''f '''C'''ontents ('''ToC''') on the right of the page with a maximum width of 25%.
 
This page uses it, other uses can be found [[Special:WhatLinksHere/Template:SideTOC|on this list]].
 
  
== How to use it ==
+
Shows the '''T'''able '''o'''f '''C'''ontents ('''ToC''') on the right side of the page with a maximum width of 25%.
Write <tt><nowiki>{{SideTOC}}</nowiki></tt> at the top of the edited content. The ToC will then appear on the side of the page.
 
  
=== Options ===
+
== Usage ==
Only one parameter is available, that is '''font-size''': <tt><nowiki>{{SideTOC|0.85}}</nowiki></tt>.
+
{{<nowiki/>SideTOC|'''''fontSize'''''}}
This example will have the font size reduced to 85% of the original.
+
* fontSize: number, in <tt>em</tt>
  
 
== HTML and CSS behind it ==
 
== HTML and CSS behind it ==
 
<syntaxhighlight lang="html">
 
<syntaxhighlight lang="html">
<div style="float: right; font-size: {{{1|1}}}em; margin-left: 0 0 0.5em 1.5em; max-width: 25%;">__TOC__</div>
+
<div style="float: right; font-size: {{{1|1}}}em; margin: 0 0 0.5em 1.5em; max-width: 25%">__TOC__</div>
</syntaxhighlight>[[Category:Templates]]
+
</syntaxhighlight>
 +
 
 +
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 13:38, 18 October 2020

Shows the Table of Contents (ToC) on the right side of the page with a maximum width of 25%.

Usage

{{SideTOC|fontSize}}

  • fontSize: number, in em

HTML and CSS behind it

<div style="float: right; font-size: {{{1|1}}}em; margin: 0 0 0.5em 1.5em; max-width: 25%">__TOC__</div>