[pmwiki-users] Different Markup definitions for a section?

Joachim Durchholz jo at durchholz.org
Tue Apr 25 03:15:25 CDT 2006


Américo Albuquerque schrieb:
> There's a way to do this but you'll need to rewrite the main PmWiki 
> engine to do it.
> Basically, there are 3 functions and 2 variables that deal with Markups.
> The functions:
> Markup - sets the markup to be used.
> BuildMarkupRules - sorts the markups to be used.
> MarkupToHTML - transforms the text saved in each page into html.
> 
> The variables:
> $MarkupTable - holds the markups that are saved by the Markup function
> $MarkupRules - the ordered markups to be applied by MarkupToHTML.

That's roughly the list of things to consider, yes.

> What you need is an array of $MarkupTable. The default table would be 
> $MarkupTable[0] (the current markup). Your markup would set the used 
> markup to another position in the array. The endmarkup would revert the 
> position to the default one.

That's a *very* slippery road. You need to save more state than just the 
markup table itself - you'll have to save the entire state of the 
substitution process, restart the substitution process with the new 
table from scratch, and then carefully restory just enough of the saved 
state that the engine will continue seamlessly.

It's very difficult to do stuff like that and get it to work.
Worse, it's impossible to foresee what future changes in PmWiki might 
break it.

I strongly recommend against taking that route.

Regards,
Jo




More information about the pmwiki-users mailing list