views:

58

answers:

2

OK, I know, there are literally dozens of already available syntax highlighters out there. But I want one specifically, that implements line numbers through <ol/> lists. And that reduces the number of possible candidates to one, Lighter.js. Unfortunately, that is MooTools based, and since I decided some time ago to use jQuery, I don't want to embed yet another library just for syntax highlighting.

The SyntaxHighlighter does something similar, but uses tables for the line numbering, and I don't want to hack it, if there is an already available tool, too.

A: 

It seems that even my google-fu didn't do the truck to find this unicorn. I presume that you're left with:

  • either change your mind about using a separate library for syntax highlighting
  • or create this unicorn and make it available for the potential interested people out there
Arnaud Leymet
It shouldn't be a unicorn. `<ol/>`s should be the obvious method to do line numbering (e.g., GeSHi does it server-side), so I hope that there is a syntax highlighter in JS that does it as well and possibly without another dependency.
Boldewyn
+1  A: 

OK, I finally went with server-side:

PHP: Use GenSHi,

Python: Use Pygments.

Both are easily customizable, and I can cache the results, so there are no jumps on the page compared to an JS solution.

Edit: Seems, that my magical unicorn comes to a life: jQuery Syntax Highlighter

Boldewyn