sclass HTMLFramer1 {
S title;
new L navItems;
new LS contents;
new LS headElements;
srecord NavItem(S link, S html) {}
swappable S render() {
ret hhtml(hhead(htitle(title)
+ lines(headElements))
+ hbody(h1(htmlEncode2(title))
+ renderNav()
+ lines(contents)));
}
swappable S renderNav() {
if (empty(navItems)) ret "";
ret p(joinWithVBar(map(navItems, ni -> ahref(ni.link, ni.html))));
}
void addNavItem(S link, S html) {
navItems.add(new NavItem(link, html));
}
void addInHead(S html) {
headElements.add(html);
}
}