Template:Code/doc

From Valve Developer Community
Jump to navigation Jump to search
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:
  • Default – the default style is based on Markdown;
  • 1 – Outlined version;
  • 2 – Desaturated version;
  • 3 – Clear version;
  • 4 – A brighter outlined version.
{{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:
  • Default – Initial state;
  • 0 – None: template content will not be highlighted;
  • 1 – All: one click selection.
{{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 color.
HSL, HEX, RGB and more are supported.
{{Code|bg=rgba(239,155,155,.15)|Hello, World!}}
Hello, World!