]> git.mxchange.org Git - friendica.git/blob - library/php-markdown/Readme.php
Merge pull request #2148 from annando/issue-1871
[friendica.git] / library / php-markdown / Readme.php
1 <?php
2
3 # This file passes the content of the Readme.md file in the same directory
4 # through the Markdown filter. You can adapt this sample code in any way
5 # you like.
6
7 # Install PSR-0-compatible class autoloader
8 spl_autoload_register(function($class){
9         require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
10 });
11
12 # Get Markdown class
13 use \Michelf\Markdown;
14
15 # Read file and pass content through the Markdown parser
16 $text = file_get_contents('Readme.md');
17 $html = Markdown::defaultTransform($text);
18
19 ?>
20 <!DOCTYPE html>
21 <html>
22     <head>
23         <title>PHP Markdown Lib - Readme</title>
24     </head>
25     <body>
26                 <?php
27                         # Put HTML content in the document
28                         echo $html;
29                 ?>
30     </body>
31 </html>