[pmwiki-users] Wikipaths (was: PData support for pagelisting images)

Patrick R. Michaud pmichaud at pobox.com
Thu Sep 7 16:01:26 CDT 2006


On Thu, Sep 07, 2006 at 01:22:33PM -0700, Martin Fick wrote:
> Speaking of radical, did you have any thoughts 
> about my proposal for what I am now thinking 
> of as "wikipaths", the idea of defining a more 
> generalized lookup grammar instead of just 
> defining {$:tex}? 
> 
> ie.:  {{page$section(index)...}} 
> 
> where section migh be: *,#,!,:,::[,(:directive:) 
> and more.
> 
> I have begun coding a small recipe, I'm sure 
> you could code one much quicker though.  Is 
> it something that you think would be too 
> complicated?  If so, to design or for authors
> to understand?

I think it's a bit on the complicated side, and
PmWikiPhilosophy #3 is gnawing at me with it.  With the {$:var}
markup, I can already see ways in which I can use it right away
(and there are many others who are clamoring for it as well).
With a more complicated markup, I'm less certain.

However, based on what you've written and what J. Meijer
has written (and I've had very little time to read them in
detail), at the moment I'm mentally toying with generalized
forms like:

    {(function args)Group.PageName#section$[:?]var}

Examples:

    {$Name}                     name of current page
    {(spaced)$Group}            group of current page, spaced
    {OtherPage$PageUrl}         url of OtherPage

    {$:XYZ}                     XYZ: field in current page
    {OtherPage$:Name}           Name: field in OtherPage
    {(toupper)OtherPage$:Name}  Name: field in OtherPage, all uppercase

    {OtherPage#section}         short form of (:include OtherPage#section:)

    {OtherPage#section$:var}    Var: field defined in OtherPage#section

    {(date %m/%d/%y)$Now}       current date as mm/dd/yy
    {(date %H:%M)$Now}          current time as HH:MM
    {(date %Y-%b-%d)$Name}      convert pagename like 20060907 to "2006-Sep-07"
    {(date "%B %y")$Group}      convert group like 200609 to "September 2006"

    {$?var}                     value of "var" from query string

I don't have any plans to try to grab values out of things such
as (:directives:) embedded in other pages; I think that's just waaay
too confusing.

However, all of the fancier forms are purely conjectural at this stage.
And I want to be careful not to completely consume the use of the
single braces strictly for page variable markups; they are valuable
bracketing characters (we don't have many of those around), and so
we should leave some forms open so that other recipes can use the
braces to mean other things.  This is why I like keeping the
dollar sign present in each of the above (and why I'm not
too fond yet of {OtherPage#section} as an include shortcut).

Pm




More information about the pmwiki-users mailing list