Template:Syntax highlight/doc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
{| class="standard-table" | {| class="standard-table" | ||
|+ Currently Supported Categories | |+ Currently Supported Categories | ||
! | ! Uses | ||
! Example | ! Example | ||
! Shortcut | ! Shortcut |
Revision as of 11:57, 3 July 2023

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.
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/Category|text}}
Uses | 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 |
Label | {{Syntax Highlight/Label|final}} | {{stxlbl|final}} | Template:Syntax Highlight/Label |
Macro | {{Syntax Highlight/Macro|#define}} | {{stxmac|#define}} | Template:Syntax Highlight/Macro |
Number/Operator | {{Syntax Highlight/Number|3.0f}} | {{stxno|3.0f}} | Template:Syntax Highlight/Number |
Register | {{Syntax Highlight/Register|%rax}} | {{stxreg|%rax}} | Template:Syntax Highlight/Register |
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 |