Template:Code
Jump to navigation
Jump to search
Template for providing code within a paragraph of a wiki page.
Usage
An anonymous first parameter provides the text to wrap into a code element. An optional second parameter can set the colour of the output.
Examples
eg.
{{code|IsItemInQueue([Queue Name], [Item Key])}}
Gives
IsItemInQueue([Queue Name], [Item Key])
The second parameter sets the colour of the output, eg.
{{code|Dim|blue}} {{code|str}} {{code|As}} {{code|String|teal}} {{code|{{=}}}} {{code|"This is a test"|#800}}
will emit:
Dim str As String = "This is a test"
Note the use of the {{=}} template to pass a literal '=' character. It is treated as a 'name=value' operator by mediawiki without that.