From Valve Developer Community
Jump to navigation
Jump to search
Revision as of 17:18, 27 June 2023

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!"}} |
Template loop detected: Template:Doc
|
Comment |
{{syntax highlight|comment|//comment}} |
{{stx|comm|//comment}} |
Template loop detected: Template:Doc
|
Control |
{{syntax highlight|control|if}} |
{{stx|ctrl|if}} |
Template loop detected: Template:Doc
|
Function |
{{syntax highlight|function|main}} |
{{stx|func|main}} |
Template loop detected: Template:Doc
|
Label |
{{syntax highlight|label|final}} |
{{stx|lbl|final}} |
Template loop detected: Template:Doc
|
Macro |
{{syntax highlight|macro|#define}} |
{{stx|mac|#define}} |
Template loop detected: Template:Doc
|
Number/Operator |
{{syntax highlight|number|3.0f}} {{syntax highlight|operator|+}} |
{{stx|no|3.0f}} {{stx|op|+}} |
Template loop detected: Template:Doc
|
Register |
{{syntax highlight|register|%rax}} |
{{stx|reg|%rax}} |
Template loop detected: Template:Doc
|
Regular Expression |
{{syntax highlight|regular expression|/a*b+/}} |
{{stx|regex|/a*b+/}} |
Template loop detected: Template:Doc
|
Type |
{{syntax highlight|type|unsigned int}} |
{{stx|type|unsigned int}} |
Template loop detected: Template:Doc
|