[pmwiki-users] RFC: hypothetical PageVariableExtensions recipe
Dominique Faure
dominique.faure at gmail.com
Wed Apr 12 10:28:49 CDT 2006
Hi,
I've some code in my porfolio which may become a
PageVariableExtensions recipe if I could handle the last issues. But
for now I need some feedback to know if I should pursue in the same
direction or not. This recipe recipe would essentially be intended to
power-users/admins, providing some markup and string manipulation
functions to page variable syntax (this is in fact a rewriting of the
former Properties recipe which is now broken in PmWiki 2.1):
(:initvars myvariable='my value' answer=42:)
This markup defines two variables. Despite their values are provided
with the regular syntax: {$myvariable} or {$answer}, they couldn't be
reached directly from other pages as in {Group.Page$answer} (BTW, this
is the 1st and I fear unavoidable issue).
Variables could also be initialized from other previously defined
variables or deleted:
(:initvars copy={$original} -deletedvar:)
Variable values (both predefined and recipe initiated) may be altered
with the (new) function syntax as in:
(:initvars firstname=dominique:)
I usually sign with "{$firstname:sub 0 3:ucfirst}"
which renders as:
I usually sign with "Dom"
or in the same mood:
(:initvars yesterday=20060411:)
* {$Now:ftime '%Y-%m-%d %H:%M:%S'}
* {$yesterday:fdate '%B %d, %Y'}
renders as:
* 2006-04-12 16:57:49
* April 11, 2006
aka, functions are separated with ':', accept arguments and are
chainable. The second issue is that I couldn't (for now) mix variables
and conditions:
(:initvars var='something':)
(:if false:)
(:initvars var='nothing':)
(:if:)
var's value is {$var}
renders as:
var's value is nothing
which is not what is expected.
Thanks in advance for your feedback,
Dom
--
The difference between theory and practice in theory is much less
than the difference between theory and practice in practice.
— Randal L. Schwartz
More information about the pmwiki-users
mailing list