Difference between revisions of "Template:Outdent/doc"

From Summertime Saga Wiki
Jump to: navigation, search
(Created page with "For outdenting a reply on a talk page when indention gets too deep. Indenting on talk pages is done using colons and asterisks and hashes to produce "tabs"; this template pro...")
 
m
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
For outdenting a reply on a talk page when indention gets too deep.
+
The template {{tlg|outdent}} is used for outdenting 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:
 
:: {{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}}[[#Indent]] below. <code><nowiki>:: {{outdent|reverse=x}}</nowiki></code> produces:
 
:: {{outdent|reverse=x}}
 
  
 
== Usage ==
 
== Usage ==
  
<code><nowiki>{{outdent|optional param1|optional param2|reverse / indent / r / in =|test_line_width =}} </nowiki></code>
+
: {{tlg|code=yes|nolink=yes|outdent|<var>integer</var>}}.
<div style="border:thin grey solid; padding:8px; margin:4px">
+
Integer examples:
{{para|1}}
+
* {{tlg|code=yes|nolink=yes|outdent|5}}
* The number of tabs/indentations to outdent.
+
* {{tlg|code=yes|nolink=yes|outdent|-15}}
* Value may be colons, hashes (count for 2) and asterisks or just values.
+
Indentation examples:
* When using this you may copy the colons, hashes and asterisks from the start of the last message as the first parameter.
+
* {{tlg|code=yes|nolink=yes|outdent|:::::}}
* If the first parameter is not used, the default value of 10 is used.
+
* {{tlg|code=yes|nolink=yes|outdent|*::::::}}
* A value of zero causes the template to return a pipe (|).
+
* {{tlg|code=yes|nolink=yes|outdent|**:::#}}.
* '''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).
+
== Parameter ==
  
The template also recognizes the named parameter "reverse" — see [[#Indent]] below.
+
; {{para|1|<var>indent</var>}} : Supports two modes: literal indentation or an integer. In literal indentation mode the value may contain {{code|:}} (indents), <code>*</code> (unnumbered list), and {{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|:}}). Supported range is from −40 to 40.
  
 
== 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">
 
<pre>:::: This is the previous post, indented 4 levels
 
{{outdent|::::}} Start of a new post</pre>
 
 
 
displays as
 
 
 
:::: This is the previous post, indented 4 levels
 
{{outdent|::::}} Start of a new post
 
</div>
 
 
 
<div style="border:thin grey solid; padding:8px; margin:4px">
 
<pre>:::::: This is the previous post, indented 6 levels
 
{{outdent|6}} Start of a new post</pre>
 
  
displays as
+
{|class=wikitable style="width:100%;"
 +
! style="width:50%;" | Markup
 +
! Renders as
 +
|-
 +
| <pre>:::: Previous post, indented with four colons.
 +
{{outdent|::::}} New post.</pre>
 +
|
 +
:::: Previous post, indented with four colons.
 +
{{outdent|::::}} New post.
 +
|}
  
:::::: This is the previous post, indented 6 levels
+
=== Positive integer ===
{{outdent|6}} Start of a new post
 
</div>
 
  
<div style="border:thin grey solid; padding:8px; margin:4px">
+
{|class=wikitable style="width:100%;"
<pre>Alternatively:
+
! style="width:50%;" | Markup
:::::: This is the previous post, indented 6 levels
+
! Renders as
{{outdent}} Start of a new post. ''(Note that the bar is longer — it is using the default value of 10.)''</pre>
+
|-
 +
| <pre>:::::: Previous post, indented 6 levels.
 +
{{outdent|6}} New post.</pre>
 +
|
 +
:::::: Previous post, indented 6 levels.
 +
{{outdent|6}} New post.
 +
|}
  
displays as
+
=== With separate indent ===
  
:::::: This is the previous post, indented 6 levels
+
To not outdent all the way to the left margin, indent the {{tlg|code=yes|nolink=yes|outdent}} template itself using colons:
{{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):
+
{|class=wikitable style="width:100%;"
 
+
! style="width:50%;" | Markup
<div style="border:thin grey solid; padding:8px; margin:4px">
+
! Renders as
<pre>:::::: This is the previous post, indented 6 levels
+
|-
{{outdent|6|link}} Start of a new post</pre>
+
| <pre>:::::: Previous post, indented 6 levels.
 
+
:: {{outdent|4}} New post.</pre>
displays as
+
|
 
+
:::::: Previous post, indented 6 levels.
:::::: This is the previous post, indented 6 levels
+
:: {{outdent|4}} New post.
{{outdent|6|link}} Start of a new post
+
|}
</div>
 
 
 
To not outdent all the way to the left margin, the outdent template itself can be indented using one or more colons:
 
<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
 
:: {{outdent|4}} Start of a new post
 
</div>
 
 
 
;More examples
 
<div style="border:thin grey solid; padding:8px; margin:4px">
 
<nowiki>{{outdent}} xxx  </nowiki>{{outdent}}xxx<br>
 
</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>
 
  
 
=== Indent ===
 
=== Indent ===
  
<div style="border:thin grey solid; padding:8px; margin:4px">
+
{|class=wikitable style="width:100%;"
<pre>:::::: This is the previous post, indented 6 levels
+
! style="width:50%;" | Markup
:: {{outdent|4}} Start of a new post indented 2 levels using a bar of length 6-2=4.
+
! Renders as
:: {{outdent|5|reverse=yes}}
+
|-
::::::: Indent 7 levels using a reversed bar of length 7-2=5.</pre>
+
| <pre>:::::: Original conversation.
 
+
:::::: {{outdent|-3}}
displays as
 
 
 
:::::: This is the 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 7 levels using a reversed bar of length 7-2=5.
 
</div>
 
 
 
<div style="border:thin grey solid; padding:8px; margin:4px">
 
<pre>
 
:::::: Original conversation.
 
:::::: {{outdent|3|reverse=x}}
 
 
::::::::: Afterthought.
 
::::::::: Afterthought.
 
::::::: {{outdent|2}}
 
::::::: {{outdent|2}}
 
::::::: Continuation of original conversation.</pre>
 
::::::: Continuation of original conversation.</pre>
 
+
|
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>
 
  
 
== CSS and hide ==
 
== 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]]):
+
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 in [[Special:MyPage/common.css]]:
 
 
: <code>span.outdent-template { display: none; }</code>
 
 
 
== See also ==
 
  
* [[wikipedia:Indentation|Wikipedia:Indentation]]
+
<syntaxhighlight lang="css">span.outdent-template { display:none; }</syntaxhighlight>
* [[wikipedia:Talk page guidelines|Wikipedia:Talk page guidelines]]
 
  
[[Category:Documentation subpages]]
+
[[Category:Templates]]
 +
[[Category:Templates documentation]]

Latest revision as of 17:13, 21 July 2020

The template {{outdent}} is used for outdenting a reply on a talk page when indentation gets too deep.

Usage

{{outdent|integer}}.

Integer examples:

  • {{outdent|5}}
  • {{outdent|-15}}

Indentation examples:

  • {{outdent|:::::}}
  • {{outdent|*::::::}}
  • {{outdent|**:::#}}.

Parameter

|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 (:). Supported range is from −40 to 40.

Examples

With indentation wikitext

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

Positive integer

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

With separate indent

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

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

Indent

Markup Renders as
:::::: Original conversation.
:::::: {{outdent|-3}}
::::::::: Afterthought.
::::::: {{outdent|2}}
::::::: Continuation of original conversation.
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 in Special:MyPage/common.css:

span.outdent-template { display:none; }