Readme.php 796 B

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