From 8de7594804287154385e285147d2bbadcb0d3113 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 7 Aug 2017 07:58:02 -0400 Subject: html css using grid & flex (remove tables) --- src/sdp/output/xmls.d | 208 ++++++++++++++++++++++++++------------------------ 1 file changed, 110 insertions(+), 98 deletions(-) (limited to 'src/sdp/output/xmls.d') diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d index c100bbc..57056de 100644 --- a/src/sdp/output/xmls.d +++ b/src/sdp/output/xmls.d @@ -14,6 +14,42 @@ template outputXHTMLs() { mixin SiSUoutputRgxInit; struct outputXHTMLs { static auto rgx = Rgx(); + string div_delimit( + string part, + return ref string previous_part + ){ + string delimit = ""; + string delimit_ = ""; + if (part != previous_part) { + switch (part) { + case "head": + delimit_ ~= "\n
\n" ; + break; + case "toc_seg": + delimit_ ~= "\n
\n" ; + break; + case "toc_scroll": + delimit_ ~= "\n
\n" ; + break; + case "bookindex_seg": + delimit_ ~= "\n
\n" ; + break; + case "bookindex_scroll": + delimit_ ~= "\n
\n" ; + break; + default: + delimit_ ~= "\n
\n" ; + break; + } + if (previous_part.length > 0) { + delimit ~= "\n
"; + } + previous_part = part; + delimit ~= delimit_; + } + // you also need to close the last div, introduce a footer? + return delimit; + } string special_characters(O)( auto return ref const O obj, string _txt @@ -123,21 +159,17 @@ template outputXHTMLs() { string _location_3_url ="http://www.sisudoc.org"; string _location_3_lnk ="sisu"; string o; - o = format(q"¶ - - -
-

- %s -

-

- %s -

-

- %s -

-
- ¶", + o = format(q"¶¶", _location_1_url, _location_1_lnk, _location_2_url, @@ -153,19 +185,19 @@ template outputXHTMLs() { string _action="http://www.sisudoc.org/cgi-bin/search.cgi"; string _db="SiSU.7a.manual"; string o; - o = format(q"¶ - -
- - - - - -
- - -
- ¶", + o = format(q"¶
+ +
+ + + + + +
+ + +
+
¶", _action, _db, ); @@ -192,34 +224,17 @@ template outputXHTMLs() { -
-
-
- - - -
- - %s - - - - - - - %s - -
- - - - [ document manifest ] - - -
-
-
-
%s¶", +
+
+ %s + + %s%s¶", doc_matters.dochead_meta["title"]["full"], (doc_matters.dochead_meta["creator"]["author"].empty) ? "" : ", " ~ doc_matters.dochead_meta["creator"]["author"], @@ -293,7 +308,8 @@ template outputXHTMLs() { } auto tail() { string o; - o = format(q"¶ + o = format(q"¶
+ ¶"); @@ -457,66 +473,62 @@ template outputXHTMLs() { toc = ""; prev = ""; } else { - toc = format(q"¶ - - - - ¶", + toc = format(q"¶ + + ¶", ); } if (obj.segname_prev == "") { prev = ""; - } else { // previous - prev = format(q"¶ - - - - ¶", + } else { + prev = format(q"¶ + + ¶", obj.segname_prev, ); } - if (obj.segname_next == "") { // next + if (obj.segname_next == "") { next = ""; } else { - next = format(q"¶ - - - - ¶", + next = format(q"¶ + + ¶", obj.segname_next, ); } - string _toc_pre_next = format(q"¶ - - - ¶", +
¶", toc, prev, next, ); - string _pre_next = format(q"¶ - +
¶", prev, next, ); -- cgit v1.2.3