The Code template wraps text in <syntaxhighlight>
tags. This template should be used for short in-line snippets; longer examples should use the <pre>...</pre>
or <syntaxhighlight>...</syntaxhighlight>
tags.
Contents
Usage
Syntax
{{code |code = |lang = |}}
Parameters
- code
- The text to be formatted as code, optionally with syntax highlighting.
- lang
- The language to be used for syntax highlighting.
If the content includes an equals sign (=), you must use the code
, or 1
, argument explicitly: {{code|code=date=30 Feb 2010}}
or {{code|1=date=30 Feb 2010}}
.
If the second or lang
parameter is omitted the text will default to plain-text, i.e. no highlighting. Valid languages are dialgoscript
, objectscript
or storyscript
. Attempting to use an invalid language causes a list of the valid ones to be displayed when the page is previewed or saved.
Example
Replace the first line with {{code|lang=dialogscript|ACTION SetFlag("DeliveredApples",1)}}.
Replace the first line with
.
ACTION SetFlag("DeliveredApples",1)