Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Andrew Senetar 03dbc1f963 Update README.md il y a 7 ans
prism First Version ( v0.1 ) il y a 7 ans
.gitattributes First Version ( v0.1 ) il y a 7 ans
.gitignore First Version ( v0.1 ) il y a 7 ans
LICENSE.md First Version ( v0.1 ) il y a 7 ans
PrismHighlight.base.php Update PrismHighlight.base.php il y a 7 ans
PrismHighlight.i18n.php First Version ( v0.1 ) il y a 7 ans
PrismHighlight.php First Version ( v0.1 ) il y a 7 ans
README.md Update README.md il y a 7 ans
init.js First Version ( v0.1 ) il y a 7 ans
overrides.css First Version ( v0.1 ) il y a 7 ans



Prism highlight is a syntax highlighting extension for Mediawiki which uses the Prism JavaScript syntax highlighter.


To install the extension clone the source into your extensions directory:

cd /path/to/wiki/extensions
git clone https://github.com/arsenetar/PrismHighlight.git 

Alternatively you may download the source via zip.

To activate the extension open your LocalSettings.php file and add the following:



The following are the configuration options for the Localsettings.php file ( defaults shown ):

 * Theme to use
 * options: dark, funky, okaidia, tomoorrow, twilight, false ( default )
 * /
$wgPrismHighlightTheme = false;

 * Allow to highlight <source> tags
 * options: true / false
$wgPrismHighlightSource = true;

 * Plugins to use
 * options: autolinker, file-highlight, ie8, line-highlight, line-numbers,
 *   show-invisibles, wpd 
 * note: autolinker and show-invisibles do not appear to work for some reason
$wgPrismHighlightPlugins = array(

 * Languages to load
 * options: bash, c, clike, coffeescript, cpp, css, css-extras, groovy, 
 *   java, javascript, markup, php, python, scss, sql
$wgPrismHighlightLanguages = array(


To use the syntax highlighter in wiki markup create the following:


Place your code where //[...] is.

Now the following parameters may be passed to the <source> tag:

  • lang or language - language to use (none specified uses markup)
  • data-start - the starting line number for numbering or highlight
  • data-lines - the lines to highlight
  • line-numbers - used as a flag to specify line numbers should be used


<source lang=php data-start=29 line-numbers>
    foreach( $args as $key => $value ){
        switch ($key) {
            case 'lang':
            case 'language':
                $code_classes .= " language-$value";
            case 'class':
                $code_classes .= " $value";
            case 'line-numbers':
                $pre_args .= " class=$key";
            case 'data-start':
                $pre_args .= " data-line-offset=$value"; //should make sure this is set
                $pre_args .= " $key=$value";