[pmwiki-users] Automatically add anchors to heading tags?

H. Fox haganfox at users.sourceforge.net
Sun Jul 29 20:58:10 CDT 2007


On 7/29/07, christian.ridderstrom at gmail.com
<christian.ridderstrom at gmail.com> wrote:
> On Tue, 24 Jul 2007, H. Fox wrote:
>
> > On 7/22/07, christian.ridderstrom at gmail.com
> > <christian.ridderstrom at gmail.com> wrote:
> >>
> >>  If we worry that an
> >>  enumerated heading becomes incorrect if a heading is inserted before it,
> >>  remember that a similar thing happens if you change the heading text.
> >
> > No it doesn't.  If the section's anchor is determined by heading text it
> > will not be affected by inserting other headings.
>
> Please read me sentence again.

I stand corrected... sort of.

> If you change the heading text, the anchor
> lable will change. A changed anchor label is a problem that is similar to
> what you would have if anchor labels were determined from their number,
> i.e. if this is heading one, two, three etc. In this case, inserting a new
> heading means that the old label of say "toc3" will refer to the wrong
> entry.

[+] It's reasonable for an author to expect a heading like "!!See
also" never to change.
[+] It's extremely easy for an author to learn target a section by
name (#see_also for !!See also)  without peeking at the HTML source.
[+] An author who knows about the feature can be expected to
understand that fragment ID will change when the heading changes.
[+] It's easy for an author to insert a [[#see_also]] anchor when
changing the text of a heading.[1]

[-] It's *not* reasonable to expect a "!!See also" link to remain the
same in a dynamic-number system.
[-] Guessing a headings dynamic-number name seems error-prone at best.
[-] Inserting a heading manually in a dynamic-number system will not work.

[++++] One's level of Author Surprise is very low, even (probably zero
in a single-author site) and there's a workaround.
[----] The other's other's lever of Author Surprise very high, without
no workaround.

> The point is really that neither system is very good.

The point is that neither is perfect, IMHO one is unworkable and the
other is pretty good.

Sounds like I'd use it and you wouldn't.  There are a lot of features
like that in PmWiki, which is why

   $EnableAutoAnchors = 0;

or something similar will be available if the feature is added to the core.

Hagan

[1] (:pagelist:) could be used to discover if a link with the anchor exists.



More information about the pmwiki-users mailing list