...

View Full Version : Javascript Syntax Highlighting



Lamped
12-03-2010, 10:17 PM
Good day,

I've started a mini-project on stealthiscode.net - I've been meaning to give some of my code away for some time now. I want to include syntax highlighted code snippets and really have better things to do than write my own.

I've resorted to highlight_string() for the PHP code (I had some lovely code working with token_get_all(), but the damn thing compresses whitespace...)

Can anyone recommend a *good*, well written Javascript syntax highlighter in PHP?

Chiz muchly.

MattF
12-03-2010, 10:47 PM
Never used it personally, but Geshi seems to be the most commonly used one:

http://qbnz.com/highlighter/

Lamped
12-03-2010, 10:58 PM
Wow, that is a massive amount of code. I'll give it a try, thanks :)

Lamped
12-04-2010, 12:00 AM
I've implemented it now, and I'm very impressed. The way it integrates CSS is a little awkward, but I made a caching php script to combine a bunch of relevant CSS...

Thanks for the tip.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum