In his continuing effort to redesign his blog, Shiflett.org, he's been working on one of the things that really makes a blog useful - the commenting system. Specifically, he wants site visitors to be able to add their own code listings to the comments they post. He gives more detail in this new post.
I've been playing with this tonight. Feel free to follow along as I go. The first thing you want to do is create an ordered list from the code you want to format ($code in these examples).
He gives an example of a listing using his system and explains how it all works. It's a mixture of:
- PHP for parsing the data inside the 'code' tags
- CSS to correctly style the information, whitespace and all
- Some ini settings to set parameters for...
- ...the use of highlight string on the PHP code contents