From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages.

As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.

Displays a block element with for use with the following child templates: {{CodeBox}}, {{FileBox}}, and {{KernelBox}}.

The contents may contain special characters (| or =) that break the MediaWiki templating system. The following options are available to put the contents should the need arise to escape these characters:
  1. {{PreBox|1=contents}}
  2. {{PreBox|1=<nowiki>contents</nowiki>}}
  3. {{PreBox|1=<pre>contents</pre>}}

Known problems

Example Wiki code How it looks Possible solution
<pre> inside boxes will render '"`UNIQ--pre-000000XX-QINU`"' {{#tag:syntaxhighlight|<pre>echo "Hello, world!"</pre>|lang=bash}}
Don't use <pre> tags.
<source> inside boxes will render '"`UNIQ--source-000000XX-QINU`"'
{{#tag:syntaxhighlight|<source type="git">bla-bla</source>|lang=xml}}
If meant to be used in XML, then use <<nowiki />source>, otherwise the source tag is deprecated
if <> symbols inside boxes and <nowiki> is used than <> will be replaced with &lt &gt
{{#tag:syntaxhighlight|<nowiki ><></nowiki>|lang=text}}
Don't use lang parameter. Or don't use <nowiki> and replace all | with {{!}}


Parameter name Required? Default value Description
Anonymous parameter 1 Yes (n/a) Kernel configuration.
title No (n/a) Display's a title in the box header.


See the template's testcases:

Unnamed parameter with value foo
Wiki code {{PreBox|foo}}

Main version
Sandbox version

Named parameter title
Wiki code {{PreBox|title=bar|foo}}

Main version
Sandbox version

See also