Wednesday, March 2, 2011

0 comments

Greasemonkey Script to Use Trunk Version of Django Docs

On every page in Django's online docs, there's a little search field on the left so you can quickly look for the topic you're befuddled about. There's also a little drop-down that lets you pick which version of Django you're interested in. Recently, it was changed so that by default, the little drop-down is set to Django 1.2.

Right now, I'm much closer to trunk.

So. Here's a little GreaseMonkey script I wrote to ensure that I'm looking at the right docs even if I forget to switch the little drop-down thingy, and that I don't go insane trying to track down non-existant bugs.


// ==UserScript==
// @description Changes the default django search version
// @name django-docs-trunk
// @include http://docs.djangoproject.com/*
// @namespace http://www.blinkylights.org/gmscipts
// ==/UserScript==



sb = document.getElementById("id_sidebar_search_release");
sb.selectedIndex = 3;