View Full Version : Looking for good code display plug in
stymiee
06-03-2008, 02:22 AM
I'm starting a new personal blog and one topic I will occasionally blog about is programming. I've seen blogs with really nice ways of displaying and handling code snippets. Any recommendations?
davemcnally
06-04-2008, 02:48 AM
I suppose it depends mostly on your personal preference. For my own blog, I decided to go without using a plugin as I didn't want syntax highlighting or horizontal scroll bars when displaying code and simply wanted it to blend in with the design.
Instead, I just use 'pre' element along with 'code' and manage how my code displays by styling pre within my css...It doesn't the functionality that some of the plugins do but it gives you more control of the look whilst keeping things simple if that's what you want :)
stymiee
06-04-2008, 03:54 AM
I am looking for syntax highlighting and scrollbars. :)
In another blog I run I just use <code> tags and style it like you do as generally I prefer simple myself.
davemcnally
06-04-2008, 01:07 PM
There's WP-Syntax (http://wordpress.org/extend/plugins/wp-syntax/) which offers support for multiple languages, syntax highlighting and correct formatting.
stymiee
06-04-2008, 02:11 PM
That looks very good. So far that looks like a winner. I have seen some blogs that also offer a plain text version of the code, presumably for copying and pasting. Is that available as a plug in? Or is that custom?
I tried searching through the WP plug in directory but it seems the terms I use for searching are too generic as I keep getting unrelated plug ins returned.
davemcnally
06-04-2008, 02:55 PM
Copying code should be fine with that plugin, if the code is displaying as it should without parsing, it should be fine to copy. To write out the code keeping in RAW format, I use < and > rather than < and >. Using entities makes sure Wordpress displays the code as it should be and doesn't execute it.
The plugin should also make copying the code simple without highlighting surrounding text but if not, overflow could simply be set to auto which is what I do for manual display copying.
stymiee
06-04-2008, 06:59 PM
I installed that plugin and I think it will work quite nicely. Thank you for the suggestion. :)
davemcnally
06-04-2008, 07:32 PM
I installed that plugin and I think it will work quite nicely. Thank you for the suggestion. :)
No problem, glad I could help :)
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.