sclass HTMLFramer1 { S title; new L navItems; new LS contents; new LS headElements; srecord NavItem(S link, S html) { bool targetBlank; } 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, O... _) { navItems.add(setAll(new NavItem(link, html), filterParams(_, 'targetBlank))); } void addInHead(S html) { headElements.add(html); } }