[pmwiki-users] Re: Cookbook recipes updated for beta 19 compatibility

Patrick R. Michaud pmichaud at pobox.com
Tue Jan 25 17:50:06 CST 2005


On Wed, Jan 26, 2005 at 11:24:23AM +1300, John Rankin wrote:
> >
> >Another thought is that maybe it'd be nice with an easy way to choose 
> >which of these markups you activate? (Without having to edit the actual 
> >script, which will break as soon as you download the latest
> >version).
> >
> 
> In principle, we just need an array of $MarkupsEnabled.
> An administrator could then write, for example:
>    $MarkupsEnabled['dropcaps'] = 0;
> to disable drop capitals from config.php.

Guess what -- this already exists (although it's not obvious or
documented at the moment).  Only the first instance of a call to 
Markup() is used, so one can do

   Markup('dropcaps', '');
   Markup('^!', '');

to disable the 'dropcaps' and '!' (headings) markups.  In order for
this to work the Markup() calls have to be made before loading any
cookbook scripts (i.e., before include_once('cookbook/extendmarkup.php')
in the above example).

To remove a markup rule that has already been registered via Markup(),
one can do:

   unset($MarkupTable['dropcaps']);
   unset($MarkupRules);

I thought about creating a special $MarkupsEnabled array, but
decided the above mechanisms were sufficient to handle it and
less code to be executed.

Pm



More information about the pmwiki-users mailing list