Template:Syntax highlight/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:
|-  
|-  
| Type              ||<nowiki>{{Syntax Highlight/Type|unsigned int}}</nowiki>      || <nowiki>{{stxtype|unsigned int}}</nowiki>  || {{Syntax Highlight/Type|unsigned int}}
| Type              ||<nowiki>{{Syntax Highlight/Type|unsigned int}}</nowiki>      || <nowiki>{{stxtype|unsigned int}}</nowiki>  || {{Syntax Highlight/Type|unsigned int}}
|-
| Register          ||<nowiki>{{Syntax Highlight/Register|%rax}}</nowiki>          || <nowiki>{{stxreg|%rax}}</nowiki>            || {{Syntax Highlight/Register|%rax}}
|-  
|-  
|}
|}

Revision as of 17:02, 29 June 2023

Edit-copy.png
This is a documentation subpage for Template:Syntax highlight.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template has subpages used to apply CSS to text to signify it is a certain category, such as a comment, type, string, etc. the CSS here is taken from how <source> renders code, with the exception of functions, to contrast it against {{CodeBlock}} more.


Usage

{{Syntax Highlight|type}}


Currently Supported Categories
Name Example Shortcut Preview
Comment {{Syntax Highlight/Comment|//comment}} {{stxcmnt|//comment}} Template:Syntax Highlight/Comment
Control {{Syntax Highlight/Control|if}} {{stxctrl|if}} Template:Syntax Highlight/Control
Function {{Syntax Highlight/Function|main}} {{stxfunc|main}} Template:Syntax Highlight/Function
Preprocessor Macro {{Syntax Highlight/Macro|#define}} {{stxmacro|#define}} Template:Syntax Highlight/Macro
Number {{Syntax Highlight/Number|3.0f}} {{stxno|3.0f}} Template:Syntax Highlight/Number
String/Char {{Syntax Highlight/String|"Hello, World!"}} {{stxstr|"Hello, World!"}} Template:Syntax Highlight/String
Type {{Syntax Highlight/Type|unsigned int}} {{stxtype|unsigned int}} Template:Syntax Highlight/Type
Register {{Syntax Highlight/Register|%rax}} {{stxreg|%rax}} Template:Syntax Highlight/Register