How to display code samples on a blog page ? |
[eluser]opel[/eluser]
I have almost finished writing my blog and hope to include code snippets and tutorials inside articles. Can anyone recommend a CI library or JQuery plugin that can highlight the code, possibly offering a plain text version. I found many plugins for wordpress but no stand along options ? Cheers
[eluser]eoinmcg[/eluser]
Hi Opel, I've experimented a bit with Chili, which is jQuery based. Have a look here: http://code.google.com/p/jquery-chili-js/
[eluser]Evil Wizard[/eluser]
php already has a function built in to highlight source code files, see highlight_file()
[eluser]n0xie[/eluser]
[quote author="Dam1an" date="1244653797"]The most common library for this is GeSHi, there's also a CI plug-in[/quote] In case anyone is interested I rewrote parts of it to make it a library instead of a hook. I don't need it checking/loading GeSHi on every page load plus I like to be able to just 'drop it in' a project and just add codehighlighting for certain views. It's pretty much hacked together so it's rather inefficient and crude, but if it works, don't fix it
[eluser]Phil Sturgeon[/eluser]
[quote author="Evil Wizard" date="1244657796"]php already has a function built in to highlight source code files, see highlight_file()[/quote] Hmmm... font tags. My favourite.
[eluser]Evil Wizard[/eluser]
oh crud I forgot how old that function was, hmmmmm not sure of an XHTML compliant alternative hehe
|
Welcome Guest, Not a member yet? Register Sign In |