Source Code Help

From RobotX
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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source code

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;
    }
}