TitleIndex Improved

I wanted to have TitleIndex on the front page of my Trac but didn't want the clutter of listing all the pages that are shipped with Trac (Trac*, Wiki*, etc.).

I've created a patch for class TitleIndexMacro to achieve my aims. There's an additional parameter ignore. When set to 1 TitleIndex will not list the built-in pages. E.g.

[[TitleIndex(format=group,ignore=1)]]

If ignore=0 or is omitted then it lists all pages.

Reported to Trac as ticket: Improved TitleIndex macro: optionally ignores pages shipped with Trac

Apply the patch to an existing install (patch saved in /tmp/).

First change to the directory where Trac is installed. If it is installed from my Debian package that is:

cd /usr/share/python-support/trac/trac

If it is installed directly into Python it will be something like:

cd /usr/lib/python2.5/site-packages/trac

Now apply the patch:

sudo patch -p1 < /tmp/trac-0.11b-wiki-macros.diff 
patching file wiki/macros.py

Restart apache2 and trac:

sudo apach2ctl restart

Attachments