Difference between revisions of "Template:Outdent/doc"

From Summertime Saga Wiki
Jump to: navigation, search
m (Usage)
m
Line 1: Line 1:
For outdenting a reply on a talk page when indention gets too deep.
+
Threading of replies on talk pages is done using indentation and lists. This template is used for ''out''denting a reply on a talk page when indentation gets too deep.
  
Indenting on talk pages is done using colons and asterisks and hashes to produce "tabs"; this template produces a connector bar and (optionally) initial text to indicate an outdent, with the length of the bar specified by the number of colons used in the template. The left margin is sent to the position of the template. <code><nowiki>:: {{outdent}}</nowiki></code> produces:
+
== Usage ==
:: {{outdent}}
 
  
The template also has a named parameter to reverse the direction of the bar to indicate deeper indentation- see {{section link|Template:Outdent/doc|Indent|nopage=yes}} below. <code><nowiki>:: {{outdent|reverse=x}}</nowiki></code> produces:
+
{{tlc|outdent|<var>integer</var>}} or {{tlc|outdent|<var>indentation wikitext</var>}}. Integer examples: {{tlc|outdent|5}}, {{tlc|outdent|-15}}, {{tlc|outdent|11|r{{=}}y}}. Indentation examples: {{tlc|outdent|:::::}}, {{tlc|outdent|*::::::}}, {{tlc|outdent|**:::#}}.
:: {{outdent|reverse=x}}
 
  
== Usage ==
+
== Parameters ==
  
: <code><nowiki>{{outdent|optional param1|optional param2|reverse / indent / r / in =|test_line_width =}}</nowiki></code>
+
; {{para|1|<var>indent</var>}}
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
: Supports two modes: literal indentation or an integer. In literal indentation mode the value may contain <code>:</code> (indents), <code>*</code> (unnumbered list), and <code>#</code> (numbered list). It is recommended to copy the colons, asterisks, and hashes from the start of the previous message. An integer value is interpreted as number or indents (<code>:</code>). Magnitude of a negative integer specifies the width of ''in''dentation (same as positive integer with {{para|reverse|y}}). Default value is <code>10</code>. Supported range is from −40 to 40.
{{para|1}}
+
; {{para|2|y}}
* The number of tabs/indentations to outdent.
+
: Set it to add a link to [[Wikipedia:Indentation#Outdenting]]. {{tlc|outdent|5|y}} produces:
* Value may be colons, hashes (count for 2) and asterisks or just values.
+
{{outdent|5|y}}
* When using this you may copy the colons, hashes and asterisks from the start of the last message as the first parameter.
+
; {{para|r|y}} (aliases {{para|reverse|y}}, {{para|indent|y}}, {{para|in|y}})
* If the first parameter is not used, the default value of 10 is used.
+
: Reverses the outdentation to become indentation and vice versa.
* A value of zero causes the template to return a pipe (|).
 
* '''Recommended'''
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
{{para|2}}
 
* If used, specifies that the string ([[wikipedia:Indentation#Outdenting|outdent]]) is to be placed at the start of the new line's text.
 
* Can be any value.
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
{{para|reverse}} ({{para|indent}}, {{para|r}}, {{para|in}})
 
* Can be set so: <code><nowiki>{{outdent|reverse=''string''}}</nowiki></code> where string can be any character or string of characters. It will also work with the optional unnamed parameters described previously. Its purpose is to allow for indention. See examples below.
 
* Can be any value.
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
{{para|test_line_width}}
 
* Set to any string to test the line creating and reduction functions in the module.
 
* '''Not recommended'''
 
</div>
 
 
 
The default number of colons is 10. When the value specified is over 40, the module stops at 40 (for readability reasons). The template also recognizes the named parameter "reverse" - see {{section link|Template:Outdent/doc|Indent|nopage=yes}} below.
 
  
 
== Examples ==
 
== Examples ==
  
To outdent posts, insert the number of colons that were used for indenting in the previous post, or use an integer value for that number.
+
=== With indentation wikitext ===
  
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
<div style="border:1px #A2A9B1 solid; padding:8px; margin:4px;">
<pre>:::: This is the previous post, indented 4 levels
+
<pre>:::: Previous post, indented with four colons.
{{outdent|::::}} Start of a new post</pre>
+
{{outdent|::::}} New post.</pre>
  
displays as
+
''displays as''
  
:::: This is the previous post, indented 4 levels
+
:::: Previous post, indented with four colons.
{{outdent|::::}} Start of a new post
+
{{outdent|::::}} New post.
 
</div>
 
</div>
  
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
=== Positive integer ===
<pre>:::::: This is the previous post, indented 6 levels
 
{{outdent|6}} Start of a new post</pre>
 
 
 
displays as
 
  
:::::: This is the previous post, indented 6 levels
+
<div style="border:1px #A2A9B1 solid; padding:8px; margin:4px;">
{{outdent|6}} Start of a new post
+
<pre>:::::: Previous post, indented 6 levels.
</div>
+
{{outdent|6}} New post.</pre>
  
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
''displays as''
<pre>Alternatively:
 
:::::: This is the previous post, indented 6 levels
 
{{outdent}} Start of a new post. ''(Note that the bar is longer - it is using the default value of 10.)''</pre>
 
  
displays as
+
:::::: Previous post, indented 6 levels.
 
+
{{outdent|6}} New post.
:::::: This is the previous post, indented 6 levels
 
{{outdent}} Start of a new post. ''(Note that the bar is longer - it is using the default value of 10.)''
 
</div>
 
 
 
You can also have the template automatically add a linked tag, by adding any second parameter (its specific value is discarded):
 
 
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<pre>:::::: This is the previous post, indented 6 levels
 
{{outdent|6|link}} Start of a new post</pre>
 
 
 
displays as
 
 
 
:::::: This is the previous post, indented 6 levels
 
{{outdent|6|link}} Start of a new post
 
 
</div>
 
</div>
  
To not outdent all the way to the left margin, the outdent template itself can be indented using one or more colons:
+
=== With separate indent ===
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<pre>:::::: This is the previous post, indented 6 levels
 
:: {{outdent|4}} Start of a new post</pre>
 
 
 
displays as
 
  
:::::: This is the previous post, indented 6 levels
+
To not outdent all the way to the left margin, indent the {{tl|outdent}} template itself using colons:
:: {{outdent|4}} Start of a new post
+
<div style="border:1px #A2A9B1 solid; padding:8px; margin:4px;">
</div>
+
<pre>:::::: Previous post, indented 6 levels.
 +
:: {{outdent|4}} New post.</pre>
  
=== More examples ===
+
''displays as''
  
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
:::::: Previous post, indented 6 levels.
<nowiki>{{outdent}} xxx  </nowiki>{{outdent}}xxx<br>
+
:: {{outdent|4}} New post.
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<nowiki>{{outdent|1}} xxx </nowiki>{{outdent|1}} xxx<br>
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<nowiki>{{outdent|2}} xxx      </nowiki>{{outdent|2}} xxx
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<nowiki>{{outdent|6}} xxx      </nowiki>{{outdent|6}} xxx
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
::: <nowiki>{{outdent|1|anything}} xxx</nowiki>{{outdent|1|anything}} xxx
 
</div>
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
::: <nowiki>{{outdent|6|xxx}} xxx    </nowiki>{{outdent|6|xxx}} xxx
 
 
</div>
 
</div>
  
 
=== Indent ===
 
=== Indent ===
  
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
<div style="border:1px #A2A9B1 solid; padding:8px; margin:4px;">
<pre>:::::: This is the previous post, indented 6 levels
+
Using {{para|reverse|y}}:
:: {{outdent|4}} Start of a new post indented 2 levels using a bar of length 6 - 2 = 4.
+
<pre>:::::: Previous post, indented 6 levels.
 +
:: {{outdent|4}} Start of a new post indented 2 levels using a bar of length 6 2 = 4.
 
:: {{outdent|5|reverse=yes}}
 
:: {{outdent|5|reverse=yes}}
::::::: Indent 7 levels using a reversed bar of length 7 - 2 = 5.</pre>
+
::::::: Indent to indentation level 7 using a reversed bar of length 7 2 = 5.</pre>
  
displays as
+
''displays as''
  
:::::: This is the previous post, indented 6 levels
+
:::::: Previous post, indented 6 levels.
:: {{outdent|4}} Start of a new post indented 2 levels using a bar of length 6 - 2 = 4.
+
:: {{outdent|4}} Start of a new post indented 2 levels using a bar of length 6 2 = 4.
 
:: {{outdent|5|reverse=yes}}
 
:: {{outdent|5|reverse=yes}}
::::::: Indent 7 levels using a reversed bar of length 7 - 2 = 5.
+
::::::: Indent to indentation level 7 using a reversed bar of length 7 2 = 5.
 
</div>
 
</div>
  
<div style="border:thin grey solid; padding:8px; margin:4px;">
+
Or with a negative integer:
 +
<div style="border:1px #A2A9B1 solid; padding:8px; margin:4px;">
 
<pre>
 
<pre>
 
:::::: Original conversation.
 
:::::: Original conversation.
:::::: {{outdent|3|reverse=x}}
+
:::::: {{outdent|-3}}
 
::::::::: Afterthought.
 
::::::::: Afterthought.
 
::::::: {{outdent|2}}
 
::::::: {{outdent|2}}
 
::::::: Continuation of original conversation.</pre>
 
::::::: Continuation of original conversation.</pre>
  
displays as
+
''displays as''
  
 
:::::: Original conversation.
 
:::::: Original conversation.
:::::: {{outdent|3|reverse=x}}
+
:::::: {{outdent|-3}}
 
::::::::: Afterthought.
 
::::::::: Afterthought.
 
::::::: {{outdent|2}}
 
::::::: {{outdent|2}}
 
::::::: Continuation of original conversation.
 
::::::: Continuation of original conversation.
</div>
 
 
=== Link ===
 
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<pre>
 
:::::::::: Last post, indented 10 levels.
 
"<nowiki>{{outdent|10}} xxx</nowiki>"
 
New post
 
</pre>
 
 
displays as
 
 
:::::::::: Last post, indented 10 levels.
 
{{outdent}} xxx
 
New post
 
</div>
 
 
Whereas:
 
 
<div style="border:thin grey solid; padding:8px; margin:4px;">
 
<pre>
 
:::::::::: Last post, indented 10 levels.
 
"<nowiki>{{oudent|10|xxx}} xxx</nowiki>"
 
New post
 
</pre>
 
 
displays as
 
 
:::::::::: Last post, indented 10 levels.
 
{{outdent|10|xxx}} xxx
 
New post
 
 
</div>
 
</div>
  
Line 185: Line 93:
 
This template is contained in the CSS class "outdent-template". Users who would prefer not to see the template can add the following line to their custom CSS ([[Special:MyPage/common.css]]):
 
This template is contained in the CSS class "outdent-template". Users who would prefer not to see the template can add the following line to their custom CSS ([[Special:MyPage/common.css]]):
  
: <code>span.outdent-template { display:none; }</code>
+
<syntaxhighlight lang="css">span.outdent-template { display:none; }</syntaxhighlight>
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
[[Category:Templates documentation]]
 
[[Category:Templates documentation]]

Revision as of 21:49, 10 July 2020

Threading of replies on talk pages is done using indentation and lists. This template is used for outdenting a reply on a talk page when indentation gets too deep.

Usage

Template:Tlc or Template:Tlc. Integer examples: Template:Tlc, Template:Tlc, Template:Tlc. Indentation examples: Template:Tlc, Template:Tlc, Template:Tlc.

Parameters

|1=indent
Supports two modes: literal indentation or an integer. In literal indentation mode the value may contain : (indents), * (unnumbered list), and # (numbered list). It is recommended to copy the colons, asterisks, and hashes from the start of the previous message. An integer value is interpreted as number or indents (:). Magnitude of a negative integer specifies the width of indentation (same as positive integer with |reverse=y). Default value is 10. Supported range is from −40 to 40.
|2=y
Set it to add a link to Wikipedia:Indentation#Outdenting. Template:Tlc produces:
|r=y (aliases |reverse=y, |indent=y, |in=y)
Reverses the outdentation to become indentation and vice versa.

Examples

With indentation wikitext

:::: Previous post, indented with four colons.
{{outdent|::::}} New post.

displays as

Previous post, indented with four colons.
New post.

Positive integer

:::::: Previous post, indented 6 levels.
{{outdent|6}} New post.

displays as

Previous post, indented 6 levels.
New post.

With separate indent

To not outdent all the way to the left margin, indent the Template:Tl template itself using colons:

:::::: Previous post, indented 6 levels.
:: {{outdent|4}} New post.

displays as

Previous post, indented 6 levels.
New post.

Indent

Using |reverse=y:

:::::: Previous post, indented 6 levels.
:: {{outdent|4}} Start of a new post indented 2 levels using a bar of length 6 − 2 = 4.
:: {{outdent|5|reverse=yes}}
::::::: Indent to indentation level 7 using a reversed bar of length 7 − 2 = 5.

displays as

Previous post, indented 6 levels.
Start of a new post indented 2 levels using a bar of length 6 − 2 = 4.
Indent to indentation level 7 using a reversed bar of length 7 − 2 = 5.

Or with a negative integer:

:::::: Original conversation.
:::::: {{outdent|-3}}
::::::::: Afterthought.
::::::: {{outdent|2}}
::::::: Continuation of original conversation.

displays as

Original conversation.
Afterthought.
Continuation of original conversation.

CSS and hide

This template is contained in the CSS class "outdent-template". Users who would prefer not to see the template can add the following line to their custom CSS (Special:MyPage/common.css):

span.outdent-template { display:none; }