Changes

Jump to: navigation, search

Template:Outdent/Documentation

6,004 bytes added, 04:08, 14 July 2017
For outdenting a reply on a talk page when indention gets too deep.

Indenting on talk pages is done using a colon character (:) 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. "<nowiki>::{{Outdent}}</nowiki>" produces:
::{{Outdent}}

The template also has a named parameter to reverse the direction of the bar to indicate deeper indentation- see [[#Indent]] below. "<nowiki>::{{Outdent|reverse=x}}</nowiki>" produces:
::{{Outdent|reverse=x}}

== Usage ==
'''<nowiki>{{ Outdent / outdent / od | optional param1 | optional param2 }} </nowiki>'''
:<tt><i>param1</i></tt>:
:*If the first parameter is not used, or for "<tt>reverse=</tt>" and "<tt>reverse=0</tt>", the left margin is reset to the position of the template, and the default value of 10 is used for the length of the bar.
:*If used, its value specifies the length of the connector bar to be used. The value may be specified as a string of tab characters, or as an integer.
:<tt><i>param2</i></tt>:
:*If used, specifies that the string "([[Wikipedia:Indentation#Outdenting|outdent]])" is to be placed at the start of the new line's text.

The template supports up to 20 colons as a parameter, but supports any given integer. Values above 40 result in the template using the default value of 10.

The default number of colons is 10.

The template also recognizes the named parameter <tt>reverse</tt> — see [[#Indent]] below.

===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.

<div style="border:thin blue 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 blue solid; padding:8px; margin:4px">
<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
{{Outdent|6}} Start of a new post
</div>

<div style="border:thin blue solid; padding:8px; margin:4px">
<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

::::::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 blue 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>

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 blue 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 blue solid; padding:8px; margin:4px">
<nowiki>{{Outdent}}xxx </nowiki>{{Outdent}}xxx<br>
</div>
<div style="border:thin blue solid; padding:8px; margin:4px">
<nowiki>{{outdent|1}}xxx </nowiki>{{outdent|1}}xxx<br>
</div>
<div style="border:thin blue solid; padding:8px; margin:4px">
<nowiki>{{Outdent|2}}xxx </nowiki>{{Outdent|2}}xxx
</div>
<div style="border:thin blue solid; padding:8px; margin:4px">
<nowiki>{{Outdent|6}}xxx </nowiki>{{Outdent|6}}xxx
</div>
<div style="border:thin blue solid; padding:8px; margin:4px">
:::<nowiki>{{Outdent|1|anything}}xxx</nowiki>{{Outdent|1|anything}}xxx
</div>
<div style="border:thin blue solid; padding:8px; margin:4px">
:::<nowiki>{{Outdent|6|xxx}}xxx </nowiki>{{Outdent|6|xxx}}xxx
</div>

=== Indent ===
The named parameter <tt>reverse</tt> can be set so: <nowiki>{{</nowiki>Outdent|reverse=''string''}} 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. For example:

<div style="border:thin blue solid; padding:8px; margin:4px">
<pre>::::::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.</pre>

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 blue solid; padding:8px; margin:4px">
<pre>
::::::Original conversation.
::::::{{Outdent|3|reverse=x}}
:::::::::Afterthought.
:::::::{{Outdent|2}}
:::::::Continuation of original conversation.</pre>

displays as

::::::Original conversation.
::::::{{Outdent|3|reverse=x}}
:::::::::Afterthought.
:::::::{{Outdent|2}}
:::::::Continuation of original conversation.</pre>
</div>

=== 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]]):

:<code>span.outdent-template { display: none; }</code>

== See also ==
* [[Wikipedia:Indent]]

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Talk namespace templates]]
}}</includeonly>
3,376
edits

Navigation menu