This is a documentation subpage for Vorlage:Code. It contains usage information, categories and other content that is not part of the original vorlage page. |
Description[Quelltext bearbeiten]
This is a combination of the templates {{code}} and {{pre2}}. It allows for code coloring depending on programming language conventions (like {{code}}) and inherits {{pre2}}'s ability for creating a horizontal slider if necessary (and requested).
Parameters[Quelltext bearbeiten]
- 1
- lang
- The language used for color coding. Consult extension syntaxhighlight's documentation for a list of supported programming languages
- 2
- code
- The actual code displayed in the box. Warning: If your code contains an equal sign (=), you have to specify the parameter name as either
sample text
orsample text
, otherwise the display of text will be botched up. - 3
- optional If you don't want a horizontal slider for long text, set this to
sample text
Usage[Quelltext bearbeiten]
{{code|bash|code=#!/bin/bash mysql --defaults-file=/etc/mysql/debian.cnf}}
renders as
#!/bin/bash
mysql --defaults-file=/etc/mysql/debian.cnf
If you omit the paramater name (code=
), thus writing
{{code|bash|#!/bin/bash mysql --defaults-file=/etc/mysql/debian.cnf}}
your output will look like this:
sample text
See also[Quelltext bearbeiten]
- {{code snippet}} for short code text in sentences
- {{pre}} for a pre box with line wraps
- {{pre2}} for a pre box with horizontal slider
<pre>...</pre>