Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts

    Javascript Syntax Highlighting

    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.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #2
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Never used it personally, but Geshi seems to be the most commonly used one:

    http://qbnz.com/highlighter/

  • Users who have thanked MattF for this post:

    Lamped (12-04-2010)

  • #3
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    Wow, that is a massive amount of code. I'll give it a try, thanks
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #4
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    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.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •