Sunday, July 4, 2010

Blog clog

No sooner had I fixed the last problem with this blog, I returned home today to discover that Alex Gorbatchev who writes and maintains SyntaxHighlighter [SH], which I use to highlight the code on this blog, had made a major revision up to ver. 3.0.83 and guess what, it broke all the highlighting on my previous R code, even though the code highlighted by other brushes looked fine. My R code looked like a dog's breakfast. Since the R brush was written by someone else, I assumed that the changes to SH had made the brush incompatible with the new SH. I looked at the changes in the new version and decided on balance that I needed the R brush fixed more than I needed the new features of SH. So I started upon fixing the mess.
  1. I decided to download the last version of SH (where all my codes rendered properly) and host it myself. Previously, I was using the versions Alex was hosting on his server space and which he periodically updated with new versions.
  2. Since most of SH is JavaScript [JS], and I have had enough of hosting JS at random places on the internet (most uploading sites do not accept JS, so you need to find specific places that will), I decided to muck around with hosting it on a Google Code project. I re-used the project I had created to host the JS of the $LaTeX$ renderer. I decided to wait until I had figured it out to create a separate code project to host SH.
  3. This allowed me to do something I have always wanted to figure out - see how version control software works. I had installed Tortoise SVN eons ago but never used it. It was pretty simple as I just followed the instructions here.
  4. The main thing was to figure out how to set mime-types for the various files whether they be CSS or JS. I learnt how to do that here.
  5. Finally, I replaced the Blogger HTML template with the new links to the JS files associated with SH.
Then I spent half-a-day scratching my head because after checking everything, it would still not work (the R code rendered with visible errors). After much staring at the screen, I realised that the old SH versions were arranged chronologically rather than reverse-chronologically as I had expected and I had downloaded the oldest available minor revision of release 2! Quickly rectified and sanity was restored!
All that now remains to be done is to migrate all the SH code to a new code project which will contain all the JS associated with this blog, including the $LaTeX$ renderer. Then I can be free of the whims and fancies of developers and servers!

No comments: