Search code examples
mediawikipygmentsgeshi

GeSHI new language


I running a mediawiki and want to use syntax highlighting. I am using the extension https://www.mediawiki.org/wiki/Extension:SyntaxHighlight for that.

That works pretty fine. Alas I want to highlight a language that is not part of this extension. So I wrote an python egg to extend pygments so it can parse my language (using entry points). This works fine.

Now I am struggling to get both to work together. How do I tell the GeShi Extension of MediaWiki to use my pygments extension? What do I have to do, so that using <syntaxhighlight lang="myLanguage"> will result in using my language lexer and style?


Solution

  • The solution was quite simple. One has to edit the file SyntaxHighlight_GeSHi.lexers.php and add the lexer. It's important to use only lowercase for the lexer name, otherwise the extension will not find the lexer.