Difference between revisions of "Extension:HighlightJS"

From Organic Design wiki
(Changed to a client-side syntax highlighter)
 
 
Line 1: Line 1:
 
{{svn|extensions|MediaWiki/HighlightJS}}
 
{{svn|extensions|MediaWiki/HighlightJS}}
We've been using [[GeSHi]] for our syntax highlighting for ten years now, and today I decided it was time to change to a client-side version instead. So I looked around on the net a bit and found a free open source one that I liked which was [https://highlightjs.org highlightjs.org], and made a quick wrapper for it which is this extension. It allows the same syntax to be used as normal, e.g. <tt><nowiki><source lang="LANG"></nowiki></tt>.
+
We've been using [[GeSHi]] for our syntax highlighting for ten years now, and today I decided it was time to change to a client-side version instead. So I looked around on the net a bit and found a free open source one that I liked which was [https://highlightjs.org highlightjs.org], and made a quick wrapper for it which is this extension. It allows the same syntax to be used as normal, e.g. <tt><nowiki><source lang="LANG"></nowiki></tt>. For more information about installation and usage, see [[MW:Extension:HighlightJS]].
 
 
The extension's installed the usual way and has just one option, ''$wgHighlightJsStyle'' which by default is empty which means to use the Organic Design code colours. You can set this to any of the sixty or so styles that you can see in the ''highlight/styles'' directory (don't include the ".css" in the setting).
 
 
 
I've included the languages that we use on this wiki, but you can download more from the main site, it supports over a hundred languages!
 
  
 
== See also ==
 
== See also ==

Latest revision as of 18:38, 6 June 2015

Info.svg This code is in our Git repository here.

Note: If there is no information in this page about this code and it's a MediaWiki extension, there may be something at mediawiki.org.

We've been using GeSHi for our syntax highlighting for ten years now, and today I decided it was time to change to a client-side version instead. So I looked around on the net a bit and found a free open source one that I liked which was highlightjs.org, and made a quick wrapper for it which is this extension. It allows the same syntax to be used as normal, e.g. <source lang="LANG">. For more information about installation and usage, see MW:Extension:HighlightJS.

See also

  • highlightjs.org - Home page of the JS highlighter
  • CodeTidy - a utility to format code in accord with the MediaWiki code guidelines