Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

November 16, 2004

Small Patch to pwyky

Inspired by Stuart Langridge I took a look at pwyky today. I've been wanting to put a wiki on this site for a while, it's just been languishing near the bottom of my todo list. This looked just the thing for me though, and at under 30k of code in a single file I thought it would be possible to install and configure it in my lunch hour.

Sure enough, in about ten minutes I had downloaded the script and got it running on my iBook. Before I put it up on my public web site I wanted to make a minor tweak, and that was to get it looking the same as my other pages. Whilst I could have edited the supplied stylesheet I wanted to keep my site simple. Ideally I wanted to reference my existing site wide stylesheet in pwyky. I could have just hacked the script to reference it but looking at the code it didn't seem too hard to do a proper job and make the stylesheet a configuration parameter. The code is nicely written and easy to tweak so adding it was a breeze.

After a little bit of tinkering my work was done and you can see it in operation here. Because pwyky is GPL code, and in the spirit of the commons, I thought I should make my patch available. For those that are interested I've posted it to my code directory. Just download and follow the normal installation instructions which can be found on the pwyky home page.

The only difference from the standard version is the addition of an extra parameter stylesheet. It should point to the stylesheet relative to the document root of your web server. So, for instance, my wiki is in /wiki but my stylesheet is in /styles. All I did was add an extra line to my config.txt file which looks like this;

stylesheet: /styles/halfcooked.css

As with the other configuration parameters for pwyky, if you don't specify it in your configuration file then the default is used.

Posted by Andy Todd at November 16, 2004 07:24 PM