Template:Pre/Documentation

From GodWiki
< Template:Pre
Revision as of 14:21, 11 November 2018 by Djonni (talk | contribs) (Fixed link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage

This template supports two parameters:

|width= The width of the pre "box". This can take any of the usual CSS units, but using anything other tham em or % is unwise, as different screens can behave unpredictably with absolute sizes.

|space= The way white space is handled in the pre "box". This can take any of the usual options for white-space in CSS. This will default to the behavour of |space=pre-wrap.

As with <pre> and <code>, {{pre}} displays text in the font specified as the monospace font in the user's browser options, or specified in the user's CSS pages.

Examples

Example 1:

{{Pre|
This Pre-format

can look

like this.
}}

Renders as:

This Pre-format

can look

like this.

Example 2:

{{Pre|width=50%|
'''Long text wrapping:''' all work and no play make jack a dull boy all work and no play make jack a dull boy all work and no play make jack a dull boy all work and no play make jack a dull boy all work and no play make jack a dull boy.
}}

Result:

Long text wrapping: all work and no play make jack a dull boy all work and no play make jack a dull boy all work and no play make jack a dull boy all work and no play make jack a dull boy all work and no play make jack a dull boy.