[pmwiki-users] pmwiki-2.2.0-beta2 released ({$:var} markup)

Patrick R. Michaud pmichaud at pobox.com
Mon Sep 25 16:03:02 CDT 2006


I've just released pmwiki-2.2.0-beta2, now available from:

    http://www.pmwiki.org/pub/pmwiki/pmwiki-2.2.0-beta2.tgz
    http://www.pmwiki.org/pub/pmwiki/pmwiki-2.2.0-beta2.zip
    svn://pmwiki.org/pmwiki/tags/latest

This release adds the long-awaited support for page text variables
and the {$:var} markup.  

Essentially {$:var} can be used to extract values from pages 
containing any of the following markups:

    var: value              # line beginning with "var:"
    :var: value             # definition list form
    (:var: value:)          # directive form

The directive form is special in that it doesn't display anything
in the generated output, and it can accept multi-line values.

Page text variables can be read from other pages by using the
{PageName$:var} form of markup.  Thus, if a page named "ABC"
defines

    First: Alice
    Last: Adams

then another page can access the page text variables by using
{ABC$:First} and {ABC$:Last}.  This also works in pagelist templates
with the {=$:var}, {<$:var} and {>$:var} markups.

If $EnableRelativePageVars is set (see announcement and release notes 
for pmwiki-2.2.0-beta1), then page text variables are relative 
to the page in which they are written.  Thus, if page ABC has

    First: Alice
    Last: Adams
    Full: {$:First} {$:Last}

then {$:First} and {$:Last} are taken from the page in which they
are written, thus {ABC$:Full} will have "Alice Adams".

Since this is a new feature that we're still experimenting with,
I should point out some important caveats:
  - If a page has multiple definitions for the same variable,
    there's no guarantee as to which value will ultimately be 
    returned.
  - It's not clear how [=...=] escapes in values will be handled
    in the long run.

The [$:var} feature is now enabled throughout pmwiki.org, for 
those who wish to test and experiment with it there.  I'm expecting
to revise PITS and the Cookbook to take advantage of this new
markup capability in the very near future.

Comments and questions welcomed as always.

Pm




More information about the pmwiki-users mailing list