Template:Pre/Doc
Summary
Displays a <cleanspace>
{{#define:1|tag}}
{{#local:2|pair|if=0}}
{{#define:content|}}
{{#local:params| {{{params}}}|if=}}
{{#local:opentag|<pre>}}
{{#local:content||if=1}}
{{#local:closetag|}}
</cleanspace> box but with wrapped or scrollable text. It also allows the box to contain formatting, to auto-size, or to be moved around the page (indentation, centering, etc.).
Adapted from Wikipedia template Pre2.
Parameters
Pre | ||
---|---|---|
Parameter | Scope | Description
{{#splitargs:Parameters/Line|3}} |
Examples
Long Text
<pre style="width:; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; ">{{Pre|Your really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long text here.}} <pre style="width:; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; ">Your really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long text here.
Long Text with Scrolling
<pre style="width:; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; ">{{Pre|Your really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long text here.|scroll=yes}} <pre style="width:; overflow:auto; ">Your really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long text here.
Autosized to Short Text
{{Pre|Your<br>text here.|width=auto}}
<pre style="display:inline-block; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; ">Your
text here.
Nowiki Variations
Parameter
{{Pre|Your wiki<br>text here.|nowiki=yes}}
<pre style="width:; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; ">Your wiki<br>text here.
Parameter Fails
{{Pre|{{example}}|nowiki=yes}}
<pre style="width:; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; "> :This is an example of a template. ''' ''' '' ''
Nowiki Tags
{{Pre|<nowiki>{{example}}</nowiki>}}
<pre style="width:; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; ">{{example}}