friendica_2021-01/library/php-markdown/Readme.php

32 lines
739 B
PHP
Raw Normal View History

2015-02-23 08:27:35 +01:00
<?php
// 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 08:27:35 +01:00
// Install PSR-0-compatible class autoloader
2015-02-23 08:27:35 +01:00
spl_autoload_register(function($class){
require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
});
// Get Markdown class
2015-02-23 08:27:35 +01:00
use \Michelf\Markdown;
// Read file and pass content through the Markdown parser
2015-02-23 08:27:35 +01:00
$text = file_get_contents('Readme.md');
$html = Markdown::defaultTransform($text);
?>
<!DOCTYPE html>
<html>
<head>
<title>PHP Markdown Lib - Readme</title>
</head>
<body>
<?php
// Put HTML content in the document
2015-02-23 08:27:35 +01:00
echo $html;
?>
</body>
</html>