Difference between revisions of "Template:Outdent/doc"
m |
m |
||
Line 10: | Line 10: | ||
: <code><nowiki>{{outdent|optional param1|optional param2|reverse / indent / r / in =|test_line_width =}} </nowiki></code> | : <code><nowiki>{{outdent|optional param1|optional param2|reverse / indent / r / in =|test_line_width =}} </nowiki></code> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
{{para|1}} | {{para|1}} | ||
* The number of tabs/indentations to outdent. | * The number of tabs/indentations to outdent. | ||
* Value may be colons, hashes (count for 2) and asterisks or just values. | * Value may be colons, hashes (count for 2) and asterisks or just values. | ||
− | * When using this you may copy the colons, hashes and asterisks from the start of the last message as the first parameter. | + | * When using this you may copy the colons, hashes and asterisks from the start of the last message as the first parameter. |
* If the first parameter is not used, the default value of 10 is used. | * If the first parameter is not used, the default value of 10 is used. | ||
* A value of zero causes the template to return a pipe (|). | * A value of zero causes the template to return a pipe (|). | ||
* '''Recommended''' | * '''Recommended''' | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
{{para|2}} | {{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. | * 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. | * Can be any value. | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
− | {{para|reverse}} ({{para|indent}}, {{para|r}}, {{para|in}}) | + | {{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 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. | * Can be any value. | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
{{para|test_line_width}} | {{para|test_line_width}} | ||
* Set to any string to test the line creating and reduction functions in the module. | * Set to any string to test the line creating and reduction functions in the module. | ||
Line 41: | Line 41: | ||
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. | 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 grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre>:::: This is the previous post, indented 4 levels | <pre>:::: This is the previous post, indented 4 levels | ||
{{outdent|::::}} Start of a new post</pre> | {{outdent|::::}} Start of a new post</pre> | ||
Line 51: | Line 51: | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre>:::::: This is the previous post, indented 6 levels | <pre>:::::: This is the previous post, indented 6 levels | ||
{{outdent|6}} Start of a new post</pre> | {{outdent|6}} Start of a new post</pre> | ||
Line 61: | Line 61: | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre>Alternatively: | <pre>Alternatively: | ||
:::::: This is the previous post, indented 6 levels | :::::: This is the previous post, indented 6 levels | ||
Line 74: | Line 74: | ||
You can also have the template automatically add a linked tag, by adding any second parameter (its specific value is discarded): | 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"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre>:::::: This is the previous post, indented 6 levels | <pre>:::::: This is the previous post, indented 6 levels | ||
{{outdent|6|link}} Start of a new post</pre> | {{outdent|6|link}} Start of a new post</pre> | ||
Line 85: | Line 85: | ||
To not outdent all the way to the left margin, the outdent template itself can be indented using one or more colons: | 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"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre>:::::: This is the previous post, indented 6 levels | <pre>:::::: This is the previous post, indented 6 levels | ||
:: {{outdent|4}} Start of a new post</pre> | :: {{outdent|4}} Start of a new post</pre> | ||
Line 96: | Line 96: | ||
=== More examples === | === More examples === | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | |
+ | <div style="border:thin grey solid; padding:8px; margin:4px;"> | ||
<nowiki>{{outdent}} xxx </nowiki>{{outdent}}xxx<br> | <nowiki>{{outdent}} xxx </nowiki>{{outdent}}xxx<br> | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<nowiki>{{outdent|1}} xxx </nowiki>{{outdent|1}} xxx<br> | <nowiki>{{outdent|1}} xxx </nowiki>{{outdent|1}} xxx<br> | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<nowiki>{{outdent|2}} xxx </nowiki>{{outdent|2}} xxx | <nowiki>{{outdent|2}} xxx </nowiki>{{outdent|2}} xxx | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<nowiki>{{outdent|6}} xxx </nowiki>{{outdent|6}} xxx | <nowiki>{{outdent|6}} xxx </nowiki>{{outdent|6}} xxx | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
::: <nowiki>{{outdent|1|anything}} xxx</nowiki>{{outdent|1|anything}} xxx | ::: <nowiki>{{outdent|1|anything}} xxx</nowiki>{{outdent|1|anything}} xxx | ||
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
::: <nowiki>{{outdent|6|xxx}} xxx </nowiki>{{outdent|6|xxx}} xxx | ::: <nowiki>{{outdent|6|xxx}} xxx </nowiki>{{outdent|6|xxx}} xxx | ||
</div> | </div> | ||
Line 117: | Line 118: | ||
=== Indent === | === Indent === | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre>:::::: This is the previous post, indented 6 levels | <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|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 7 levels using a reversed bar of length 7 - 2 = 5.</pre> |
displays as | displays as | ||
:::::: This is the previous post, indented 6 levels | :::::: 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|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 7 levels using a reversed bar of length 7 - 2 = 5. |
</div> | </div> | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre> | <pre> | ||
:::::: Original conversation. | :::::: Original conversation. | ||
Line 150: | Line 151: | ||
=== Link === | === Link === | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre> | <pre> | ||
:::::::::: Last post, indented 10 levels. | :::::::::: Last post, indented 10 levels. | ||
Line 166: | Line 167: | ||
Whereas: | Whereas: | ||
− | <div style="border:thin grey solid; padding:8px; margin:4px"> | + | <div style="border:thin grey solid; padding:8px; margin:4px;"> |
<pre> | <pre> | ||
:::::::::: Last post, indented 10 levels. | :::::::::: Last post, indented 10 levels. | ||
Line 185: | Line 186: | ||
: <code>span.outdent-template { display: none; }</code> | : <code>span.outdent-template { display: none; }</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Templates]] | [[Category:Templates]] | ||
[[Category:Templates documentation]] | [[Category:Templates documentation]] |
Revision as of 21:27, 10 July 2020
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 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. :: {{outdent}}
produces:
The template also has a named parameter to reverse the direction of the bar to indicate deeper indentation- see § Indent below. :: {{outdent|reverse=x}}
produces:
Usage
{{outdent|optional param1|optional param2|reverse / indent / r / in =|test_line_width =}}
|1=
- The number of tabs/indentations to outdent.
- Value may be colons, hashes (count for 2) and asterisks or just values.
- When using this you may copy the colons, hashes and asterisks from the start of the last message as the first parameter.
- If the first parameter is not used, the default value of 10 is used.
- A value of zero causes the template to return a pipe (|).
- Recommended
|2=
- If used, specifies that the string (outdent) is to be placed at the start of the new line's text.
- Can be any value.
|reverse=
(|indent=
, |r=
, |in=
)
- Can be set so:
{{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. See examples below. - Can be any value.
|test_line_width=
- Set to any string to test the line creating and reduction functions in the module.
- Not recommended
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 § 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.
:::: This is the previous post, indented 4 levels {{outdent|::::}} Start of a new post
displays as
- This is the previous post, indented 4 levels
:::::: This is the previous post, indented 6 levels {{outdent|6}} Start of a new post
displays as
- This is the previous post, indented 6 levels
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.)''
displays as
- This is the previous post, indented 6 levels
You can also have the template automatically add a linked tag, by adding any second parameter (its specific value is discarded):
:::::: This is the previous post, indented 6 levels {{outdent|6|link}} Start of a new post
displays as
- This is the previous post, indented 6 levels
To not outdent all the way to the left margin, the outdent template itself can be indented using one or more colons:
:::::: This is the previous post, indented 6 levels :: {{outdent|4}} Start of a new post
displays as
- This is the previous post, indented 6 levels
- Start of a new post
More examples
- {{outdent|1|anything}} xxxxxx
- {{outdent|1|anything}} xxx
- {{outdent|6|xxx}} xxx xxx
- {{outdent|6|xxx}} xxx
Indent
:::::: 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.
displays as
- This is the previous post, indented 6 levels
- Start of a new post indented 2 levels using a bar of length 6 - 2 = 4.
- Indent 7 levels using a reversed bar of length 7 - 2 = 5.
:::::: Original conversation. :::::: {{outdent|3|reverse=x}} ::::::::: Afterthought. ::::::: {{outdent|2}} ::::::: Continuation of original conversation.
displays as
- Original conversation.
- Afterthought.
- Continuation of original conversation.
Link
:::::::::: Last post, indented 10 levels. "{{outdent|10}} xxx" New post
displays as
- Last post, indented 10 levels.
New post
Whereas:
:::::::::: Last post, indented 10 levels. "{{oudent|10|xxx}} xxx" New post
displays as
- Last post, indented 10 levels.
New post
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; }