<?php
foreach (glob("/home/*/.tracery/*") as $g)
    $db[basename($g, ".json")][] = $g;
ksort($db);
?>
<!DOCTYPE html>
<html>
    <head>
        <title>tracery</title>
        <link rel="stylesheet" href="../gruvbox/gruvbox.min.css">
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    </head>
    <body id="top">
        <main>
            <h1>tracery</h1>

            <p>tracery is a cool tool to generate text</p>

            <p>you can use the <code>tracer</code> bot on irc and grammar files in your <code>~/.tracery</code> directory to generate messages</p>
            <p>grammars are chosen randomly if more than one exists per name</p>

            <h3>grammars available on tilde.team</h3>
            <ul>
                <?php foreach ($db as $name => $files) { ?>
                    <li>
                        <strong><?=$name?></strong>
                        <ul>
                        <?php foreach ($files as $f) { ?>
                            <li><?=$f?></li>
                        <?php } ?>
                        </ul>
                    </li>
                <?php } ?>            
        </main>
    </body>
</html>

