Readme.php 732 B

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