[pmwiki-users] InterMap use.

Patrick R. Michaud pmichaud at pobox.com
Thu Mar 2 21:54:48 CST 2006


On Fri, Mar 03, 2006 at 12:27:46AM +0100, a.steenveld at id.umcn.nl wrote:
> I noticed two things:
>  - In general InterMap shortcuts will not work when used 'naked' 
>    (such as in TOP:)

Yes, this is to continue to allow words to have colons after them.
For example, if an author writes

    My reasons for liking PmWiki:  it's cost-effective, fun, and easy to use.

we don't want the "PmWiki:" suddenly turning into a link.

>  - An InterMap shortcut always results in an external link even 
>    when it is a reference to the same page!

InterMap links aren't page links -- they're always treated as
external links.  For page links we normally use one of the other
markups.  

> Is there a way to let naked InterMap links work? 
> And is there an optimalisation possible to have references 
> on the same page just do that (and prevent the reload of the whole page).

I don't think that InterMap links are the way to go here --
I think you really want a custom markup.  My suggestion would be
to redefine "[top]" as a shortcut:

    Markup('[top]', '<links',
      '/(?<!\\[)\\[top\\]/', 
      '[[#top | top]]');

This simply replaces any occurrence of "[top]" in the markup
with "[[#top | top]]", which then generates a jump to top link.

Also, since the page content typically has <div id='wikitext'>
at the beginning of the page text, you could also define it as

    Markup('[top]', '<links',
      '/(?<!\\[)\\[top\\]/', 
      '[[#wikitext | top]]');

which prevents you from having to add [[#top]] markers to the
beginning of each page.  For example, see 

    http://www.pmwiki.org/wiki/Test/JumpTop#wikitext 

Or you could make it jump to some other automatically id= tag; the
appropriate one to use will probably depend on the skin you're
using.

Pm




More information about the pmwiki-users mailing list