Template:Code/doc: Difference between revisions
Jump to navigation
Jump to search
| Line 8: | Line 8: | ||
{| class=standard-table | style="width:100%" | {| class=standard-table | style="width:100%" | ||
|- | |- | ||
! Parameters | ! style="width:10%" | Parameters | ||
! {{int:listfiles_description}} | ! {{int:listfiles_description}} | ||
! colspan="2" style="width:20%" | {{int:apisandbox-examples}} | ! colspan="2" style="width:20%" | {{int:apisandbox-examples}} | ||
Revision as of 12:58, 7 October 2025
This is a documentation subpage for Template:Code.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
This template will allow you to format text as a one-line code.
Usage
This template is usually written in a single line. To use it, insert {{Code}} into the desired page and specify the parameters to the right of the template name in the following format: {{Code|parameter 1 = value|parameter 2 = value}}.
Parameters and Examples
| Parameters | Description | Examples | Preview | |
|---|---|---|---|---|
{{{1}}}
|
Text. | | Hello, World! |
(?) | Hello, World!
|
| 1 = Hello, World! |
(?) | |||
{{{preset}}}
|
Preset Template Styles. The following presets are available:
| |||
| preset = 0 |
(?) | Hello, World!
| ||
| preset = 1 |
(?) | Hello, World!
| ||
| preset = 2 |
(?) | Hello, World!
| ||
| preset = 3 |
(?) | Hello, World!
| ||
{{{select}}}
|
Text selection mode.
Uses the Default value is | |||
| select = none |
(?) | Hello, World!
| ||
| select = all |
(?) | Hello, World!
| ||
{{{style}}}
|
CSS styles. | | style = color:#EF9B9B |
(?) | Hello, World!
|
{{{highlight}}}
|
Adds syntax highlighting for the language specified. |
| highlight = c |
(?) | int main() {return 0;}
|
See Also
- {{CodeBlock}}