consolemediawikimediawiki-extensionsgeshi

GeSHi Syntax Highlighting in Mediawiki for command line


Does the Mediawiki extension SyntaxHighlight GeSHi come with highlighting support for bash/ash/sh, for example by coloring program arguments, strings and numbers or emphasizing commands? Example (this is SO highlighting for bash):

user@host ~/test $ ls "abc"
abc

Or is there some (generic) language definition which covers some of it?


Solution

  • Yes.

    <syntaxhighlight lang="bash">
    user@host ~/test $ ls "abc"
    abc
    </syntaxhighlight>
    

    gives:

    <pre>
    user@host ~/test <span class="nv">$ </span>ls <span class="s2">"abc"</span>
    abc
    </pre>
    

    Current display of the above output in my browser

    Note that the highlighter changed in recent versions of the extension.