Template:Pre

From Valve Developer Community
Jump to: navigation, search
English (en)
... Icon-Important.png
Curly brackets white.pngTemplate Documentation
Icon-translate.png
View
Edit
Page history

This is supposed to be <pre>{{{1}}}<pre> but dark by default and with more options.

The crucial difference between <pre> and this template: The verbatim of this template affects whitespace but not wikitext (how could it?), so this template can be used for code from games as well as for links (!) but not for plain wikitext. To get the "full" verbatim, you must use <pre> directly (which this template should actually make simpler but it cannnot):

<pre style="background:#444; border-color:#666; color:#ddd">[...]</pre>, which renders as follows:

[...]

Usage

Parameters

  • {{{1}}} - The text inside the box.
  • {{{bgcolor}}} - The background color.
  • {{{bdcolor}}} - The border color.
  • {{{txtcolor}}} - The text color.
  • {{{style}}} - Can be used to add or override any style parameters of the <pre> that this templates uses.
Note.pngNote:Examples for colors formats are #FFF, #FFFFFF and white. See Wiki:Help:Using colors.

Examples

Wikitext Result
{{pre|
This example defines just the message
in multiple lines.
[[Main Page|Wikilinks]] and [https://www.wikipedia.org/ external links] work in here, too.
For template calls, the pipe {{!}} and the equals sign {{=}} must be "escaped".
Template transclusions like {{source}} will be resolved.
Template transclusions like {{source{{!}}4}} will NOT be resolved!
}}
This example defines just the message
in multiple lines.
Wikilinks and external links work in here, too.
For template transclusions, the pipe | and the equals sign = must be "escaped".
Template transclusions like Source will be resolved.
Template transclusions like {{source|4}} will NOT be resolved!
{{pre|bgcolor=#123456|bdcolor=#ABC|txtcolor=yellow|In this example the bgcolor is #123456, bdcolor is #ABC and txtcolor is yellow.}}
In this example the bgcolor is #123456, bdcolor is #ABC and txtcolor is yellow.

Comparison

This is the default box. This is produced by adding one space to the beginning of this line.
This is the result when using just the <pre> HTML tag with no style.

See also

  • {{Pre}}
  • {{Code}}
  • {{Kbd}}
  • {{Mono}}
  • {{Samp}}
  • {{Var}}