var mtx=new Mutex();
func openDB()
{
    return Sqlite.Open("messages.db");
}
func Pages.Index()
{
    mtx.Lock();
    var db = openDB();
    var messages = Sqlite.Exec(db,"SELECT * FROM messages");
    Sqlite.Close(db);
    mtx.Unlock();

    //use null when you wan't to use multiple tags but not emit a div or anything like that
    return <!DOCTYPE html>
<html lang={"en"}>
<head>
    <meta charset={"UTF-8"}>
    <meta name={"viewport"} content={"width=device-width, initial-scale=1.0"}>
    <title>Anonymous Post Board</title>
    <link rel="stylesheet" href="./pure-min.css">
</head>
<body>
    <div class="pure-g">
        <div class="pure-u-1-3"></div>
        <div class="pure-u-1-3">
            <h1>Anonymous Post Board</h1>
            <form class="pure-form pure-form-stacked" method="POST" action="./">
                <textarea name="message" placeholder="My Message"></textarea>
                <button class="pure-button pure-button-primary">Send</button>
            </form>
            <each(var msg : messages)>
                <br>
                <fieldset>
                    <legend>
                        {new DateTime(ParseLong(msg.timestamp)).ToString()}
                    </legend>
                    <plink(msg.message)>
                </fieldset>
            </each>
        </div>
        <div class="pure-u-1-3"></div>
    </div>
</body>
</html>;
}