[pmwiki-users] PublishPDF recipe updated to avoid /e modifier

Wolfgang Faust wolfgangmcq at gmail.com
Thu Feb 20 16:32:27 CST 2014

Couldn't you just use an anonymous function? Example:
Markup_e($name, $when, $pattern, function($m) { return $m[0]; });

Or perhaps I'm misunderstanding your problem.

On Thu, Feb 20, 2014 at 5:21 PM, John Rankin <john.rankin at affinity.co.nz> wrote:
> There is a new version of the recipe here:
> http://www.pmwiki.org/wiki/Cookbook/PublishPDF -- I think I have found and
> fixed every /e modifier. A big thank you to Petko for his advice on how to
> do this.
> I ended up creating a large number of "helper" functions where the callback
> doesn't need $pagename. I'd still like to see an option in pmwiki's Markup_e
> function that would let recipe authors write:
> $r = 'return';
> Markup_e($name, $when, $pattern, $replace, $r);
> which would use $CallbackFnTemplates['return'] = 'return %s;';
> Or have a new helper function with a very short name (eg CCR), so recipe
> authors could write Markup($name, $when, $pattern, CCR($replace));
> using function CCR($code) { return PCCF($code, 'return'); }
> A third option would be to write Markup_e($name, $when, $pattern, $replace);
> and let Markup_e decide which of the CallbackFnTemplates to use, depending
> on whether or not $replace contains $pagename.
> Thoughts?
> JR
> --
> John Rankin
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

This message has been encoded in 128ROT13 for security. If you are
unable to view it, please consult an optometrist.

More information about the pmwiki-users mailing list