Template:Indent/doc

From Miranda NG
< Template:Indent
Revision as of 17:53, 15 April 2018 by Goraf (talk | contribs) (Created page with "{{Documentation subpage}} {{Lua|Module:Indent}} The template {{Tc|Indent}} performs a newline and indents by a specified number of spaces. However, the spaces are not all the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is a documentation subpage for Template:Indent .
It contains usage information, categories and other content that is not part of the original template page.

The template {{Indent}} performs a newline and indents by a specified number of spaces. However, the spaces are not all the same size, but rather a mixture of en-size & em-size spaces that have been tested to work on a wide range of browsers. (To skip by Template:Var equal-size spaces, instead use Template:Tl2 which puts all as the standard-size " " space, and does not force a newline.)

Usage

The indentation spacing generated by {{Indent}} will match the alignment of a colon-shift (":") by using Template:Tl2. To match "::", use Template:Tl2.

  • Note: This may vary depending on your browser.

Usage: Template:Tl2

  • Indents up to 30 spaces. (use Template:Tl2 to skip up to 50 spaces)
  • Indent differs from Template:Tl2 only in that it automatically begins a wrapped-newline, then spaces over Template:Var spaces, whereas {{Nbsp}} spaces over Template:Var in the same (current) line.

Analysis of uneven spacing

As computers optimize code, they occasionally risk displaying unsavory results after condensing monotonous strings of characters (such as spaces). Thus, many templates around Wiki choose to avoid this hurdle by alternating different types of spaces (with the intention of displaying no differently than regular spaces).

Spaces come in two main size varieties: em spaces and en spaces. Em spaces are generally defined as the width of one character, and en spaces exactly half that size. However, there is no requirement that browsers must conform to this standard, and so templates that code in en spaces may not display uniformly across all browsers. Neither {{Indent}} nor {{Nbsp}} use true space-size (that is, em-size spaces), but rather mix en and em spaces, whereas Template:Tl2 avoids en spaces altogether and will actually skip Template:Var count of spaces, as if inserting Template:Var repetitions of an em space. This is done by alternating em spaces with an em-size non-breaking "&nbsp;"—by definition, it must be the same—in order to skip a wide area.

See also

  • Module:Indent, the Lua module implementing this template.
  • {{Nbsp}}, which uses non-breaking spaces.
  • {{In5}}, which skips up to fifty equal en-sized spaces.
  • {{Block indent}}, to indent an entire block of content, similar to a block quotation (uses <div> and CSS margins)
  • {{Colon}}, to produce a colon character (":") without risk of affecting wiki markup.