Template:Pre/doc

From Valve Developer Community
< Template:Pre
Revision as of 20:23, 19 December 2021 by Popcorn (talk | contribs) (Moved doc here.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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|Links]] work in here, too.
}}
This example defines just the message
in multiple lines.
Links work in here, too.
{{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}}