This site is supported by donations to The OEIS Foundation.

Template:Outdent

From OeisWiki
Jump to: navigation, search


This template should NOT be substituted.


The {{outdent}} (shortcut {{od}}) talk namespace template is used for outdenting a reply on a talk page when indentation 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.

::{{od}} produces:

────────────────────────────────────────────────────────────────────────────────────────────────────

The template also has a named parameter to reverse the direction of the bar to indicate deeper indentation—see #Indent below.

::{{od|reverse=x}} produces:

────────────────────────────────────────────────────────────────────────────────────────────────────

Usage

{{outdent| [optional] param1 | [optional] param2 }}

or

{{od| [optional] param1 | [optional] param2 }}

with optional parameters:

  • param1:
  • If the first parameter is not used, 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 (the sign being ignored).
  • param2:
  • If used, specifies that the string (outdent) is to be placed at the start of the new line's text. The value is ignored.

The template supports up to 20 colons as a parameter, but supports any given integer. Values above 40 may result in the bar appearing over more than one line.

The default number of colons is 10.

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 0 level
{{Outdent|0}} Start of a new post

yields

This is the previous post, indented 0 level |──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

This is the previous post, indented 0 level
{{Outdent|0|whatever}} Start of a new post

yields

This is the previous post, indented 0 level |────────────────────────────────────────────────────────────────────────────────────────────────────(outdent) Start of a new post

:This is the previous post, indented 1 level
{{Outdent|:}} Start of a new post

yields

This is the previous post, indented 1 level

──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

::::This is the previous post, indented 4 levels
{{Outdent|::::}} Start of a new post

yields

This is the previous post, indented 4 levels

──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

::::::This is the previous post, indented 6 levels
{{Outdent|6}} Start of a new post

yields

This is the previous post, indented 6 levels

──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

::::::::::::This is the previous post, indented 12 levels
{{Outdent|12}} Start of a new post

yields

This is the previous post, indented 12 levels

──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

::::::::::::::::::::::::This is the previous post, indented 24 levels
{{Outdent|24}} Start of a new post

yields

This is the previous post, indented 24 levels

──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

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.)''

yields

This is the previous post, indented 6 levels

──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post. (Note that the bar is longer - it is using the default value of 10.)

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

yields

This is the previous post, indented 6 levels

────────────────────────────────────────────────────────────────────────────────────────────────────(outdent) Start of a new post

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

yields

This is the previous post, indented 6 levels
──────────────────────────────────────────────────────────────────────────────────────────────────── Start of a new post

More examples

{{Outdent}}xxx ────────────────────────────────────────────────────────────────────────────────────────────────────xxx

{{outdent|1}}xxx ────────────────────────────────────────────────────────────────────────────────────────────────────xxx

{{od|2}}xxx ────────────────────────────────────────────────────────────────────────────────────────────────────xxx

{{od|6}}xxx ────────────────────────────────────────────────────────────────────────────────────────────────────xxx

{{od|1|anything}}xxx────────────────────────────────────────────────────────────────────────────────────────────────────(outdent) xxx
{{od|6|xxx}}xxx ────────────────────────────────────────────────────────────────────────────────────────────────────(outdent) xxx

Indent

The named parameter reverse 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 indentation. For example:

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

yields

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.
::::::{{od|3|reverse=x}} 
:::::::::Afterthought. 
:::::::{{od|2}}
:::::::Continuation of original conversation.

yields

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; }

Errors and unexpected behaviours

  • param1 > 40 places the bar over several lines:
{{od|99}}xxx────────────────────────────────────────────────────────────────────────────────────────────────────xxx
  • param1 < 0 ignores the sign:
{{od|-4}}xxx────────────────────────────────────────────────────────────────────────────────────────────────────xxx
{{od|+4}}xxx────────────────────────────────────────────────────────────────────────────────────────────────────xxx

Other formats

::{{od}}xxx yields:

────────────────────────────────────────────────────────────────────────────────────────────────────xxx

::{{od|10|xxx}}xxx yields:

────────────────────────────────────────────────────────────────────────────────────────────────────(outdent) xxx────────────────────────────────────────────────────────────────────────────────────────────────────