Making Include.py Behave

When I upgraded to version 1.2 of MoinMoin a few months ago, the Include macro which I use to generate this blog, changed and started to print out the name of the included page in a big ugly banner above each page. I spent an embarrasing amount of time staring at the code trying to figure out how to change it, before cursing and giving up.

Fortunately for my sanity JosephSkinner email me the very very simple patch today. On line 218 of the Include.py shipped with version 1.2.2, change this line:

if args.group('heading'):

to:

if args.group('heading') and args.group('heading') != ",":

This may have unexpected consequences that I'm not aware of.

Update: In case you try this and get strange results be aware that that the Include macro is not cache aware. If you have problems with it including more then it's supposed to simply delete the cache from your moin data directory and let it automatically regenerate.


<- Back

Comments

I'm not sure you've got the line numbers right (i get 174), but hey, it works! You should add this info to both your page on Moin and the HelpOnInclude page. -- JosYule

AdamShand/2004-06-21 (last edited 2004-07-04 05:11:48 by AdamShand)