Add support for MarkDown README.md files.
This commit is contained in:
parent
9a745b7632
commit
91b5308ac0
3 changed files with 1727 additions and 0 deletions
14
html/includes/readme-markdown.php
Normal file
14
html/includes/readme-markdown.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
$path = parse_url ('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
if (is_dir ('/data/mirrors' . $path) && file_exists ('/data/mirrors' . $path . 'README.md')) {
|
||||
require ('includes/Parsedown.php');
|
||||
$readme = file_get_contents ('/data/mirrors' . $path . 'README.md');
|
||||
$Parsedown = new Parsedown();
|
||||
print ('<div class="box boxpadding">');
|
||||
print ('<div class="heading bold centre" id="headingtext">Content of directory\'s README.md</div>');
|
||||
print ('<hr width="80%">');
|
||||
print ($Parsedown->text ($readme));
|
||||
print ("</div>");
|
||||
print ("<br>");
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue