You're viewing a single post. I have much more to say! The main blog page is a good starting point.
Thursday, March 6, 2008 ★ 13:29 ★ Category Programming
Recently I’ve become a fan of using Trac for various projects I’m involved with, both professional and personal. The only issue I’m repeatedly having is the lack of a useful navigation box for hierarchical wiki pages. Existing navigation macros and plugins just don’t fit my needs, since they require you to build a menu yourself or make wrong assumptions. Fortunately, writing a plugin is not that hard…
I’m presenting you my shiny new SiblingNav plugin for Trac (tested with version 0.10.4). It looks like this on a subpage in a hierarchial wiki structure:
This plugin adds a
[[SiblingNav]] wiki macro resulting in a listing of the wiki path leading to the current page and a list of sibling pages. This is only useful for a hierarchic wiki structure, e.g.
Meeting/20080218 is a subpage of
Meeting. This plugin does the right thing for both top pages and subpages.
The macro accepts an optional argument with the page prefix for which to build a navigation menu, e.g.
[[SiblingNav(Meeting)]] If omitted, the current page name is used. This covers the vast majority of use cases.
The output is modeled after the standard trac navigation and some other plugins, i.e. it uses the wiki-toc class on the surrounding HTML div, so it should show up as a familiar navigation pane.
You can get this plugin by either branching the Trac SiblingNav Bazaar branch like this:
bzr branch http://uwstopia.nl/geek/projects/trac/SiblingNav.uws/
...or alternatively by just copying the
SiblingNav.py file to your
Give it a try if you’re looking for something like this! Feedback is welcome!
Wouter Bolsterlee, also known as uws, a postmodern geek living in the Netherlands. Read more about me…
Unless stated otherwise, all material on this site is available under a Creative Commons Share-Alike license.