Template:Code/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(updated descriptions for styles)
Line 3: Line 3:


== Parameters ==
== Parameters ==
{| class="standard-table"
! colspan="2" | Styles
|-
| {{param|desaturated}}
| less saturated version
|-
| {{param|outlined}}
| less saturated version with outline 
|-
| {{param|clear}}
| no style
|}
{| class="standard-table"
{| class="standard-table"
! colspan="2" | Modifiers
! colspan="2" | Modifiers
Line 28: Line 16:
| {{param|background}}
| {{param|background}}
| allows you to change the background color if the default style is enabled 
| allows you to change the background color if the default style is enabled 
|-
| {{param|style}}
| Allows you to change the style of the template from existing styles:
*'''{{Code|1}}''': less saturated version ({{param|tag=kbd|desaturated}})
*'''{{Code|2}}''': less saturated version with outline ({{param|tag=kbd|outlined}})
*'''{{Code|3}}''': {{Code|select=1|<nowiki><kbd></nowiki>}} tag version, {{param|tag=kbd|color}} is available
*Default: default style.
|}
|}



Revision as of 14:18, 23 January 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)
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. The default style is based on Markdown.

Parameters

Modifiers
{{{select}}} Sets the values for the user-select parameter.

Values:
  • 1: All (one click selection);
  • 2: None (template content will not be highlighted).
{{{color}}} allows you to change the color of the text if the default style is enabled
{{{background}}} allows you to change the background color if the default style is enabled 
{{{style}}} Allows you to change the style of the template from existing styles:
  • 1: less saturated version ({{{desaturated}}})
  • 2: less saturated version with outline ({{{outlined}}})
  • 3: <kbd> tag version, {{{color}}} is available
  • Default: default style.

Examples

{{Code|Go to [[Main Page|Main Page]]}} {{Code|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{Code|style=2|Go to [[Main Page|Main Page]]}} {{Code|style=2|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{Code|style=1|Go to [[Main Page|Main Page]]}} {{Code|style=2|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{Code|select=1|bg=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}} {{Code|bg=rgb(40,60,100)|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx