Modèle:Pre2

De Wiki Electrolab
Révision datée du 1 mai 2023 à 13:22 par Electrolab (discussion | contributions) (Page créée avec « <pre<includeonly></includeonly> style="{{#ifeq:{{{1}}}|scroll|overflow:auto; white-space:pre; width:auto;{{{style|}}}">{{#switch:{{{2}}}|nowiki|nw={{#tag:nowiki|{{{3}}}}}|{{{2}}}}}|white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;{{{style|}}}">{{#switch:{{{1}}}|nowiki|nw={{#tag:nowiki|{{{2}}}}}|{{{1}}}}} }}</pre><noinclude> {{/doc}}</noinclude> »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
{{{1}}}
Template documentation[view][edit][history][purge]
This documentation is transcluded from Modèle:Pre2/doc. Changes can be proposed in the talk page.

{{Pre2}}} uses Wikipedia-logo-v2.svg HTML_element#Other_containers tags, but with text that is either Wikipedia-logo-v2.svg wrap word wrap or is contained in a horizontal scrollbox. This means the text will not stretch past the right side of the screen.

As it uses real <pre> tags (unlike {{pre}}), it will be displayed correctly regardless of how the user's Wikipedia Wikipedia-logo-v2.svg skin renders <pre> boxes.

If you want to disable Wikipedia-logo-v2.svg wikitext in it, you should use <nowiki> tags inside the template (see below).

Usage

Wrapped text

{{Pre2|Text to be displayed. And more and more and more... and a paragraph break.

And then more and more...}}

produces:
Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.

And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.

Scrollbox

{{Pre2|scroll|Text to be displayed. And more and more and more... and a paragraph break.

And then more and more...}}

produces:
Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.

And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.

Style

When the text contains links is better to change the text color, thus highlighting:

{{Pre2|style=color:green|Text to be [[Hyperlink|link]]. WARNING! A{{=}}B, you must use Template:=. And more and more and more... and a paragraph break.

And then more and more...}}

produces:
Text to be link. WARNING! A=B, you must use Template:=. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.


Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.