1,032 bytes added
, 03:38, 14 December 2019
===Source code===
{{main|mw:Extension:SyntaxHighlight}}
If the syntax highlighting extension is installed, you can display programming language [[w:source code|source code]] in a manner very similar to the HTML <code><nowiki><pre></nowiki></code> tag, except with the type of [[w:syntax highlighting|syntax highlighting]] commonly found in advanced text editing software.
List of supported languages: http://pygments.org/languages/
Here's an example of how to display some [[w:C Sharp (programming language)|C#]] source code:
<pre>
<source lang="csharp">
// Hello World in Microsoft C# ("C-Sharp").
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello, World!");
return 0;
}
}
</source>
<nowiki></nowiki></pre>
Results in:
<source lang="csharp">
// Hello World in Microsoft C# ("C-Sharp").
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello, World!");
return 0;
}
}
</source>