Template:CodeBlock: Difference between revisions
Jump to navigation
Jump to search
Tag: Undo |
(added automatic syntax highlighting! (also had to change cs to csharp for this purpose)) |
||
Line 6: | Line 6: | ||
--><!-- | --><!-- | ||
--><div>{{{src|The source was not specified}}}</div><!-- | --><div>{{{src|The source was not specified}}}</div><!-- | ||
-->{{#if:{{{lang|}}}|<div>{{#switch:{{{lang}}}|plain=Plain text|html=HTML|css=CSS|scss=SCSS|less=LESS|js=JavaScript|json=JSON|php=PHP|c=C| | -->{{#if:{{{lang|}}}|<div>{{#switch:{{{lang}}}|plain=Plain text|html=HTML|css=CSS|scss=SCSS|less=LESS|js=JavaScript|json=JSON|php=PHP|c=C|csharp=C#|cpp=C++|pascal=Pascal|python=Python|java=Java|squirrel=Squirrel|lua=Lua|glua=gLua|{{{lang}}}}}</div>}}<!-- | ||
--><!-- | --><!-- | ||
--></div>}}<!-- | --></div>}}<!-- | ||
Line 36: | Line 36: | ||
--><div style="width:100%;background:rgba(255,128,0,0.1);margin-top:calc((1.6em * ({{{lightstart4|4}}} - 1)) + .45em);margin-bottom:.45em;height:calc(1.6em * {{{lightamount4|1}}});position:absolute;left:0;user-select:none;pointer-events:none"><!-- | --><div style="width:100%;background:rgba(255,128,0,0.1);margin-top:calc((1.6em * ({{{lightstart4|4}}} - 1)) + .45em);margin-bottom:.45em;height:calc(1.6em * {{{lightamount4|1}}});position:absolute;left:0;user-select:none;pointer-events:none"><!-- | ||
--></div><!-- | --></div><!-- | ||
--></div>}}<div style="padding:.45em .5em;position:relative">{{{1|}}}</div><!-- | --></div>}}<div style="padding:.45em .5em;position:relative">{{Highlighting supported|{{{lang}}}|{{#tag:syntaxhighlight|{{{1}}}|lang=c|inline=1|style="background-color:#00000000;"}}|{{{1|}}}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
--><!-- | --><!-- |
Revision as of 18:37, 8 August 2023
Todo: Add syntax highlighting for relevant languages such as C, C++, Squirrel, Lua, AngelScript, Python, and QuakeC, as well as common non-code syntax, such as VMT, VMF, Soundscapes/scripts, RAD files, Studiomdl QC/QCI, etc.
The above documentation is transcluded from Template:CodeBlock/doc. (Edit | Page history)
Editors can experiment in this template's sandbox (edit) and testcases (create) pages.
Editors can experiment in this template's sandbox (edit) and testcases (create) pages.