[pmwiki-users] Re: Fixed: Another ExtendedMarkup annoyance

John Rankin john.rankin at affinity.co.nz
Wed Sep 7 22:04:08 CDT 2005

On Thursday, 8 September 2005 2:03 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>This is just a general comment on my view of configuration and the
>way I'm trying to design it.  If a recipe wants to make use of a 
>core feature that is in the scripts/ directory, it's generally 
>okay to load it directly.
>In this case, I'd think it's perfectly valid for extendmarkup.php
>to do an include_once("$FarmD/scripts/wikistyle.php"); to load it,
>just as if it had been defined in the preamble of pmwiki.php.
>If extendmarkup.php *requires* wikistyle.php to work then it's 
>okay to load it even if the administrator has later disabled it;
>if the use of wikistyles remains optional, it's okay for
>extendmarkup to examine the setting of $EnableStdWikiStyles
>to decide to load it (same as scripts/stdconfig.php does).
>Yes, it's possible that the administrator might've disabled 
>wikistyles later in the config.php file, but I think it's reasonable
>for recipe designers to assume that an administrator will make
>such declarations before the recipe is loaded (or to figure out
>that this is what they need to do).

Good comment! 
The reasoning was:
- markup extensions doesn't need it; it only needs $WikiStylePattern

- I didn't expect that particular pattern to change, so (groan)
  it won't do any harm

I guess the lesson is that if in doubt, code should err on the 
side of defending against possible future changes.
>> I think a better solution would be 
>> to define the style pattern in the pmwiki core, along with all other 
>> patterns. 
>This is reasonable; I've done it the current way because in general
>I like to keep related things together (and avoid defining things
>that won't be needed).  I suppose I can see about moving some of
>the patterns into the core, but I'll have to think about it a
>bit more.
In this case, back into the core -- this particular pattern 
was set in pmwiki.php in pmwiki1. I checked the pmwiki1 version
of the markup extension and it doesn't set $WikiStylePattern
as pmwiki already knows it. Sigh.

John Rankin

More information about the pmwiki-users mailing list