Sjabloon:Indent: verschil tussen versies

Uit informatiestandaarden
Ga naar: navigatie, zoeken
(Nieuwe pagina aangemaakt met '{{Documentation subpage}}{{confusing}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> The indenter Template:indent performs a newline ...')
 
(Tekst vervangen door "{{#invoke:Indent|indent|1={{{1|}}}|2={{{2|}}}}}<noinclude> {{documentation}} </noinclude>")
 
Regel 1: Regel 1:
{{Documentation subpage}}{{confusing}}
+
{{#invoke:Indent|indent|1={{{1|}}}|2={{{2|}}}}}<noinclude>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
The indenter [[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 (typography)|en]]-size & [[em]]-size spaces that have been tested to work on a wide range of browsers.  (To skip by ''n'' equal-size spaces, instead use {{tl2|in5|''n''}} which puts all as the standard-size " " space.)
 
__TOC__
 
  
=== Usage ===
+
{{documentation}}
The indentation spacing generated by [[Template:indent]] will match the alignment of a colon-shift (":") by using {{tl2|indent|5}}, or to match "::" then align by {{tl2|indent|10}}.
+
</noinclude>
 
 
'''Usage:''' <nowiki>{{</nowiki>indent|''# of spaces''}}
 
* Indents up to 30 spaces. (use {{tl2|in5|n}} to skip up to 50 spaces)
 
* Indent differs from {{tl|space}} only in that it automatically begins a wrapped-newline, then spaces over ''n'' spaces, whereas {{tl|space}} spaces over ''n'' in the same (current) line.
 
 
 
==Examples==
 
The following are detailed examples, also comparing to the equivalent indentation generated if a colon-shift ":" were used instead.
 
 
 
'''Example 1 - ''Indenting by 5:'''''
 
<br>Some text.<nowiki>{{</nowiki>indent|5}}Some more text.
 
 
 
<br>'''''Results:'''''<br>
 
Some text.{{indent|5}}Some more text.
 
<br><br>
 
 
 
'''Example 2 - ''Alignment with ":" or "::" indentations:'''''
 
<br><nowiki>:</nowiki> Line of colon-shifted text.<br>
 
<nowiki>{{</nowiki>indent|5}}Line of indent-5-shifted text.<br>
 
&lt;br>&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Line of br-6-nbsp-shifted text.<br>
 
&lt;br>&amp;nbsp; &amp;nbsp; &amp;nbsp;Line of br-5-nbsp-shifted text.<br>
 
&lt;br>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Line of br-5-nbsp-true-shifted text.<br>
 
<nowiki>::</nowiki> Line of 2-colon-shifted text.<br>
 
<nowiki>{{</nowiki>space|10}}Line of space-10-shifted text.<br>
 
 
 
'''''Results:'''''
 
: Line of colon-shifted text.
 
{{indent|5}}Line of indent-5-shifted text.
 
<br>&nbsp; &nbsp; &nbsp;&nbsp;Line of br-6-nbsp-shifted text.
 
<br>&nbsp; &nbsp; &nbsp;Line of br-5-nbsp-shifted text.
 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line of br-5-nbsp-true-shifted text.
 
:: Line of 2-colon-shifted text.
 
{{space|10}}Line of space-10-shifted text.
 
 
 
Note that if the prior line is already colon-shifted text, then using "{{tl2|indent|5}}" generates a blank line first, so instead, use "{{tl2|space|5}}" (or such) after a colon-shifted line.
 
 
 
==Analysis of uneven spacing==
 
{{clarify span|date=November 2012|The non-breaking "&amp;nbsp;" is exactly the same size as a space (by definition, it must be the same), so it can be alternated with spaces to skip a wider area}}. Notice that neither {{tl|indent}} nor {{tl|space}} use true space-size, but rather mix en+em spaces, whereas "{{tl2|in5|n}}" will actually skip ''n'' count of spaces, as if inserting ''n'' repetitions of an "&amp;nbsp;" space.
 
 
 
==History==
 
This template originated on the [[Wikipedia:Sister projects|sister project]] '''[[Wikisource]]'''&mdash;[http://wikisource.org/wiki/Main_Page (home page)]
 
:&mdash;and was subsequently ported to English Wikipedia at 21:27, 26 May 2006 (UTC).
 
 
 
==See also==
 
* [[Module:Indent]], the Lua module this template is based on.
 
* {{tl|space}} - skips similar spacing mix of en-size & em-size spaces.
 
* {{tl|spaces}} - uses non-breaking spaces.
 
* {{tl|in5}} - skips up to 50 equal-size spaces as all en-size spaces.
 
 
 
<includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
[[Category:Typing-aid templates|Indent]]
 
[[Category:Wikipedia formatting and function templates|Indent]]
 
</includeonly>
 
 
 
<includeonly>
 
[[sl:Predloga:Zamik]]
 
</includeonly>
 

Huidige versie van 17 jul 2013 om 11:00

{{#invoke:Indent|indent|1=|2=}}

[bewerken] [purge] Template documentation

Sjabloon:Confusing The indenter 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 n equal-size spaces, instead use {{in5|n}} which puts all as the standard-size " " space.)

Usage

The indentation spacing generated by Template:indent will match the alignment of a colon-shift (":") by using {{indent|5}}, or to match "::" then align by {{indent|10}}.

Usage: {{indent|# of spaces}}

  • Indents up to 30 spaces. (use {{in5|n}} to skip up to 50 spaces)
  • Indent differs from {{space}} only in that it automatically begins a wrapped-newline, then spaces over n spaces, whereas {{space}} spaces over n in the same (current) line.

Examples

The following are detailed examples, also comparing to the equivalent indentation generated if a colon-shift ":" were used instead.

Example 1 - Indenting by 5:
Some text.{{indent|5}}Some more text.


Results:
Some text.{{#invoke:Indent|indent|1=5|2=}}Some more text.

Example 2 - Alignment with ":" or "::" indentations:
: Line of colon-shifted text.
{{indent|5}}Line of indent-5-shifted text.
<br>&nbsp; &nbsp; &nbsp;&nbsp;Line of br-6-nbsp-shifted text.
<br>&nbsp; &nbsp; &nbsp;Line of br-5-nbsp-shifted text.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line of br-5-nbsp-true-shifted text.
:: Line of 2-colon-shifted text.
{{space|10}}Line of space-10-shifted text.

Results:

Line of colon-shifted text.

{{#invoke:Indent|indent|1=5|2=}}Line of indent-5-shifted text.
      Line of br-6-nbsp-shifted text.
     Line of br-5-nbsp-shifted text.
     Line of br-5-nbsp-true-shifted text.

Line of 2-colon-shifted text.

{{#invoke:String|rep| |10}}Line of space-10-shifted text.

Note that if the prior line is already colon-shifted text, then using "{{indent|5}}" generates a blank line first, so instead, use "{{space|5}}" (or such) after a colon-shifted line.

Analysis of uneven spacing

Sjabloon:Clarify span. Notice that neither {{indent}} nor {{space}} use true space-size, but rather mix en+em spaces, whereas "{{in5|n}}" will actually skip n count of spaces, as if inserting n repetitions of an "&nbsp;" space.

History

This template originated on the sister project Wikisource(home page)

—and was subsequently ported to English Wikipedia at 21:27, 26 May 2006 (UTC).

See also

  • Module:Indent, the Lua module this template is based on.
  • {{space}} - skips similar spacing mix of en-size & em-size spaces.
  • {{spaces}} - uses non-breaking spaces.
  • {{in5}} - skips up to 50 equal-size spaces as all en-size spaces.


sl:Predloga:Zamik