Help:Syntax Highlighting: Difference between revisions

Content added Content deleted
(→‎Old style: Splitting list into columns)
(Fix example instructions, I don't think we need the old style example anymore)
Line 5: Line 5:
== New style ==
== New style ==


Code examples are enclosed by '''<code>''' tags. The '''lang''' argument selects the language used for highlighting. Example:
Code examples are enclosed by '''<lang>''' tags. The '''lang''' argument selects the language used for highlighting. Example:


<pre>
<pre>
Line 31: Line 31:


It's in principle possible to write additional PHP files for unsupported languages and include them. Please contact one of the administrators for details.
It's in principle possible to write additional PHP files for unsupported languages and include them. Please contact one of the administrators for details.

== Old style ==

Code examples are enclosed in tags named after the language, as in

<pre>
<c>
int main (int argc, char* argv[])
{
return 0;
}
</c>
</pre>

That renders as

<c>
int main (int argc, char* argv[])
{
return 0;
}
</c>
<div style="clear: both; column-count: 3; -webkit-column-count:3; -moz-column-count:3"><lang list></lang></div>
<div style="clear: both; column-count: 3; -webkit-column-count:3; -moz-column-count:3"><lang list></lang></div>