2015-02-23 02:27:35 -05:00
|
|
|
<?php
|
|
|
|
|
2017-03-23 21:19:24 -04:00
|
|
|
// This file passes the content of the Readme.md file in the same directory
|
|
|
|
// through the Markdown filter. You can adapt this sample code in any way
|
|
|
|
// you like.
|
2015-02-23 02:27:35 -05:00
|
|
|
|
2017-03-23 21:19:24 -04:00
|
|
|
// Install PSR-0-compatible class autoloader
|
2015-02-23 02:27:35 -05:00
|
|
|
spl_autoload_register(function($class){
|
|
|
|
require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
|
|
|
|
});
|
|
|
|
|
2017-03-23 21:19:24 -04:00
|
|
|
// Get Markdown class
|
2015-02-23 02:27:35 -05:00
|
|
|
use \Michelf\Markdown;
|
|
|
|
|
2017-03-23 21:19:24 -04:00
|
|
|
// Read file and pass content through the Markdown parser
|
2015-02-23 02:27:35 -05:00
|
|
|
$text = file_get_contents('Readme.md');
|
|
|
|
$html = Markdown::defaultTransform($text);
|
|
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>PHP Markdown Lib - Readme</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php
|
2017-03-23 21:19:24 -04:00
|
|
|
// Put HTML content in the document
|
2015-02-23 02:27:35 -05:00
|
|
|
echo $html;
|
|
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|