PHP code example of ryakad / pandoc-php

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

    

ryakad / pandoc-php example snippets


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

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