SyntaxHighlight demo

From Notaclue Wiki
Extension demonstration (infobox template)
SyntaxHighlight
Documentation

on mediawiki.org

Maintained by WikiTeq?

No

Bundled Since version 1.21
Version

This wiki has the SyntaxHighlight extension installed, which adds the ability to add syntax highlighting for various languages.

For example, JavaScript highlighting

function isEven( number ) {
    return ( number % 2 === 0 );
}
console.log( '4 is: ' + ( isEven( 4 ) ? 'even' : 'odd' ) );
console.log( '5 is: ' + ( isEven( 5 ) ? 'even' : 'odd' ) );

is the result of

<syntaxhighlight lang="javascript" line>
function isEven( number ) {
    return ( number % 2 === 0 );
}
console.log( '4 is: ' + ( isEven( 4 ) ? 'even' : 'odd' ) );
console.log( '5 is: ' + ( isEven( 5 ) ? 'even' : 'odd' ) );
</syntaxhighlight>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.