Christophe,
It looks to me like the most direct option is to register a class
callback. Thus you would write
|:pre prettyprint:|{{{
// the source code
}}}
Register your code with
$wiki = new SimpleWiki();
$wiki->register_class_callbacks('preformatted' =>
array('prettyprint'=> array($myobject,'callback_pre_prettyprint')));
Your callback is handed the emitter node, which you can modify as
appropriate (including running the text through a processor). Your
code would be
public function callback_pre_prettyprint ($node)
{
// modify emitter node
$node->escapecontent = FALSE; // literal passthrough of generated
text
...
}
Follow
callback_pre_html
in native_simplewiki.php for an analog.
I believe the text output is in the $node->text property. I don't see
that I created any documentation for this, which I'll have to rectify.
If you really want to use a global macro instead, follow the
"quicktoc" macro (starting with
$this->register_macro_callbacks(
array(
'quicktoc' => array($this,'macro_quicktoc')
)
);
at line 160 of native_simplewiki. But this will be very hard without
documentation.
At the extreme end, you could extend any of the simplewiki classes as
discussed in a previous email here.
Hope this helps, or will do in the short run.
FYI I've been buried in browser interface stuff for the last while
(see
http://dlml.org/gargoyle/demo.html), which is winding up (for
now). In a week or so I'll start on finishing the upgrade to the
Musterdb.org core code that I started last summer. During this phase
I'll review simplewiki. Will probably last to mid to end of March.
As discussed before I hope to add some kind of auto documentation
generation to all this, which should help.
Best,
- Henrik