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

MoinMoin Version

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


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/IncludeTitlesOnlyCreatesUselessLinks (last edited 2008-03-18 16:50:13 by p5B055566)