[pmwiki-users] About {$:var} text-variables
Américo Albuquerque
aalbuquerque at lanowar.sytes.net
Fri Sep 8 10:18:49 CDT 2006
On Fri, 8 Sep 2006 08:15:46 -0500, Patrick R. Michaud wrote:
> We're looking at a more natural way of setting variables than
> the recipes' (:set var=...:) markups. In other words, there are a
> lot of pages where
>
> Summary: a page summary ||Summary: ||a page summary||
> Version: 2006-09-08 ||Version: ||2006-09-08 ||
> Status: Stable ||Status: ||Stable ||
> From: Pm ||From: ||Pm ||
>
> are a lot more natural to write and display than
>
> (:set Summary='a page summary':)
> (:set Version='2006-09-08':)
> (:set Status='Stable':)
> (:set From='Pm':)
>
Ok but you'll still need some way to say that you want them to be set as
variables or every text that is written in the same way will also be set
as variable
For example, you might want to say
'''This is a title: of some importance'''
and it will probably will set a {$:This is a title} variable or a
{$:ThisIsATitle} variable, depending on the var definition
> In short, natural markups often make the best markup.
That is true but natural markup are many times ambiguous and it's
meaning depend on the context they are in
>
> We're also looking at a better way of extracting variables, by using
> {$:var} instead of {$var}, to make it clear it's coming from the page
> markup text. This helps to avoid conflicts that might arise from
>
> (:set Name='Patrick')
>
> which conflicts with the existing {$Name} page variable.
What would then be the difference between text variables and page
variables? Just their origin?
Currently all page variables are set in $FmtPV array. To avoid
overriding them you would also need another variable holder or even your
{$:Name} would still be accessed by {$Name} even though they are
different type of variables, or is this array just for custom page
variables?
Does this mean we can currently override default page variables by
setting $FmtPV['Name'] = "'Some other text that is not a page name'"?
>
> > Using the recipes above we define values that are not displayed. The
> > problem using either recipe is the same, you can't set the variables
> > inside a (:if:) and use it as a (:if:) clause at the same time without
> > changing the core and even there you can't expect it to work like it
> > would in a programming language
>
> Yes, we're not proposing to resolve this particular issue ... at
> least not yet. It's still the case that page variables would be
> defined for an entire page, regardless of any (:if:) constructs.
>
In http://www.pmwiki.org/wiki/Cookbook/Functions says that |PRR can be
used to apply all markups again to the current line. Is there a similar
function but that would apply to the entire text? I mean, from the
inline phase restart it back to the fulltext phase?
Américo Albuquerque
|
More information about the pmwiki-users
mailing list