Wikis – Add Salt and Pepper to Taste

Wikis are wonderful collaborative tools for project development teams. They’re lightweight, straightforward and usually fit in well with the way most developers think most of the time.

But occasionally, just occasionally one of your developers may be something of a black sheep. Maybe they don’t like the way a certain part of your corporate wiki looks, or want some customised behaviour for getting rid of irrelevant parts of the page. Maybe they want to improve their productivity (I know, an alien concept).

Take for an example a project I’m currently working on. One of our wiki pages is a rolling todo list, where new items are added under various categories as additional <li< elements in a list and as tasks are completed they’re struck out with a tag. As you can imagine, after a while, this page has become something of a swamp of strikethroughs and it makes it very hard to judge the amount of work remaining.

In some cases, custom stylesheets may be adequate. But in other cases, you may need a little more flexibility. “User Scripts” are a recently modern concept that have been popularised through the Greasemonkey Firefox extension for use with common web application such as Flickr, Facebook and Gmail. User scripts provide flexibility above and beyond the scope of the original application.

So why not apply this to wikis as well? So today, I wrote the world’s smallest user script to hide the deleted lines in the wiki:

$(document).ready(function () {
    $("del").parent().parent("li").hide();
});

You’ll notice that I’m using JQuery rather than vanilla Javascript. JQuery is my library of choice and there’s no reason why you can’t use yours either. There are a few solutions for loading JQuery at runtime, my preference is to simply copy the compressed version into the header of the script. Since the script is loaded locally, the additional 50k is neither here nor there.

For the Safari lovers, there’s also GreaseKit (Mac OS X only alas), which provides similar functionality. I’m currently using this since I’ve given up on Firefox for a while (I blame Caius).

Now I’ve got a cleared down wiki and I can focus a bit on what I’ve got left to do. You can too. Or comment with an idea for novel wiki functionality.