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

John Rankin john.rankin at affinity.co.nz
Thu Feb 20 16:53:49 CST 2014


I think you are correct (will need to test to make sure -- it's probably 
Markup rather than Markup_e). I was trying to make the usage similar for 
all cases. Since pmwiki uses create_function for Markup_e (through 
PCCF), that's the approach I proposed. The third option, where all 
callbacks go through Markup_e, seems cleanest to me.

Thanks
JR

On 21/02/14 11:32 AM, Wolfgang Faust wrote:
> 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
>
>

-- 
John Rankin
Affinity Limited
T +64 4 495 3737
M +64 21 726 546




More information about the pmwiki-users mailing list