[pmwiki-users] {(...)} markup recipe available

Patrick R. Michaud pmichaud at pobox.com
Fri Apr 13 11:42:27 CDT 2007


On Fri, Apr 13, 2007 at 11:35:50AM -0500, Tegan Dowling wrote:
> On 4/13/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >On Fri, Apr 13, 2007 at 10:59:51AM -0500, Tegan Dowling wrote:
> >> The pagelist is also working.  This is great!
> >>
> >> Now, in a GroupHeader, I'd like to have
> >> ! (:if pagename-format is text:){$Titlespaced}(:else:){(ftime ''
> >> {$Name})}(:ifend:)
> >
> >How about something like...?
> >
> >   (:if name 200[0-9]*){(ftime '' {$Name})}(:else:){$Titlespaced}(:if:)
> >
> >Any page with a name starting with "2000" through "2009" will be
> >treated as something to be passed to {(ftime)}.
> 
> That'll work!  Or, actually, is this syntax right: (:if name 20[00-99]*)?

No -- that would match anything beginning with 201 through 209.
If you want to check the second digit as well, it needs to be

    (:if name 20[0-9][0-9]* :)

> Would be great, if there's a call for it.  Would that come in handy if
> someone were going to try doing conditionals based on *what* the date
> is - e.g. "is the date of the name greater than today?" etc.?

I'm planning to have a range conditional that does this somewhere.  
It may simply become an extension of the (:if date ...:) conditional:

    # pagename is greater than today
    (:if date {(ftime %F)}.. {$Name}:)

    # pagename is before today
    (:if date ..{(ftime %F yesterday)} {$Name}:)

Pm



More information about the pmwiki-users mailing list