( Update! 2010-08-20 ). This blog is not powered by Typo anymore, while Typo has since evolved for the better, I choose now to work with statically generated html with the help of Jekyll. I leave this post here anyway, for those who might need it for references.
How could I build a tech blog without proper code block highlighting?
Thats what I realised when I saw Typo coming a bit short in term of syntax highlighting. Not that there isn't one, but the Syntax textfilter included with the app is missing some languages definition in its arsenal to make it a decent choice, unless someone would only write Ruby, XML and YAML blocks in its blog. There is alway the prospect of writing a language module for Syntax but lets not rely on this for now.
I did a bit of research, and found three other syntax highlighting systems that suited Typo, with no coding or a minimum of coding required:
I tried hard to make Ultraviolet work... no problem on my development machine... but the hosted server never got to compile the first dependency, Oniguruma, adequately. So I jumped off the UV boat a bit depressed after a couple of days of hard labor. It was my first choice mainly for the large language palette, ignoring the speed issue which could have backlashed after regular usage.
So I turned to tmcode and Coderay. tmcode wasn't a bad option after all, giving the speed gain allowed by not having to process anything on the server at display time... and I happen to be both a Mac lover and a Textmate lover so there wouldn't be much pain in using this solution. But still, I wanted something I could use from any computer, so I embarked the CodeRay installation anyway... my language support of choice is not there at the moment, but the developper has a new version coming late september, which could change that consideration, and at worst, I could end up coding the languages support I need myself.
Installation is straightforward:
gem install coderay
Then what?
Typo has an ideal mechanism to integrate with CodeRay, called textfilters.
You can code one yourself by reading the Typo documentation on the subject: http://scottstuff.net/blog/articles/2005/08/23/introduction-to-typo-filters
which I did...
so you also have the option of using my implementation of CodeRay as a textfilter called CodeView.
Here it is: http://software.spiralix.org/typo/textfilter/typo_textfilter_codeview.zip
place this whole folder, unzipped, inside the vendor/plugins/ directory of your Typo installation and you are ready to go.
To get usage information, loggin to your Typo admin panel, under Settings->TextFilters you will find your CodeView macro with its help link to the far right of the page.