e473d7336430c6539438f9e9751d303d89671fdc
[yaffs-website] / 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-4-compatible class autoloader
8 spl_autoload_register(function($class){
9         require str_replace('\\', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
10 });
11 // If using Composer, use this instead:
12 //require 'vendor/autoloader.php';
13
14 // Get Markdown class
15 use Michelf\Markdown;
16
17 // Read file and pass content through the Markdown parser
18 $text = file_get_contents('Readme.md');
19 $html = Markdown::defaultTransform($text);
20
21 ?>
22 <!DOCTYPE html>
23 <html>
24     <head>
25         <title>PHP Markdown Lib - Readme</title>
26     </head>
27     <body>
28                 <?php
29                         // Put HTML content in the document
30                         echo $html;
31                 ?>
32     </body>
33 </html>