Add support for MarkDown README.md files.

This commit is contained in:
Darren 'Tadgy' Austin 2025-10-06 18:02:22 +01:00
commit 91b5308ac0
3 changed files with 1727 additions and 0 deletions

View 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>");
}
?>