Template:Syntaxhighlight/doc: Difference between revisions
Appearance
Content deleted Content added
Caleb Cooper (talk | contribs) Created page with "{{Documentation subpage}} {{tsh|sxhl}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> Simple wrapper around the {{xtag|syntaxhighlight}} tag to show..." |
(No difference)
|
Latest revision as of 19:45, 4 November 2020
Simple wrapper around the <syntaxhighlight> tag to show syntax-highlighted text. Unlike <syntaxhighlight>, text that does not fit on the screen will be wrapped.
Usage
Parameters
- lang:
- code: The contents of the syntax highlighted block.
Examples
{{syntaxhighlight|lang=javascript|code=mw.util.addPortletLink('p-personal', '/w/index.php?title=Special:MyPage/Sandbox&action=edit&preload=Template%3AUser_sandbox%2Fpreload&editintro=Template%3AUser_sandbox', 'My sandbox', 'pt-mysandbox', 'Go to my sandbox');}}
mw.util.addPortletLink('p-personal', '/w/index.php?title=Special:MyPage/Sandbox&action=edit&preload=Template%3AUser_sandbox%2Fpreload&editintro=Template%3AUser_sandbox', 'My sandbox', 'pt-mysandbox', 'Go to my sandbox');
See also