Template:Code/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 68: Line 68:
|-
|-
| style="vertical-align:top; text-align:center" | <code>{{param|highlight}}</code>
| style="vertical-align:top; text-align:center" | <code>{{param|highlight}}</code>
| style="vertical-align:top" | Adds syntax highlighting for the language specified. {{Bug|Condenses code into one line.}}
| style="vertical-align:top" | Adds syntax highlighting for the language specified. {{Bug|Condenses code into one line.|hidetested=true}}
| style="background-color:#1f1f1f; border-right:0; font-family:monospace" | <pre style="margin:0">| highlight = c</pre>
| style="background-color:#1f1f1f; border-right:0; font-family:monospace" | <pre style="margin:0">| highlight = c</pre>
| style="background-color:#1f1f1f; border-left:0; font-family:monospace; text-align:center; color:#8d8c8b; cursor:help" title="<nowiki>{{Code|highlight=c|int main() {return 0;}}}</nowiki>" | (?)
| style="background-color:#1f1f1f; border-left:0; font-family:monospace; text-align:center; color:#8d8c8b; cursor:help" title="<nowiki>{{Code|highlight=c|int main() {return 0;}}}</nowiki>" | (?)

Latest revision as of 03:12, 8 October 2025

Edit-copy.png
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.

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:
  • Default – The default style is based on Markdown;
  • 0 – Clear version;
  • 1 – Desaturated version;
  • 2 – Outlined version;
  • 3 – A brighter outlined version.
| preset = 0
(?) Hello, World!
| preset = 1
(?) Hello, World!
| preset = 2
(?) Hello, World!
| preset = 3
(?) Hello, World!
{{{select}}} Text selection mode.

Uses the user-select CSS property.

Default value is unset.

| select = none
(?) Hello, World!
| select = all
(?) Hello, World!
{{{style}}} CSS styles.
| style = color:#EF9B9B
(?) Hello, World!
{{{highlight}}} Adds syntax highlighting for the language specified.
Icon-Bug.pngBug:Condenses code into one line.
| highlight = c
(?) int main() {return 0;}

See Also