Template:Code

From Valve Developer Community
Jump to navigation Jump to search
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)
Icon-translate.png Available doc translations
View
Page history

This template will allow you to format text as a one-line code.

Parameters and Examples

Parameters Description Examples Preview
{{{preset}}} Preset Template Styles. The following presets are available:
  • Default – The default style is based on Markdown;
  • 0 – Clear version;
  • 1 – Desaturated version;
  • 2 – Outlined version;
  • 3 – A brighter outlined version.
{{Code|Hello, World!}}
{{Code|preset=0|Hello, World!}}
{{Code|preset=1|Hello, World!}}
{{Code|preset=2|Hello, World!}}
{{Code|preset=3|Hello, World!}}
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!
{{{select}}} Text selection mode. Uses the user-select CSS property. Default value is unset.
{{Code|select=none|Hello, World!}}
{{Code|select=all|Hello, World!}}
Hello, World!
Hello, World!
{{{style}}} CSS styles.
{{Code|style=color:#EF9B9B|Hello, World!}}
Hello, World!
{{{highlight}}} Adds syntax highlighting for the language specified.
Icon-Bug.pngBug:Condenses code into one line.  [todo tested in?]
{{Code|highlight=c|int main() {return 0;} }}
int main() {return 0;}