Template:Code: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{Doc}}
{{Doc}}
<includeonly><onlyinclude>{{#switch:{{{style}}}
<includeonly><onlyinclude><kbd style="border-radius:3px; color:{{{color|currentcolor}}}; user-select:{{#switch:{{{select|}}}|#default=text|0=none|1=all}}; background-color:{{#switch:{{{style}}}
|#default = <code style="background:{{{bg|{{{background|rgb(0,0,0,.35)}}}}}}; border-radius:3px; color: {{{color|currentcolor}}}; padding:2px 3px; user-select:{{#switch:{{{select}}}|#default=text|1=all|2=none}}">{{{1|}}}</code>
|#default = {{{bg|rgb(0,0,0,.35)}}}; padding:2px 3px">{{{1|}}}
|1 = <code style="background-color:rgba(0,0,0,.16); border:1px solid rgba(255,255,255,.1); border-radius:3px; padding:1px 3px; user-select:{{#switch:{{{select}}}|#default=text|1=all|2=none}}">{{{1|}}}</code>
|1 = {{{bg|rgba(0,0,0,.16)}}}; border:1px solid rgba(255,255,255,.1); padding:1px 3px">{{{1|}}}
|2 = <code style="background-color:rgb(0,0,0,.16); border-radius:3px; padding:2px 3px; user-select:{{#switch:{{{select}}}|#default=text|1=all|2=none}}">{{{1|}}}</code>
|2 = {{{bg|rgba(0,0,0,.16)}}}; padding:2px 3px">{{{1|}}}
|3 = <kbd style="color:{{{color|currentcolor}}}; user-select:{{#switch:{{{select}}}|#default=text|1=all|2=none}}">{{{1|}}}</kbd>
|3 = {{{bg|initial}}}">{{{1|}}}
|4 = <code style="background-color:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1); border-radius:3px; padding:1px 3px; user-select:{{#switch:{{{select}}}|#default=text|1=all|2=none}}">{{{1|}}}</code>
|4 = {{{bg|rgba(255,255,255,.05)}}}; border:1px solid rgba(255,255,255,.1); padding:1px 3px">{{{1|}}}
}}</onlyinclude></includeonly>
}}<span style=user-select:none></span></kbd></onlyinclude></includeonly>

Revision as of 03:28, 29 April 2023

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 prefers inline formatting of parameters
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