Code syntax highlighting: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
CODE | |||
<code> | |||
<source lang="c" line start="2" highlight="4-6"> | <source lang="c" line start="2" highlight="4-6"> | ||
// comment | // comment | ||
Zeile 16: | Zeile 11: | ||
} | } | ||
</source> | </source> | ||
</code> | |||
=== SyntaxHighlighter === | |||
This extension is installed and works! | |||
https://www.mediawiki.org/wiki/Extension:SyntaxHighlighter#Installation | |||
==== Example ==== | |||
wiki-syntax: | |||
< | <nowiki> | ||
<source lang="c" line start="2" highlight="4-6"> | <source lang="c" line start="2" highlight="4-6"> | ||
// comment | // comment | ||
Zeile 27: | Zeile 30: | ||
} | } | ||
</source> | </source> | ||
</ | </nowiki> | ||
result: | result: |
Version vom 13. April 2020, 22:36 Uhr
CODE
// comment
var setArray = function(elems) {
this.length = 0;
push.apply(this, elems);
return this;
}
SyntaxHighlighter
This extension is installed and works! https://www.mediawiki.org/wiki/Extension:SyntaxHighlighter#Installation
Example
wiki-syntax:
<source lang="c" 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";