3

I'd like to syntax highlight Mathematica code on a MediaWiki site. I've already installed the MediaWiki extension SyntaxHighlight GeSHi and verified that it works for other languages.

I tried simply putting a Mathematica langauge data file mathematica.php into MediaWiki's extension path wiki/extensions/SyntaxHighlight_GeSHi/geshi, however it didn't correctly highlight a Mathematica code block such as:

<syntaxhighlight lang="Mathematica">
(* this is a comment *)
List[Sin[x], Cos[x], Tan[x]];
</syntaxhighlight>

Any ideas?

MathCraft
  • 131
  • 2

2 Answers2

1

I do not see Mathematica listed as a supported language at http://qbnz.com/highlighter/, so I suppose GeSHi simply doesn't know it. I suppose you could contribute the respective highlighting code to the geshi project, if you like.

brightbyte
  • 971
  • 4
  • 10
0

you need modify geshi.php, function get_language_name_from_extension to be specific, for added language definition to be recognized.

zxz
  • 1
  • 1
  • 4