Friday, 14 May 2010

Massive improvement with code snippets in this blog

I have been pretty unhappy with the way code snippets were shown in this blog. But I just stumbled upon a blog post that shows how to add syntax highlightning to them. I did it like that and added bsh and bash shell support by adding this line to the template
<script src='' type='text/javascript'/> 

and the results are very nice. It works for C, Perl, Java and Ruby, too (and others I won't list here)!

I also changed the template to one that stretches to the width of the window instead of using a very narrow column for the text - something that made code lines wrap all too easily.

.. and never mind that. I'll post the code snippets to Smipple, and add their embed script instead. It's a service that is somehow connected to Google as is Blogger so hopefully they will work well together.

No comments:

Post a Comment