<?php

// usage: pass in relative path to a file on cvs.php.net
// uses http://pear.horde.org/index.php?package=Text_reST
// Formatting guide see also: http://docutils.sourceforge.net/docs/user/rst/quickref.html

require_once 'Text/reST.php';
require_once 
'Text/reST/Formatter.php';

if (isset(
$_GET['rel_path'])) {
  
$rel_path 'http://cvs.php.net/viewvc.cgi/'.$_GET['rel_path'].'?view=co';
  
$string file_get_contents($rel_path);
} else {
  
$string "
=======================
  PHP.net reST Parser
=======================

This is the reST Parser for PHP.net. Pass in a GET parameter 'rel_path' as a
relative path to the rEST file on http://cvs.php.net/viewvc.cgi you want to
parse and display as html.

Example::

  rel_path=php-src/CODING_STANDARDS

Will parse and render the following URL as html::

  http://cvs.php.net/viewvc.cgi/php-src/CODING_STANDARDS?view=co

For some hints on how on the reST format check the docutils quickdocs_

.. _quickdocs: http://docutils.sourceforge.net/docs/user/rst/quickref.html

Have fun :-)"
;
}


$document Text_reST::parse($string);

$formatter Text_reST_Formatter::factory('html');
echo 
$formatter->format($document);

// $document->dump();

?>