Template:Inline-code
{{{1}}}
| This template uses TemplateStyles: |
Usage
This template wraps code in <syntaxhighlight inline lang="{{{lang}}}">{{{code}}}</syntaxhighlight>
where lang defaults to php, but can be any language listed under Extension:SyntaxHighlight § Supported languages.
Example
- Some text, then
{{Inline-code | 1=wfDebug( $text, $dest = 'all' );}}and more text.
produces
- Some text, then
wfDebug( $text, $dest = 'all' );and more text.
Note that for PHP, using the {{phpi}} wrapper might be easier.
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools.
Inline-code
Applies syntax highlighting to an inline piece of source code.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Code | 1 code | The code to display. | String | required |
| Language | 2 lang | The programming language of the source code. List of valid values is at: Extension:SyntaxHighlight#Supported languages.
| String | suggested |
| Class | class | Adds one or more CSS classes, separated by a blank | String | optional |
| ID | id | Adds an HTML id (must be unique in the page) | String | optional |
| CSS style | style | Additional CSS to apply to the output
| String | optional |
| No wrap | nowrap | Prevent the output from wrapping.
| Boolean | optional |
Wrappers
See also
- {{Code}}