+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title><?=ns($p)?></title>
+ <link rel="stylesheet" href="/index.css">
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+ <?php if (!extension_loaded("discount") || !getenv("DISCOUNT")) : ?>
+ <script src="/markdown.js"></script>
+ <?php endif; ?>
+</head>
+<body>
+ <div class="sidebar">
+ <?php ls($p); ?>
+ </div>
+ <?php if ($p === "./") : ?>
+ <h1>Quick Markdown Documentation Browser</h1>
+ <p>v<?php readfile("VERSION")?></p>
+ <pre><?php
+ ob_start(function($s) {
+ return htmlspecialchars($s);
+ });
+ readfile("LICENSE");
+ ob_end_flush();
+ ?></pre>
+ <?php else: ?>
+ <?php if (!md($p)): ?>
+ <?php endif; ?>
+ <?php endif; ?>
+ <footer>
+ <a href="/VERSION">Version</a>
+ <a href="/AUTHORS">Authors</a>
+ <a href="/LICENSE">License</a>
+ </footer>
+ <script src="/index.js"></script>
+</body>
+</html>
+<?php
+
+ob_end_flush();
+$s->send();