[pmwiki-users] Nested IF

Peter & Melodye Bowers pbowers at pobox.com
Thu Apr 24 10:13:49 CDT 2008


> Thursday, April 24, 2008, 2:24:43 PM, Peter & Melodye Bowers wrote:
> 
> > PS I don't think much of the way this looks in terms of being
> understandable
> > and intuitive.  ...
> 
> Would it be possible to create if markup similar to the div markup,
> which accepts digits after the 'if' which act as identifier, to help
> identify beginning and end of a conditional?
> Example:
> 
> (:if1 ....:)
>   ...
> (:if2 ....:)
>   ....
> 
> (:elseif2 ....:)
>   ...
> (:if2end:)
> (:elseif1 ...:)
>   ...
> (:if1end:)
> 
> This will make it much clearer from where to where a 'nesting' goes.

Would the number need to be prescriptive or just descriptive?  In other
words, if someone wrote (:if1 ...:) ... (:if2end:) then should there be an
error?  Or should it not match the markup at all (thus leaving it verbatim
without replacing anything)?  Or should the difference in numbers just be
ignored?

I like the idea of a number because it differentiates from a normal
if/else/ifend markup while still looking like "if" ("if0" looks more like
"if" than "nested-if" or the other options).  Also it does help since a
wiki-page doesn't usually allow for nicely indented code to help you find
your way through the nesting, so these numbers could be very valuable...

-Peter




More information about the pmwiki-users mailing list