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

Martin Fick mogulguy at yahoo.com
Thu Jul 26 16:10:18 CDT 2007


--- Mike Shanley <thebarmy at omniversalism.com> wrote:
> Martin Fick wrote:
> > This doesn't seem that much different than
> pagenaming.
> >  With its advantages and disadvantages, not many
> > people would argue for sequentially numbering
> pages
> > instead of names would they? 
> > Perhaps the link code could be extended to look
> for
> > existing/non-existing anchors in pages and display
> > links to non-existing anchors slightly differently
> > making misspelled anchors more obvious?

> That said, the feature you suggested would also be a
> great help in general, particularly if extended to 
> the 'trouble with pagenames'.

Well, for that we already have the missing page
question mark, or are you suggesting something else?


> Also, how can we use this automatic anchoring to
> create quick TOCs? Generally speaking, an (:include 
> function that stripped everything but headers, 

The WikiPath recipe can do that in a rudimentary way
(not pretty), but it will not provide you with the
links to anchors to these new anchors.  To do that it
will need to be enhanced to include some form of
looping/templating similar to what you mention below. 
I originally had plans to do that but have somewhat
lost my drive for it, sorry. :(

Of course, a nice addition to any builtin anchor
creating mechanism would be a corresponding
MarkupExpression to recreate an anchor string which
might easily enable something like the wikipath recipe
and looping to generate the appropriate links to these
anchors (imaginary use and syntax):

[[#{(anchor "{{=$!}}")}]]


> (:pagelist toc= that tracked headers
> instead of trail= 
> tracking bullets would also work... My thought on
> this is that as long  as we are talking about 
> anchors across an entire wiki, we should also 
> provide a way to just as easily index these anchors.
> Right?

In this case one mechanism to 'get' the anchors for
use in the markup, could be something like {=$Anchor}
for just the anchor or {=$FullAnchor} for the pagename
and anchor.


-Martin



       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/



More information about the pmwiki-users mailing list