From Valve Developer Community
Jump to navigation
Jump to search

Available doc translations
…
English
This template applies CSS to text to signify it is a certain category, such as a comment, type, string, etc. the CSS here is taken from how <syntaxhighlight> renders code.
Usage
{{Syntax highlight|category|text}}
Supported Categories
Uses
|
Example
|
Shortcuts
|
Preview
|
Character/String |
{{syntax highlight|character|'x'}} {{syntax highlight|string|"Hello, World!"}} |
{{stx|char|'x'}} {{stx|str|"Hello, World!"}} |
{{#switch:character
|
char='x'
|
Comment |
{{syntax highlight|comment|//comment}} |
{{stx|comm|//comment}} |
{{#switch:comment
|
char=//comment
|
Control |
{{syntax highlight|control|if}} |
{{stx|ctrl|if}} |
{{#switch:control
|
char=if
|
Function |
{{syntax highlight|function|main}} |
{{stx|func|main}} |
{{#switch:function
|
char=main
|
Label |
{{syntax highlight|label|final}} |
{{stx|lbl|final}} |
{{#switch:label
|
char=final
|
Macro |
{{syntax highlight|macro|#define}} |
{{stx|mac|#define}} |
{{#switch:macro
|
char=#define
|
Number/Operator |
{{syntax highlight|number|3.0f}} {{syntax highlight|operator|+}} |
{{stx|no|3.0f}} {{stx|op|+}} |
{{#switch:number
|
char=3.0f
|
Register |
{{syntax highlight|register|%rax}} |
{{stx|reg|%rax}} |
{{#switch:register
|
char=%rax
|
Regular Expression |
{{syntax highlight|regular expression|/a*b+/}} |
{{stx|regex|/a*b+/}} |
{{#switch:regular expression
|
char=/a*b+/
|
Type |
{{syntax highlight|type|unsigned int}} |
{{stx|type|unsigned int}} |
{{#switch:type
|
char=unsigned int
|