presunute zdrojove kody do ./src/

This commit is contained in:
2026-10-26 18:44:34 +01:00
parent 6c6a6c7dfe
commit 58e3a7503c
5 changed files with 20 additions and 10 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
$path = $_GET['file'] ?? $_SERVER['REQUEST_URI'];
$file = realpath('d:/www/' . $path);
if (!$file || !str_ends_with($file, '.md')) {
http_response_code(404);
exit('Not found');
}
$md = file_get_contents($file);
$parser = new Parsedown();
echo '<!doctype html>';
echo '<meta charset="utf-8">';
echo '<link rel="stylesheet" href="//localhost/md2html/src/markdown.css">';
echo '<div class="markdown-body">';
echo $parser->text($md);
echo '</div>';