slackware.uk/html/includes/readme-markdown.php

14 lines
618 B
PHP

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