Description
The include macro when called with the titlesonly option creates all the links to the top of the included page, not to the individual headings like is implied.
Details
Python Version
- 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)]
MoinMoin Version
- Release 1.5.4 [Revision release]
Workaround
Here is a patch to fix the problem, it generates the links with the anchors
Index: Include.py =================================================================== --- Include.py (revision 182) +++ Include.py (revision 183) @@ -159,7 +159,16 @@ result.append(macro.formatter.bullet_list(1)) levelstack.append(level) result.append(macro.formatter.listitem(1)) - result.append(inc_page.link_to(request, title)) + + import sha + from MoinMoin import config + # Encode stuf we feed into sha module. + pntt = (inc_name + title).encode(config.charset) + hid = "head-" + sha.new(pntt).hexdigest() + + result.append(inc_page.link_to(request, title, anchor=hid )) result.append(macro.formatter.listitem(0)) while levelstack: result.append(macro.formatter.bullet_list(0))
Discussion
Give an example here:
why doesn't this work?If some Include macro user fixes above syntax, I'll have a look at it. I personally don't use Include (at least not more than a very basic operation). -- ThomasWaldmann 2006-10-05 21:19:15
Plan
- Priority:
- Assigned to:
- Status: