[pmwiki-users] RFC: hypothetical PageVariableExtensions recipe

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 12 11:58:57 CDT 2006


On Wed, Apr 12, 2006 at 06:40:56PM +0200, Dominique Faure wrote:
> > ...welcome to PmWiki's chicken-and-egg problem.  The question is
> > one of ordering -- in this case, the ordering between the
> > (:initvars:) markup and the (:if:) markup.
> >
> > If we say that (:initvars:) is to be processed before (:if:),
> > then one cannot use conditional markups to control (:initvars:).
> > [...]
> > What order are you planning to use for (:initvars:), {$...},
> > and (:if:) markups?
> 
> I'm already using a "cheat" to allow (:initvars var1={$var2}:), having
> it defined before {$vars}:
> [...]
> and forcing variable evaluation when handling markup parameters [...]
> 
> I was wondering if something equivalent couldn't be done with
> (:if:) markup ?

This essentially means that we'd have to move the (:if:) markup
to be processed before variable substitution also.  That would
break any custom markups that are currently depending on being 
run after variable substitution but before (:if:)  (I don't
know if there are any.)

I'm wondering if it would be worthwhile to somehow
say that (:initvars:) and variable substitutions take place 
only up to the first (:if:) that occurs in the text --
anything that comes after an (:if:) has to wait until
after the (:if:) has been processed.  Then the (:if ...:)
directive can perform variable substitution on its arguments,
and then restart processing again with initvars and variable
substitutions.

But this still could run into problems if there are markups
that expect to run after variable substitution and before (:if:).
I'll have to think about it a bit more.  (And if anyone knows
of a markup that does fall in this category, now would be a good
time to speak up. :-)

Also, a note here that I'd like to reserve the (:property:)
and (:var:) directives for PmWiki to possibly use 
(expecting this to become a core feature after we iron out
the difficulties).

Pm




More information about the pmwiki-users mailing list