Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Apply the 'anchor patch' to Trac (See related posts)

The 'anchor patch' adds support for a couple of very useful Trac macros:

* TocMacro
* RefMacro

To apply the patch without bothering the overworked TXD admnins, you can set up your own local copy of the Trac python package.

Assuming you have copied anchor.diff from

to your home directory, and that you are using bash and have a valid .bash_profile in your home (.profile will do too):

mkdir -p ~/lib/python2.4/site-packages
cp -R /usr/local/lib/python2.4/site-packages/trac ~/lib/python2.4/site-packages/
cd ~/lib/python2.4/site-packages
patch -p1 <~/anchor.diff
echo 'PYTHONPATH=$HOME/lib/python2.4/site-packages:$PYTHONPATH; export PYTHONPATH' >> ~/.bash_profile
python /usr/local/lib/python2.4/ ~/lib/python2.4/site-packages/trac

Now kill and restart tracd, and it should pick up the trac module in your home instead of the default.

Comments on this post

ludo posts on Jul 25, 2005 at 13:32
I always get 'Rails Application Error' when trying to edit a post, so here is an additional step you will need to let python use compiled versions of the local trac package files

python /usr/local/lib/python2.4/ ~/lib/python2.4/site-packages/trac
ludo posts on Jul 25, 2005 at 13:33
Uhm ,the above is unnecessary since you are running tracd as your own user, but it may be worth keeping in mind for similar situations. :)

You need to create an account or log in to post comments to this site.

Related Posts