[Pmwiki-users] edit-exit

Patrick R. Michaud pmichaud
Sun Sep 26 07:49:04 CDT 2004


On Sun, Sep 26, 2004 at 02:34:41PM +1200, John Rankin wrote:
> On Sunday, 26 September 2004 8:20 AM, Knut Alboldt <mailing at alboldt.de> wrote:
> 
> >> > What I thought about is entering e.g. "<<" and translate it to "[:" and
> >> > ">>" and translate it to ":]" (or any other) before saving the page.
> >> > Is there an easy way to process this within the edit-save-procedure
> >> > (concerning pmwiki2) without changing pmwiki.php (e.g. as an exit which 
> >> can
> >> > be hooked up in config.php ?
> >>
> 
> Note that this would break any trail markups: 
> 
>     <<|TrailPage|>> would become [:|Trailpage|:]

Oh yeah.  Umm, one could do this:

   $ROSPatterns['/<<(\\w.*?)>>/'] = '[:$1:]';

which would at least convert the <<...>> in pairs (thus not converting
[[<<]]) and would make sure that whatever followed the << was
a letter or digit.

And if more control is desired, one could do:

   $ROSPatterns['/<<((include|redirect|nogroupheader|title|...).*?)>>/'] =
     '[:$1:]';

which makes sure to get only certain directives.

And, of course, {{...}} is available for use again in 2.0, if an
administrator wants to do that.  I'm personally reluctant to say
"this is what the alternate directive markup should be", since there
didn't seem to be a clear favorite in the previous discussion 
(http://www.pmwiki.org/pmwiki2/pmwiki.php/Development/DirectiveMarkup).
So instead I'm just giving each administrator the option to choose
whatever alternative(s) suit her/him the best.

All of this probably belongs in a 2.0 cookbook recipe.  :-)

Pm




More information about the pmwiki-users mailing list