Template:Syntax highlight/doc

From Valve Developer Community
Jump to navigation Jump to search
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.


Usage

{{Syntax Highlight/Type|text}}


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