[pmwiki-users] Markup() in a Markup() call, or conditionally loading a recipe

Scott Diegel scottdiegel at gmail.com
Fri Feb 6 13:33:25 CST 2009


I want a Markup() call to apply only to a given type of page, specifically
if (:sop:) is included on a wiki page.  The Markup will affect section
numbering, but I still need the standard section markup to be used.
The following input:

!! Section 1
!!! Section 1.1


will result in the following output:

1   Section 1

     1.1   Section 1.1



Loading the file in which this is defined via config.php results in the
section formatting being changed for all pages.  I tried the following, and
checked using ?action=ruleset whether the 'sop' rule was being applied;
'sopheaders' is being applied, but 'sop' is not.

/*
function SOPheaders(){
Markup('sop','>include','/^(!{2,4})(?:\s*)(.*)$/e',
"MkSopNumTitle(strlen('$1'),PSS('$2'))");
}
Markup('sopheaders','directives','/\\(:sop:\\)/e',"SOPheaders()");
*/

Is this the right approach?  Is there another approach I can try?

Thanks.
Scott D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090206/23dd206e/attachment.html 


More information about the pmwiki-users mailing list