+<?php ob_start() ?>
+
<h1>mdref</h1>
-<?php if (isset($exception)) : ?>
- <?=\mdref\ExceptionHandler::html($exception, ["h2"], ["p"], ["pre", "style='overflow-x:scroll'"]); ?>
-<?php else : ?>
- <?php if (isset($listing) && count($listing)) : ?>
- <h2>Available References</h2>
- <?php foreach ($listing as $entry) : ?>
- <h3><a href="<?=$entry->formatUrl()?>"><?=$entry->formatLink()?></a></h3>
- <ul>
- <?php foreach (new mdref\RefListing($path = $refs->find($baseUrl->mod($entry->formatUrl())), $refs->glob($path, "/*.md")) as $entry) : ?>
- <li><a href="<?=$entry->formatUrl()?>"><?=$entry->formatLink()?></a><br>
- <?=$entry->readDescription()?></li>
- <?php endforeach; ?>
- </ul>
+<?php if (isset($html)) : ?>
+ <?= $html ?>
+<?php elseif (isset($text)) : ?>
+
+ <p style="white-space:pre-wrap"><?= $esc($text) ?></p>
+<?php elseif (isset($refs)) : ?>
+ <?php foreach ($refs as $repo) : /* @var \mdref\Repo $repo */ ?>
+ <?php foreach ($repo as $entry) : /* @var \mdref\Entry $entry */ ?>
+
+ <h2 id="<?= $anchor($entry->getTitle()) ?>">
+ <a href="<?= $esc($entry->getName()) ?>"
+ ><?= $esc($entry->getTitle()) ?></a></h2>
+ <div><?= $quick($entry->getIntro()) ?></div>
+ <?php if ($repo->hasStub($stub)) : ?>
+ <?php include __DIR__ . "/stub.phtml"; ?>
+ <?php endif; ?>
<?php endforeach; ?>
- <?php endif; ?>
+ <?php endforeach; ?>
<?php endif; ?>
+
+<?= $markup(ob_get_clean()); ?>