[pmwiki-users] Re: Re: Re: Some documentation added for "markup variables" (Was: How to add a variable to {$var}-markup?)

chr at home.se chr at home.se
Tue Jul 5 16:12:54 CDT 2005


On Tue, 5 Jul 2005, Patrick R. Michaud wrote:

> On Mon, Jul 04, 2005 at 08:35:26PM +0200, chr at home.se wrote:
> > 
> > Example 1: For unknown reasons, we want '{$PageNameInLowerCase}' to always
> > return the name of the current page using only lower case letters. Would
> > this be possible to do using $GLOBALS['var'] = ...?
> > (I suspect this quite trivial, I just want a simple illustrating example
> > to put on the page where this is documented)
> 
> No.  There is no generalized global-variable-to-markup rule, because
> doing so might expose data or settings that are better left private.
> Any variables to be made available via markup have to be explicitly
> done so via a markup rule of some sort.

Guess I wasn't clear enough this time either... :-)

So how about if you look at this example and tell me if it'll fly... 

	http://www.pmwiki.org/wiki/PmWiki/MarkupVariables#ex1

> > Example 2: For unkown reasons, we want '{$tic-toc}' to return the current
> > time in system ticks (or milliseconds or whatever). In order to get this,
> > some function would have to be invoked for each instance of '{$tic-toc}'
> > that is to be replaced. Note that the funtion must be invoked once for
> > each occurence of "{$tic-toc}".
> 
> Markup('{$tic-toc}', '>{$var}',
>   '/\\{\\$tic-toc\\}/e',
>   "array_sum(explode(' ',microtime()))");

Thanks, I added this here (although it's probably too complicated as a
"simple" example):

	http://www.pmwiki.org/wiki/PmWiki/MarkupVariables#ex2



I guess what's really needed is a good description of Markup() together 
with plenty of examples of how to use it. So I searched pmwiki.org and 
found the description here:

	http://www.pmwiki.org/wiki/PmWiki/CustomMarkup

In order to make it easier to find the page above, I added small entry 
here:

	http://www.pmwiki.org/wiki/PmWiki/Functions#Markup

that primarily refers to PmWiki.CustomMarkup.

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list