Chapter: jWiki: generating contents from wiki contents
|« jMailer: sending mails||^ Class utilities||jSession: allowing to choose the storage : files, database »|
jWiki is a class transforming wiki text to other formats. XHTML for example. This class inherits from Wikirenderer version 3.0.
in order to transform, Wikirenderer needs some precise objects, which grouped together become the transform rules
There are a bunch of transform rules already bundled with jelix (see lib/wikirenderer/rules/). They allow to transform wiki wr3 code into XHTML. It would be possible to transform dokuwiki code into XHTML, or mediawiki into docbook. All combinations are possible. you only need to give or develop the good set of transform rules.
To use jWiki, just instantiate it with a transform rules name. If you want to transform wiki wr3 into XHTML, just do:
$wr = new jWiki('wr3_to_xhtml'); $xhtml = $wr->render($wiki_text);
transform rules delivered with Jelix are in lib/wikirenderer/rules, but you can add your own set in your_app/plugins/wr_rules/. Note: remember to activate app:plugins repository in your configuration, if you intend to do so.
For more informations, browse Wikirenderer 3.0 Documentation.