[pmwiki-users] New {$$ } and {( )} markups [Was: Can any of the form recipes do this?]

Patrick R. Michaud pmichaud at pobox.com
Tue Apr 3 16:04:48 CDT 2007


On Tue, Apr 03, 2007 at 04:06:44PM -0400, The Editor wrote:
> 
> As it's not an urgent issue, I'll not rush into this as quick as Hans.

I'll repeat my earlier comment -- I'm not at all saying that ZAP
(or Fox) have to switch away from using {...} -- I'm just advising that 
based on my experience it's a bit of a risky markup choice for such
a specialized purpose, and that it might interfere with other
markups someday.  So there's no real rush.

(BTW, I found another potential conflict -- take a look at the
Confluence markup examples at http://www.pmwiki.org/wiki/Test/Confluence .
Confluence has markups for {column}, {section}, {ratepage}, etc.  Yes,
one can easily argue that here Confluence has made a poor choice for
markups... but since we don't control that markup language, there's
not a whole lot we can do about it.)

> I'm willing to use different syntax--I just don't want to lose 
> functionality:
> 
> count (group): ...
> thread (group): ...
> captcha: ...
> math: ...
> list: ...
> attr: ...
> source: ...
> php list:  ...
> Session vars: ...
> directives list: ...

My versions won't likely define any of these, so you're safe here
(or you can duke it out with other recipe authors :-).  But a few 
general observations on these, for whatever they're worth:

 - "count" may be too generalized a word to mean "count pages in a 
   group", especially since PHP already has a count() function that
   does something else entirely.  Perhaps "pagecount" or "grouppagecount"
   or "groupcount" would be more explicit.

 - My captcha implementation will be written as (:input captcha:).

 - it seems like "attr" really ought to be a page variable, since
   attributes are directly associated with pages.

> time: alternately, takes a number like 03 or 3 combined with w or m to
> return Tuesday, or March based on a configurable string.  Useful with
> Hg for page names like 2007-03-15 (ie using {$n2}).

Interesting.  Given a pagename like 2007-03-15, my version of this would be:

    {(time %B {$Name})}    # March
    {(time %A {$Name})}    # Thursday

I.e., there's no need to separate the pagename into parts.
The above will also work for pagenames like:

    20070315        # hyphens optional
    200703          # hyphens optional
    March2007       # english month+year
    2007March       # english year+month
    1172901600      # unix timestamps


In the more general sense, is there a difference between...?

    {(time)}
    {(date)}
    {(strftime)}

In other words, do we need all three?  

Pm



More information about the pmwiki-users mailing list