<?php

include '../../autoload.php';
use reStructuredText\RST\Parser;
use reStructuredText\RST\LaTeX\Kernel;
$parser = new Parser(null, new Kernel());
$document = $parser->parse(file_get_contents('document.rst'));
echo $document->renderDocument();
 /**
  * Helper function, parses a file and returns the document
  * produced by the parser
  */
 private function parse($file)
 {
     $directory = __DIR__ . '/files/';
     $parser = new Parser();
     $environment = $parser->getEnvironment();
     $environment->setCurrentDirectory($directory);
     $data = file_get_contents($directory . $file);
     return $parser->parse($data);
 }