[Pmwiki-users] Re: PmWiki 2 questions

Patrick R. Michaud pmichaud
Mon Sep 20 17:27:29 CDT 2004


A quick answer before heading off to another event...

> I don't think I explained very well. Suppose SomePage starts with
> 
> !!!Welcome to Spring in Wellington
> 
> Then any links to SomePage, say from HomePage, will gain a tool tip
> that reads 'Welcome to Spring in Wellington'. 
> 
> I couldn't think of an easy way to do this without a custom LinkPage 
> function.

Yup, this will require a custom LinkPage function.  In this case,
just use $LinkFunctions['<:page>'] = 'MyLinkFunction';

> I can't think of a way to do a page table of contents without doing 
> /something/ with inline markups (even if we only remove them). 

Oh, finding and removing them is fairly simple -- just go ahead and 
process the text (via MarkupToHTML) and then strip out the HTML tags.

> And
> if one is going to go to the trouble of finding and removing them, 
> one may as well process them. The problem is that one wants to 
> generate markup of the form [[#anchor | text]] where 'text' is
> pulled from (say) a heading line on the current page. As such, an
> author could have used a variety of markups that aren't currently
> allowed in link text.

Well, "not currently allowed" should read "not currently processed" in
link text.  The link text allows the other markups, they just don't get
handled as normal.

> It seems to me that there are 2 possible approaches:
> - process the required inline Markup calls before processing links
> - process designated Markup calls on the link text itself, as part
>   of MakeLink
> 
> In some ways, the second option might be safer, as it reduces the
> risk of unexpected side effects. For example, perhaps one might
> write:
>     Markup("''",'inline,linktext',"/''(.*?)''/",'<em>$1</em>');
> The first part gives the precedence, as now; the ',linktext'
> says also apply to link text. But it's a bit messy.

Very messy--I probably don't want to go there as it ruins the
symmetry of what is already working.  I'd prefer to move the
"safe" inline markups to be processed before link processing, or
rename the "inline" markup section to mean something indicative of
the fact that it occurs after link and block processing.

> Or perhaps $LinkTextMarkups = array("''","'''", ...); which
> lists the markups to apply to link text. 

The problem is that the LinkText isn't available at the time
"inline" is currently processed--the LinkText is held in Keep()
values at this point.  It doesn't get restored until just before
WikiStyles are processed.

Which of the existing markups should we allow to occur in link text,
and what conflicts might they have with links?  Would it be sufficient
to simply move the whole "inline" section to before "link" processing?
In a quick glance at PmWiki's default markup, I don't see a major
problem with this.

Pm



More information about the pmwiki-users mailing list