Template:Code/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 15: Line 15:
:* {{Code|2}} - Desaturated version. Does not support {{param|bg}} and {{param|color}}.
:* {{Code|2}} - Desaturated version. Does not support {{param|bg}} and {{param|color}}.
:* {{Code|3}} - Clear version. Does not support {{param|bg}} but supports {{param|color}}.
:* {{Code|3}} - Clear version. Does not support {{param|bg}} but supports {{param|color}}.
:* {{Code|4}} - A brighter outlined version. Does not support {{param|bg}} and {{param|color}}. It may become the default style in the future.
:* {{Code|4}} - A brighter outlined version. Does not support {{param|bg}} and {{param|color}}.
:* {{Code|style=3|Default}} - the default style is based on Markdown and supports the {{param|bg}} and {{param|color}} parameters.
:* {{Code|style=3|Default}} - the default style is based on Markdown and supports the {{param|bg}} and {{param|color}} parameters.
| {{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|1}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}} {{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|2}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}} {{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|3}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}}{{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|4}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}}
| {{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|1}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}} {{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|2}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}} {{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|3}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}}{{CodeBlock|&#123;&#123;Code&#124;{{tint|color=yellow|style}}<nowiki>=</nowiki>{{tint|color=green|4}}&#124;{{tint|color=comment|Hello, World!}}&#125;&#125;}}

Revision as of 10:59, 30 March 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.

Parameters and Examples

Parameter Description Example Preview
{{{style}}} The style of the template. The following styles are available:
  • 1 - Outlined version. Does not support {{{bg}}} and {{{color}}}.
  • 2 - Desaturated version. Does not support {{{bg}}} and {{{color}}}.
  • 3 - Clear version. Does not support {{{bg}}} but supports {{{color}}}.
  • 4 - A brighter outlined version. Does not support {{{bg}}} and {{{color}}}.
  • Default - the default style is based on Markdown and supports the {{{bg}}} and {{{color}}} parameters.
{{Code|style=1|Hello, World!}}
{{Code|style=2|Hello, World!}}
{{Code|style=3|Hello, World!}}
{{Code|style=4|Hello, World!}}
Hello, World!
Hello, World!
Hello, World!
Hello, World!
{{{select}}} Text selection mode. The following values are available:
  1. 1 - All (one click selection);
  2. 2 - None (template content will not be highlighted).
{{Code|select=1|Hello, World!}}
{{Code|select=2|Hello, World!}}
Hello, World!
Hello, World!
{{{color}}} Text color.
HSL, HEX, RGB and more are supported.
{{Code|color=#EF9B9B|Hello, World!}}
Hello, World!
{{{bg}}}
 
{{{background}}}
Background color.
HSL, HEX, RGB and more are supported.
Note.pngNote:If both {{{background}}} and {{{bg}}} are present, {{{bg}}} is preferred.
{{Code|bg=rgba(239,155,155,.15)|Hello, World!}}
Hello, World!