This page has been semi-protected so that only established users can edit it.

Template:Code: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{semi-protection}}
{{Semi-protection}}
{{Documentation}}
{{Documentation}}
<includeonly>
<includeonly><onlyinclude>{{#tag: {{#if: {{{lang|}}} | syntaxhighlight | code }}
 
|{{{1|}}}| inline = 1
<onlyinclude><span style="font-family:monospace; {{#switch:{{{p|{{{preset|}}}}}}
| style = background:#0003 !important; box-decoration-break:clone
|#default = padding:2px 4px; border-radius:3px; background:rgb(0 0 0 / 26%);
| lang = {{{lang|}}}
|0 =
}}</onlyinclude></includeonly>
|1 = padding:2px 4px; border-radius:3px; background:rgb(0 0 0 / 16%);
|2 = padding:1px 3px; border-radius:3px; background:rgb(0 0 0 / 16%); border:1px solid rgb(255 255 255 / 10%);
|3 = padding:1px 3px; border-radius:3px; background:rgb(255 255 255 / 5%); border:1px solid rgb(255 255 255 / 10%);
}} {{#if:{{{select|}}}|user-select:{{{select}}};}} {{{style|}}}">{{#if:{{{highlight|}}}|{{#tag:syntaxhighlight|{{{1}}}|lang={{{highlight}}}|inline=1}}|{{{1}}}}}</span></onlyinclude>
 
</includeonly>

Revision as of 10:27, 16 October 2025

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
Page history

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 Preview
| <Text>
| 1 = <Text>
The text that will be displayed. Can contain links, templates and raw html, except when the {{{lang}}} parameter is used. Hello, World!
| lang = <Option> Adds syntax highlighting for the language specified using syntaxhighlight tag with inline attribute.
List of Supported languages.
int main() { return 0; }
| style = <CSS> CSS styles. Note that some styles require !important to be specified. Colored text

See Also