More actions
Created page with "<pre<includeonly></includeonly> style="{{#if:{{{background|}}}|background:{{{background|}}};}}{{#if:{{{color|}}}|color:{{{color|}}};}}{{#if:{{{width|}}}|width:{{{width|}}};}}white-space:{{#switch:{{lc:{{{space|}}}}} |normal|pre|pre-line|break-spaces|inherit|initial|unset={{lc:{{{space|}}}}}|pre-wrap||#default=pre-wrap }}"><!-- -->{{#if:{{{1|}}}|{{{1}}}<noinclude>|Sample text on several lines</noinclude>}}<!-- -->{{#if:{{{2|}}}|{{!}}{{{2}}}|}}<!-- -->{{#if:{{{3|}}}|{{!}}{..." |
No edit summary |
||
Line 1: | Line 1: | ||
<pre<includeonly></includeonly> | <templatestyles src="Pre/styles.css"/><pre<includeonly></includeonly> class="pre {{#ifeq:{{{border|}}}|no|pre-borderless}}" {{#if:{{{space|}}}{{{width|}}}{{{style|}}}|style="{{#if:{{{space|}}}|white-space: {{{space}}};}} {{#if:{{{width|}}}|width: {{{width}}};}} {{{style|}}}"}}><!-- | ||
| | -->{{#if:{{{1|}}}|{{{1}}}<noinclude>|Sample text</noinclude>}}<!-- | ||
}}"><!-- | -->{{#if:{{{2|}}}|{{!}}{{{2}}}}}<!-- | ||
-->{{#if:{{{1|}}}|{{{1}}}<noinclude>|Sample text | -->{{#if:{{{3|}}}|{{!}}{{{3}}}}}<!-- | ||
-->{{#if:{{{4|}}}|{{!}}{{{4}}}}}<!-- | |||
-->{{#if:{{{2|}}}|{{!}}{{{2}}} | -->{{#if:{{{5|}}}|{{!}}{{{5}}}}}<!-- | ||
-->{{#if:{{{3|}}}|{{!}}{{{3}}} | -->{{#if:{{{6|}}}|{{!}}{{{6}}}}}<!-- | ||
-->{{#if:{{{4|}}}|{{!}}{{{4}}} | -->{{#if:{{{7|}}}|{{!}}{{{7}}}}}<!-- | ||
-->{{#if:{{{5|}}}|{{!}}{{{5}}} | -->{{#if:{{{8|}}}|{{!}}{{{8}}}}}<!-- | ||
-->{{#if:{{{6|}}}|{{!}}{{{6}}} | -->{{#if:{{{9|}}}|{{!}}{{{9}}}}}<!-- | ||
-->{{#if:{{{7|}}}|{{!}}{{{7}}} | -->{{#if:{{{10|}}}|{{!}}{{{10}}}}}<!-- | ||
-->{{#if:{{{8|}}}|{{!}}{{{8}}} | -->{{#if:{{{11|}}}|{{!}}{{{11}}}}}<!-- | ||
-->{{#if:{{{9|}}}|{{!}}{{{9}}} | -->{{#if:{{{12|}}}|{{!}}{{{12}}}}}<!-- | ||
-->{{#if:{{{10|}}}|{{!}}{{{10}}} | -->{{#if:{{{13|}}}|{{!}}{{{13}}}}}<!-- | ||
-->{{#if:{{{11|}}}|{{!}}{{{11}}} | -->{{#if:{{{14|}}}|{{!}}{{{14}}}}}<!-- | ||
-->{{#if:{{{12|}}}|{{!}}{{{12}}} | -->{{#if:{{{15|}}}|{{!}}{{{15}}}}}<!-- | ||
-->{{#if:{{{13|}}}|{{!}}{{{13}}} | -->{{#if:{{{16|}}}|{{!}}{{{16}}}}}<!-- | ||
-->{{#if:{{{14|}}}|{{!}}{{{14}}} | -->{{#if:{{{17|}}}|{{!}}{{{17}}}}}<!-- | ||
-->{{#if:{{{15|}}}|{{!}}{{{15}}} | -->{{#if:{{{18|}}}|{{!}}{{{18}}}}}<!-- | ||
-->{{#if:{{{16|}}}|{{!}}{{{16}}} | -->{{#if:{{{19|}}}|{{!}}{{{19}}}}}<!-- | ||
-->{{#if:{{{17|}}}|{{!}}{{{17}}} | -->{{#if:{{{20|}}}|{{!}}{{{20}}}}}<!-- | ||
-->{{#if:{{{18|}}}|{{!}}{{{18}}} | |||
-->{{#if:{{{19|}}}|{{!}}{{{19}}}|}}<!-- | |||
--></pre><noinclude> | --></pre><noinclude> | ||
{{Documentation}} | {{Documentation}} |
Revision as of 03:25, 21 February 2025
Page Pre/styles.css has no content.
Sample text
Usage
{{Pre|1= |background= |color= |width= |space= }}
All parameters are optional:
|1=
– the text to present (may include markup and templates to expand; note that automatic syntax highlighting is not supported; the default text is empty).|background= |color=
– set alternate colors (in CSS format) to use for distinguishing status of the rendered code: bad, non-working, obsolete, deprecated, unsupported, discouraged, simplified, incomplete, tricky, detailed, supported, recommended, advanced, optional, mandatory, current, future, proposal, untested, beta, approved, rejected, dangerous, problematic, temporary, workaround, alternative, etc.; for passing CSS colors using a compact numeric format starting with a sharp sign#
followed by hexadecimal digits (3 or 6 digits for RGB colors, 4 or 8 digits for RGBA colors), you may need to escape it by a leading<nowiki/>
empty tag, so that it won't be interpreted by MediaWiki as a numbered list item when it preprocesses parameters given to the template, or use a template generating the color syntax.|width=
– CSS width for the generated<pre></pre>
parent element (useful in table cells).|space=
– one of the values accepted for the CSSwhite-space:
attribute (pre-wrap
by default to preserve newlines in the text given in 1st parameter but still allow wrapping overlong lines, without overflowing the width or using an horizontal scrollbar)