0

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.

Boldewyn
  • 81,211
  • 44
  • 156
  • 212

2 Answers2

1

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

Edit 2: And another one: snippet

Boldewyn
  • 81,211
  • 44
  • 156
  • 212
0

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
  • 5,995
  • 4
  • 35
  • 51
  • It shouldn't be a unicorn. `
      `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 May 25 '10 at 12:29