+ <?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 md($p, $s); ?>
+ <?php endif; ?>
+
+ <div id="disqus_thread"></div>
+
+ <footer>
+ <a href="VERSION">Version</a>
+ <a href="AUTHORS">Authors</a>
+ <a href="LICENSE">License</a>
+ <?php if ($p !== "./") : ?>
+ <a href="https://github.com/m6w6/mdref/edit/master/<?=trim($p,"/")?>.md">Edit</a>
+ <?php endif; ?>
+ </footer>
+ <script src="index.js"></script>
+ <?php if ($_SERVER["SERVER_NAME"] != "localhost") : ?>
+ <script>
+ var disqus_shortname = 'mdref';
+ var disqus_identifier = '<?=$p?>';
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+ </script>
+ <?php endif; ?>