[pmwiki-devel] LinkUrl / LinkTxt question

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 6 13:06:27 CST 2007


On Tue, Feb 06, 2007 at 12:12:08PM -0500, The Editor wrote:
> On 2/6/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >On Tue, Feb 06, 2007 at 08:45:12AM -0500, The Editor wrote:
> >> Just a quick question (second post)...
> >>
> >> Is there any way you can reset how the link text is displayed in a wiki 
> >page?
> >>
> >> That is, I have the Hg recipe converting the pageurl as desired, and
> >> have it resolving properly as well (almost, see below).  But in two
> >> instances the displayed link text does not match the actual link.
> >> Specifically:
> >>
> >> 1.  [[Group/Group]] links to Group/HomePage but displays as
> >> Group/Group (ie Group).  Not all bad but could be misleading.
> >> Group.HomePage displaying as Group.Group is a bit more problematic.
> >
> >You want [[Group/Group]] to link to Group.HomePage?  Why would
> >we want that?  PmWiki's philosophy is to honor what the author
> >writes and not attempt to second-guess it.
> 
> Actually what I want is for [[Group.]] to link to Group.Home or
> whatever I set it to. 

I'm working on this.

> >> 2.  [[Group.]] links to Group/HomePage but displays as "Group.".
> >> Again, not terrible but the dot is easy to miss.
> >
> >PmWiki's philosophy on link text has generally been that whatever
> >is inside the double brackets is what should be displayed as the
> >link text.   The exceptions are that parens and slashes are
> >convenient shortcuts for suppressing part of the link text.
> 
> Default PmWiki has the same problem Hg has in the instance of
> [[Test.]].  Whether considered a bug or a feature, the linktext is
> "Test." while the linkurl is "Test.Test". 

It's a feature.  Whatever the person writes in the brackets is what
should be displayed.  If the author had wanted to have "Test.Test"
as the link text, she would've written [[Test.Test]].

> Is there a reason the linktxt cannot be set to the pageurl instead of
> the linkurl (when no title is supplied)?  

I don't understand this question -- for links to pages (that don't
have ?query= or #anchor fragments), the pageurl and linkurl are
exactly the same.

> Or is it a big project to tweak PmWiki to enable the defaultname
> setting to be used when pages do not exist?  

It's not a big project -- I just have to figure out the appropriate
configuration variables to introduce to make it happen.

> Or a last option, is it possible to redefine LinkPageExistsFmt by a
> function that is passed linkurl, linktxt and pageurl, and rewrite the
> output in the formula using conditionals, etc.  Is that possible?

I'm not planning to do that.  The way to get that capability
would be to define a custom version of LinkPage().

Pm



More information about the pmwiki-devel mailing list