Changes

895 bytes removed ,  17:34, 21 December 2019
m
Undo revision 9655 by Joelmartin (talk)
Line 1: Line 1: −
=Source code Display=
+
=Source code Publishing=
The engineering focus of this wiki is centered on information sharing
+
The engineering focus of this wiki is centered on information sharing which includes publishing a voluminous amount of computer code related to Robonation Projects that the Engineering Club engages.
 +
source language tags are available to parse, and colorize the source code appropriately.
 +
==Source code Display==
 +
The Pygments library installed in this wiki provides support for hundreds of computer languages and file formats.
 +
===Code Language Example===
    +
<pre>
 +
<source lang="csharp">
 +
// Hello World in Microsoft C# ("C-Sharp").
   −
== Supported languages == <!--T:61-->
+
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>
   −
<!--T:62-->
  −
The Pygments library provides support for hundreds of computer languages and file formats.</translate>
  −
<translate>
  −
<!--T:118-->
  −
[<tvar|url>http://pygments.org/languages/</> full list] is:
  −
</translate>
  −
*
   
=== Programming languages ===
 
=== Programming languages ===
 
<blockquote>
 
<blockquote>
Line 24: Line 52:  
* Befunge
 
* Befunge
 
* Boo
 
* Boo
* BrainFuck
   
* C / C++
 
* C / C++
 
* C#
 
* C#
Line 98: Line 125:  
}}
 
}}
 
</blockquote>
 
</blockquote>
 +
 
=== Template languages ===
 
=== Template languages ===
 
<blockquote>
 
<blockquote>
Line 112: Line 140:  
}}
 
}}
 
</blockquote>
 
</blockquote>
 +
 
=== Other markup ===
 
=== Other markup ===
 
<blockquote>
 
<blockquote>
Line 154: Line 183:  
</blockquote>
 
</blockquote>
   −
<translate>
+
For accurate language codes, see [http://pygments.org/docs/lexers/ complete details in the Pygments document] and there are some mappings for some language names which were supported by GeSHi ([https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/blob/master/includes/SyntaxHighlightGeSHiCompat.php full list]).
<!--T:65-->
  −
For accurate language codes, see [<tvar|external-link2>http://pygments.org/docs/lexers/</> complete details in the Pygments document] and there are some mappings for some language names which were supported by GeSHi ([<tvar|external-link3>https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/blob/master/includes/SyntaxHighlightGeSHiCompat.php</> full list]).
  −
</translate>
  −
 
  −
{{tip|1=<translate><!--T:66--> Pygments does not yet provide a "wikitext" or "mediawiki" lexer <tvar|phab>([[phab:T29828]])</>.</translate> <translate><!--T:67--> Use "html", "xml", or "[<tvar|url>http://pygments.org/docs/lexers/#pygments.lexers.markup.MoinWikiLexer</> moin]" instead.</translate>}}
     −
<translate>
  −
<!--T:68-->
   
Below is a partial list of languages that GeSHi could highlight, with strike-through for languages no longer supported after the switch to Pygments.
 
Below is a partial list of languages that GeSHi could highlight, with strike-through for languages no longer supported after the switch to Pygments.
</translate>
     −
{{collapse top| title=<translate><!--T:69--> Previously supported lexers</translate> }}
+
{{collapse top| title=Previously supported lexers}}
 
{| class="wikitable" style="float:{{dir|{{pagelang}}|right|left}}"
 
{| class="wikitable" style="float:{{dir|{{pagelang}}|right|left}}"
!<translate><!--T:107--> Code</translate>||<translate><!--T:108--> Language</translate>
+
!Code|| Language
 
|-
 
|-
 
|<del><code>4cs</code></del>||4CS
 
|<del><code>4cs</code></del>||4CS
Line 634: Line 655:  
<div style="clear:both"></div>
 
<div style="clear:both"></div>
 
{{collapse bottom}}
 
{{collapse bottom}}
  −
<translate>
  −
  −
  −
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>
 
4,000

edits