Template:Syntax highlight/doc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
== Usage == | == Usage == | ||
{{Code|<nowiki>{{Syntax Highlight| | {{Code|<nowiki>{{Syntax Highlight/Type|text}}</nowiki>}} | ||
Revision as of 17:05, 29 June 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/Type|text}}
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 |