Source Code Help
Revision as of 03:38, 14 December 2019 by Joelmartin (talk | contribs) (Created page with "===Source code=== {{main|mw:Extension:SyntaxHighlight}} If the syntax highlighting extension is installed, you can display programming language source code i...")
Source code
Main {{<tvar|ifeq1>#ifeq:||article|page}}{{<tvar|if1>#if:|s}}: mw:Extension:SyntaxHighlightcode1>{{[[<tvar|link>Template:main|main]]<tvar
If the syntax highlighting extension is installed, you can display programming language source code in a manner very similar to the HTML <pre>
tag, except with the type of 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 C# source code:
<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>
Results in:
// Hello World in Microsoft C# ("C-Sharp").
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello, World!");
return 0;
}
}