Template:Code: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (I'm an idiot, why would that work???)
(added automatic syntax highlighting!)
Line 6: Line 6:
|2 = rgba(0,0,0,.16); border:1px solid rgba(255,255,255,.1); padding:1px 3px
|2 = rgba(0,0,0,.16); border:1px solid rgba(255,255,255,.1); padding:1px 3px
|3 = rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1); padding:1px 3px
|3 = rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1); padding:1px 3px
}}; user-select:{{{select|unset}}}; {{{style|}}}">{{{1}}}<span style="user-select:none"></span></code></onlyinclude></includeonly>
}}; user-select:{{{select|unset}}}; {{{style|}}}">{{Highlighting supported|{{{lang}}}|{{#tag:syntaxhighlight|{{{1}}}|lang=c|inline=1|style="background-color:#00000000;"}}|{{{1|}}}}}<span style="user-select:none"></span></code></onlyinclude></includeonly>

Revision as of 19:04, 8 August 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
View
Page history

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

Parameters and Examples

Parameters Description Examples Preview
Template:Highlighting supported Preset Template Styles. The following presets are available:
{{Code|Hello, World!}}
{{Code|preset=0|Hello, World!}}
{{Code|preset=1|Hello, World!}}
{{Code|preset=2|Hello, World!}}
{{Code|preset=3|Hello, World!}}
Template:Highlighting supported Text selection mode. Uses the Template:Highlighting supported CSS property. Default value is Template:Highlighting supported.
{{Code|select=none|Hello, World!}}
{{Code|select=all|Hello, World!}}
Template:Highlighting supported CSS styles.
{{Code|style=color:#EF9B9B|Hello, World!}}
Template:Highlighting supported 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;} }}