[Pmwiki-users] Re: Keep Function

J. Perkins jason
Fri Jan 30 05:56:09 CST 2004


David Jackson wrote:
> I will give the beautifier a go, but can you explain the way the Keep function eliminates the need to hack the main script?   
> 	I had to hack pmWiki.php for my experimental HTMLAreaWiki (http://www.pmichaud.com/wiki/Cookbook/HTMLAreaWiki) but I would like to overload the function. (specifically, PrintText() )  
>  		(Ideally in a group, so via a groupname.php customisation.)
> Could the keep() function do this?

The new beautifier requires you to change your $HandleBrowseFmt and 
insert a call to "Beautify" before "PrintText". So for example:

	$HandleBrowseFmt = array(&$HTMLStartFmt,
			&$PageHeaderFmt,
			&$PageTitleFmt,
			&$PageRedirectFmt,
			"function:Beautify",
			"function:PrintText",
			&$PageFooterFmt,
			&$HTMLEndFmt);


Beautify() pre-parses the wiki text and pulls out all of the source code 
chunks, calling Keep() on each to remove them from the markup. Actually, 
it call Keep() with the "beautified" HTML. PrintText() reinserts the 
kept markup after it has finished doing it's thing. Works okay, I would 
like to have a way to register the call to Beautify() automatically so 
the admin doesn't to worry about it.

Hope that helps!

Jason





More information about the pmwiki-users mailing list