This template implements a version of the functionality provided by the HTML <pre> tag.

Markup Renders as
{{Pre|
This Pre-format

can look

like this.
}}
This Pre-format

can look

like this.

Main differences include:

  • It wraps text that overflows the page.
  • It allows mid-line-breaks (but not always consistently).

Main limitations include:

  • If the text is a single long word, it won't be wrapped and will still break out to the right hand of the page.
  • HTML and wikimarkup aren't disabled as in <pre>...</pre> and are rendered as usual (thus if a parameter contains any wikimarkup, enclose it in <nowiki>...</nowiki>); similarly, multiple spaces are treated as a single one.
  • If there are only two lines, they will be stuck together, even if the source has a blank line between them.

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.

Markup

{{Pre|
'''First line, markup working:''' and HTML comment <!--HIDDEN--> hidden.

'''Second line, 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.

'''Third line with raw | pipe is handled''', but the space before the pipe is lost. Up to raw 19 pipes are handled, else use <nowiki>{{!}}</nowiki> and {{!}} it's {{!}} OK.

'''Fourth      line,     multiple spaces collapsed into one''' as in HTML and wikitext.
'''Fifth line, stuck with the previous one''' if no blank line between them.

'''Last line''', is actually standalone with or without a blank line.
}}
Result
First line, markup working: and HTML comment hidden.

Second line, 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.

Third line with raw| pipe is handled, but the space before the pipe is lost. Up to raw 19 pipes are handled, else use {{!}} and | it's | OK.

Fourth line, multiple spaces collapsed into one as in HTML and wikitext. Fifth line, stuck with the previous one if no blank line between them.

Last line, is actually standalone with or without a blank line.

See also

Bearbeiten

Die semantischen Vorlagen dienen der Kennzeichnung von Text. Der Text wird in spezielle HTML-Tags eingebettet, die die Bedeutung des Inhalts kennzeichnen. Browser, Robots und Werkzeuge für Barrierefreiheit können entsprechend darauf reagieren. Folgende semantische Vorlagen können in Wikivoyage-Artikeln eingesetzt werden:

  • {{em}} Die Vorlage kennzeichnet Text, der besonders betont werden soll. Browser stellen ihn im Regelfall kursiv dar.
  • {{strong}} Dient der starken Hervorhebung von Wörtern und Passagen. Die Darstellung erfolgt standardmäßig in Fettschrift.

In Artikeln außerhalb des Haupt- und Nachrichtennamensraums (Diskusssionen, Projekt- und Hilfeseiten) können weitere Vorlagen Anwendung finden:

  • {{strongbad}} Wie {{strong}} aber rot wie in dem Beispiel: „Benutze {{strongbad}} niemals in Artikeln.“
  • {{stronggood}} Wie {{strongbad}} aber grün wie in dem Beispiel: „Benutze {{stronggood}} nur außerhalb des Artikelnamensraums.“
  • {{var}} Zusammen mit {{varserif}} dient die Vorlage der Kennzeichnung und Visualisierung von Variablen bzw. Platzhaltern in Dokumentationen und Hilfetexten.

Die folgenden Vorlagen stellen lediglich eine Formatierungshilfe dar, erzeugen aber keine speziellen [X]HTML-Tags, um Inhalte maschinenlesbar eine Bedeutung zu geben.

  • {{wikivar}} Stellt Text als Magisches Wort dar und erleichtert damit die Dokumentation und Erstellung von Hilfeseiten. Beispiele: {{PAGENAME}}, {{DEFAULTSORT:Lastname, Firstname}}.
  • {{para}} Dient der Ausgabe von Vorlagenparametern (|title=) oder Parametern mit Werten (|year=2008).
  • {{tlx}} and related For displaying entire templates (with or without parameters and values) as code.
  • {{tag}} – For using HTML elements ("tags") in prose (e.g. "When coding HTML <img>...</img> tags, always include …").
  • {{code}} For computer source code (e.g. "always include the alt= parameter"). (Note: to nest other templates like {{var}} inside, use <code>...</code> instead of {{code}}.)
  • {{syntaxhighlight}} or {{sxhl}} – Wrapper for <syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text.
  • {{pre}} – For larger blocks of source code and other pre-formatted text.
  • {{pre2}}, a template with similar functionality but induces optional line wrap and optional scroll bars.
  • {{bq}} For indented blocks of content, such as block quotations, examples, poems, etc.
  • {{kbd}} For indicating user input.
  • {{key press}} For indicating the input of specific keystrokes, e.g. CtrlX.
  • {{samp}} For example output.
  • <syntaxhighlight>
  • <pre>