From 0ebdc6a8f9bd26d73687adc654120751f928188c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Aug 2015 11:20:45 +0200 Subject: XHTML generation revision --- web/xhtml | 129 ++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 37 deletions(-) (limited to 'web') diff --git a/web/xhtml b/web/xhtml index 4fc6119..2d4007c 100644 --- a/web/xhtml +++ b/web/xhtml @@ -5,15 +5,13 @@ #ifndef WEB_XHTML #define WEB_XHTML -#include // function - #include namespace web { // "Canonical" XHTML5 vocabulary. // - // One-letter tag names and local variable clash problem: + // * One-letter tag names and local variable clash problem // // a at|an|an anc anch // b bt|bo|bl bld bold @@ -27,6 +25,7 @@ namespace web // - _a, a_, xa // - A, I // - x::i + // - user-defined literals: "a"_e, "/a"_e, "id"_a // // Things can actually get much worse, consider: // @@ -36,12 +35,35 @@ namespace web // So perhaps this is the situation where the explicit namespace // qualification (e.g., x::p) is the only robust option? // + // + // * Element/attribute name clash problem (e.g., STYLE) + // + // - some attribute/element name decorator (STYLEA, STYLE_A, STYLE_) + // - rename attribute/element (e.g., STYLEDEF or CSSSTYLE[adds TYPE]); + // in case of STYLE we should probably rename the element since + // attribute will be much more frequently used. + // - "scope" attributes inside elements (P::STYLE); somewhat + // burdensome: P(P::STYLE); could then use low-case names + // for attributes + // - "scope" elements inside other elements (HEAD::STYLE); also + // burdensome. + // + // + // * Text wrapping/indentation + // + // For some (inline) elements we want additional indentation: + // + // 1. Indent content on newline (e.g., for