[Pmwiki-users] a couple of questions

Jonathan Scott Duff duff
Wed Nov 3 09:33:16 CST 2004


On Tue, Nov 02, 2004 at 01:53:29PM -0600, Jonathan Scott Duff wrote:
> 2) How do I create a directive that acts as a container? For instance,
>    if the directive were (:foo:), the following sequence: 
> 
> 	(:foo:)XXX(:foo:)YYY
> 
>    would generate HTML something like 
> 
> 	<div class="foo">XXX</div><div class="foo">YYY</div>
> 
>    Looking at the source, I thought it might be something like
> 
> 	$BlockMarkups['foo'] = array('<div class="foo">', '', '</div>');
> 	Markup('foo','block','/\\(:foo:\\)/e',
>                "PZZ(\$GLOBALS['BlockMarkups']['foo'][0] = '<:foo>')"
> 
>    but that doesn't work.

Nevermind about this one; I looked at it with fresh eyes this morning
and realized how to do it (it was simpler than I had thought even):

	$BlockMarkups['foo'] = array('</div>','','<div class="foo">');
	Markup('foo', 'block', '/\\(:foo:\\)/', '<:foo,0>');

That /e on the RE kept tripping me up until I realized I didn't need
it.

-Scott
-- 
Jonathan Scott Duff
duff at pobox.com



More information about the pmwiki-users mailing list