Jump to content
šŸ—³ļøšŸ–„ļø The Wikimedia Foundation December 2024 Developer Satisfaction Survey closes on the 2025-01-03. This survey helps us measure developer satisfaction, and prioritize work on tools and platforms for our technical contributors.

Template:Pre

From wikiNonStop
Revision as of 06:56, 27 December 2024 by Majestix (talk | contribs) (1 revision imported: Initial )
(diff) ā† Older revision | Latest revision (diff) | Newer revision ā†’ (diff)
Sample text
on several lines
Template documentation


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 CSS white-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)