Code Friendly Block Quotes

I have a self-hosted WordPress Blog (located at http://www.dougmolineux.com/wp if you’re interesed 🙂

I put a lot of Code Snippets on there, because I’m a programmer. How do I make these “snippets” code friendly? Right now, I am using a simple Blockquote around each one and it converts all single and double apostrophes into strange symbols that will not work when the code is actually copied and pasted.

I am willing to convert to a new theme, or alter an existing one.

Thanks!

3 Answers
3

geshi

Geshi

In general the Geshi library is a popular library for formatting code ( http://qbnz.com/highlighter/)

Geshi as a WordPress plugin

For WordPress several authors “packaged” Geshi in a plugin. take your pick:
http://wordpress.org/extend/plugins/search.php?q=geshi

The one I use

Personally I use this plugin: http://wordpress.org/extend/plugins/codecolorer/. This one works by enclosing all pieces of codes with a [cc lang=”bla”] code [/cc] tag where you can specify things like language, width, line numbering, etc…

Example

geshi example

Leave a Comment