Template:Pre: Difference between revisions
More actions
Deleted deprecated notice since it seemed irrelevant. From what I see, (1) MediaWiki does not break words in a <pre> tag and (2) this template is meant to facilitate scrolling, not breaking. |
Replaced documentation text with a documentation subpage. |
||
| Line 1: | Line 1: | ||
<pre | <pre style="overflow: auto;{{{style|}}}">{{{1}}}</pre><noinclude> | ||
{{Documentation}} | |||
</noinclude> | </noinclude> | ||
Revision as of 09:41, 12 May 2012
{{{1}}}
This template acts similar to <pre> tags but the text does not run off screen; instead, a local scrollbar appears.
Usage
{{Pre |1= }}
Template parameters
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
This template acts similar to <pre> tags but the text does not run off screen; instead, a local scrollbar appears.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| text | 1 | Text contents to intended to be displayed | Content | required |
| CSS classes | class | Additional CSS classes to be applied to the text | Line | optional |
| CSS styles | style | Additional CSS styles to be applied to the text | Line | optional |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Localization
This template is not intended to be localized.
Examples
This code:
- {{Pre|Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. ...
- At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. ...}}
renders as:
{{{1}}}
This code:
- {{Pre
- |style=margin-left: 200px;
- |Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. ...
- At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. ...}}
renders as:
{{{1}}}