[dokuwiki] multiple same-name-section anchors

  • From: Michiel Kamermans <pomax@xxxxxxxxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 26 Aug 2009 03:14:31 -0700

Hi all,

With the bug tracker disabled at the moment I figured I might as well as whether someone ran into this before, and knew of a clever way to solve the the problem that comes with it: I have several pages which have multiple sections with the same name, such as pages that deal with basic grammar explaining different word classes, with each word class having a "details" subsection. It would be counterproductive to put these sections on their own pages, as it would completely destroy readability, but this means it is impossible to link to these sections, as dokuwiki only generates a "details" anchor, for each of them, rather than a nested or enumerated anchor:

main section
 nouns
   details
 verbs
   details
 adjectives
   details

becomes

#main_section
#nouns
#details
#verbs
#details
#adjectives
#details

Which means that anything pointing to mydokuwiki/wiki/doku.php&id=page#details will point to the details subsection of nouns.

Consequently, editing any of the details sections and hitting "save" will redirect to the noun's subsection... What would be a clever way to cope with this? I was initially thinking enumerations for multiple sections, so that the first section would be anchored as "details", and the second as "details_2", the third as "details_3" etc, but this would be ugly from a usability perspective. I'm currently thinking that a nesting check would probably be more functional, so that for multiple sections with the same name, the anchor also contains the name of the containing section (such as #nouns_-_details) although of course this introduces the (arguably far rarer) problem that if a page has a section "A - B" with subsection "C", as well as a section "A" with subsection "B - C", there would again be an anchoring conflict.

Ideas? Solutions?

- Mike "Pomax" Kamermans
nihongoresources.com
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: