Code syntax highlighting: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
|||
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
== SyntaxHighlighter == | |||
This extension is installed and works! | |||
https://www.mediawiki.org/wiki/Extension:SyntaxHighlighter#Installation | |||
wiki-syntax: | |||
< | <nowiki> | ||
<source lang="js" line start="2" highlight="4-6"> | |||
//comment | // comment | ||
var setArray = function(elems) { | var setArray = function(elems) { | ||
this.length = 0; | this.length = 0; | ||
Zeile 10: | Zeile 13: | ||
return this; | return this; | ||
} | } | ||
</ | </source> | ||
</nowiki> | |||
result: | |||
<source lang="js" line start="2" highlight="4-6"> | |||
// comment | // comment | ||
var setArray = function(elems) { | var setArray = function(elems) { | ||
Zeile 20: | Zeile 25: | ||
return this; | return this; | ||
} | } | ||
</ | </source> | ||
== 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: | wiki-syntax: | ||
<nowiki> | <nowiki> | ||
< | <code> | ||
// comment | // comment | ||
var setArray = function(elems) { | var setArray = function(elems) { | ||
Zeile 38: | Zeile 48: | ||
return this; | return this; | ||
} | } | ||
</ | </code> | ||
</nowiki> | </nowiki> | ||
Zeile 44: | Zeile 54: | ||
result: | result: | ||
< | <code> | ||
// comment | // comment | ||
var setArray = function(elems) { | var setArray = function(elems) { | ||
Zeile 51: | Zeile 61: | ||
return this; | return this; | ||
} | } | ||
</ | </code> | ||
Aktuelle Version vom 14. April 2020, 09:06 Uhr
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;
}