PHP code example of jelix / wikirenderer

1. Go to this page and download the library: Download jelix/wikirenderer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jelix / wikirenderer example snippets


// first choose a Markup, by instancying its configuration object
// here we want to parse DokuWiki syntax
$markupConfig = new \WikiRenderer\Markup\DokuWiki\Config();

// then choose a generator, e.g., the object which generates
// the result text in the expected format. Here, HTML...
$genConfig = new \WikiRenderer\Generator\Html\Config();
$generator = new \WikiRenderer\Generator\Html\Document($genConfig);

// now instancy the WikiRenderer engine
$wr = new \WikiRenderer\Renderer($generator, $markupConfig);

// call render() method: it will parse DokuWiki syntax, and will
// generate HTML content
$html = $wr->render($awikitext);