можно так например:
code:
class BlogPost
{
unsigned topic;
string user;
time_t time;
string title;
string message;
};
const string posts_table = "users_posts";
const string topic = HTTP_GET_VARS["topic_id"];
html {
head {
title {"тестовая страница"}
}
body (class="body-class") {
BlogPost posts[];
int i;
b{hello world}
posts = sql {
SELECT * FROM ::posts_table
WHERE topic=::topic
} catch (Exception e) {
return new BlogPost[0];
}
table (style="comments") {
tr {
td {"user"};
td {"date"};
td {"title"};
td {"message"};
};
for (i = 0; i < length (posts); i ++)
tr {
td {posts[i].user};
td {format_date (posts[i].date)};
td {posts[i].title};
td {posts[i].message};
};
}
}
}
обломно, что ключевых слов будет до жопы... но, в принципе, их можно манглить, или, даже, запихать в namespace, и если хочешь говори 'using namespace html', если хочешь не говори, но пиши вместo table фразу html::table...
да! и компилятор html'я в этот формат. и запрет на вывод строк типа ... чтобы они автоматом бы преобразовывались в нечто типа: `<html>'.