PHP code example of ondrs / pandoc-php

1. Go to this page and download the library: Download ondrs/pandoc-php 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/ */

    

ondrs / pandoc-php example snippets


$pandoc = new Pandoc('/path/to/temp/dir');
$html = $pandoc->convert("#Hello Pandoc", "markdown_github", "html");
// $html == "<h1>Hello Pandoc</h1>"

$pandoc = new Pandoc\Pandoc('/path/to/temp/dir');
$options = array(
    "from"  => "markdown",
    "to"    => "html",
    "css"   => "/assets/css/documents.css"
);
$html = $pandoc->runWith("#Hello Pandoc", $options);