Code syntax highlighting

Aus hyperdramatik
Wechseln zu: Navigation, Suche

SyntaxHighlighter

This extension is installed and works! https://www.mediawiki.org/wiki/Extension:SyntaxHighlighter#Installation

wiki-syntax:

<source lang="js" line start="2" highlight="4-6">
// comment
var setArray = function(elems) {
    this.length = 0;
    push.apply(this, elems);
    return this;
}
</source>
 

result:

// comment
var setArray = function(elems) {
    this.length = 0;
    push.apply(this, elems);
    return this;
}

SyntaxHighlight

Unfortunately have not been able to get this extension to work: https://www.mediawiki.org/wiki/Extension:SyntaxHighlight#Installation

including the bellow options in the LocalSettings.php file generates an errors: wfLoadExtension( 'SyntaxHighlight_GeSHi' ); require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php";


CODE

not a good option, but an option...

wiki-syntax:

<code>
// comment
var setArray = function(elems) {
    this.length = 0;
    push.apply(this, elems);
    return this;
}
</code>
 


result:

// comment var setArray = function(elems) {

   this.length = 0;
   push.apply(this, elems);
   return this;

}