Skip to content

Hacking Trac 0.12

We use Trac at Isotoma. Actually that’s a bit of an understatement, we don’t just use it, it’s integral to our project development process.

Trac offers a wiki, ticketing system and svn browser out of the box, but it’s the increasingly featureful plugins API that allows you to adapt, hack and install to fit your purpose.

Home grown tweaks

We’re hopping a couple of versions and upgrading to 0.12 in the next few weeks and with it being a system that everyone uses daily, there’s been more than a few enhancement requests for the new installation.

Here are a couple of the plugins that made it through the requirements gathering process:

Isotoma Theme

Of course natively you can tweak the static content and templates to your hearts content. The TracThemeEngine plugin wraps this up into a neater package so you can customise your install to add extra markup, follow your own style, or even make it look like Alta Vista circa 1997. We plumped for following our own style.

HotKeys Plugin

My muscle memory often causes an involuntary “ctrl+s” when editing wiki entries. One too many save dialogs prompted this plugin which maps scripts to keyboard shortcuts using the JQuery HotKeys plugin (the version of jquery.hotkeys is from John Boxall’s fork on github, which allows inputs and textareas to be bound).

QuickTicket Plugin

RTM like input for quickly adding tickets.

As a side note, this plugin also hijacks a keyboard shortcut (“ctrl+q”  – used by Firefox, amongst others, for “quit”). An abominable accessibility crime to be sure, but we’re in the rare position here that we are our target audience.

WikiTable Macro

Adapted from work by optilude on Trac-Hacks, this macro allows SQL to be included in wiki pages to show query results in a table. We added DSN mappings that you add to trac.ini allowing you to query databases other than the current instance’s.

Third party plugins from Trac-Hacks

The invaluable Trac-Hacks should be the first port of call for looking into expanding on Trac’s functionality. For reference, here are a few of the plugins we’ll be implementing come the roll out:

Batch Modify Plugin

Allows users to modify several tickets together in one shot.

Timing and Estimation Plugin

For estimation and time tracking. We’re using the permissions branch.

Git Plugin

Essential. Enables Git support for the versioning system backend.

Further reading

The documentation on the Edgewall’s Trac site is pretty comprehensive:
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment

For help on the Genshi template language and content parser, again, you could do worse than looking at the documentation:
http://genshi.edgewall.org/

Join the mailing list here:
http://groups.google.com/group/trac-dev/

And finally, 9 times out of 10, someone will have written a plugin for it and submitted it to Trac-Hacks:
http://trac-hacks.org/