From 0905fae7c1ba93b70cb10ad77b6a24dbbc2c5082 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 20 Jun 2017 15:12:56 -0400 Subject: top banner with previous next navigation bar with svg buttons --- org/output_xmls.org | 352 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 255 insertions(+), 97 deletions(-) (limited to 'org/output_xmls.org') diff --git a/org/output_xmls.org b/org/output_xmls.org index b826a12..d8681fb 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -126,86 +126,194 @@ string _xhtml_anchor_tags(const(string[]) anchor_tags) { #+END_SRC **** doc head & tails -***** scroll head +***** metadata #+name: xhtml_format_objects #+BEGIN_SRC d -auto html_scroll_head(Dm)( +auto header_metadata(Dm)( Dm doc_matters, ) { + string _title="Title"; + string _author="Author"; + string _publisher="Publisher"; + string _date="Date"; + string _date_created="Date"; + string _date_issued="Date"; + string _date_available="Date"; + string _date_valid="Date"; + string _date_modified="Date"; + string _language="en"; + string _rights="Copyright: Copyright (C) year holder"; + string _generator="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)"; + string _generator_home="http://www.sisudoc.org"; string o; - o = format(q"¶ - - - - %s%s - - - - - - - - - - - - - - - - - - -¶", - doc_matters.dochead_meta["title"]["full"], - (doc_matters.dochead_meta["creator"]["author"].empty) ? "" : ", " ~ doc_matters.dochead_meta["creator"]["author"], - doc_matters.language, + o = format(q"¶ + + + + + + + + + + + + + + +¶", + _title, + _author, + _publisher, + _date, + _date_created, + _date_issued, + _date_available, + _date_valid, + _date_modified, + _language, + _rights, + _generator, + _generator_home, + ); + return o; +} +#+END_SRC + +***** site info button + +#+name: xhtml_format_objects +#+BEGIN_SRC d +auto site_info_button(Dm)( + Dm doc_matters, +) { + string _location_1_url ="http://www.sisudoc.org"; + string _location_1_lnk ="SiSU"; + string _location_2_url ="http://www.sisudoc.org"; + string _location_2_lnk ="www.sisudoc.org"; + string _location_3_url ="http://www.sisudoc.org"; + string _location_3_lnk ="sisu"; + string o; + o = format(q"¶ + + +
+

+ %s +

+

+ %s +

+

+ %s +

+
+ ¶", + _location_1_url, + _location_1_lnk, + _location_2_url, + _location_2_lnk, + _location_3_url, + _location_3_lnk, + ); + return o; +} +#+END_SRC + +***** search form + +#+name: xhtml_format_objects +#+BEGIN_SRC d +auto inline_search_form(Dm)( + Dm doc_matters, +) { + string _action="http://www.sisudoc.org/cgi-bin/search.cgi"; + string _db="SiSU.7a.manual"; + string o; + o = format(q"¶ + +
+ + + + + +
+ + +
+¶", + _action, + _db, ); return o; } #+END_SRC -***** seg head +***** html head & head banner #+name: xhtml_format_objects #+BEGIN_SRC d -auto html_seg_head(Dm)( +auto html_head(Dm)( Dm doc_matters, + string type, ) { string o; o = format(q"¶ - - - %s%s - - - - - - - - - - - - - - - + + + %s%s + + + %s + - - + + -¶", + +
+
+
+ + + +
+ + %s + + + + + + + %s + +
+ + + + [ document manifest ] + + +
+
+
+
%s¶", doc_matters.dochead_meta["title"]["full"], (doc_matters.dochead_meta["creator"]["author"].empty) ? "" : ", " ~ doc_matters.dochead_meta["creator"]["author"], + header_metadata(doc_matters), + ((type == "seg") ? "../../../" : "../../") ~ "image/rb7.ico", + ((type == "seg") ? "../../../" : "../../") ~ "css/html.css", doc_matters.language, + site_info_button(doc_matters), + inline_search_form(doc_matters), + ((type == "seg") ? "" : "\n
"), ); return o; } @@ -477,68 +585,90 @@ string lev4_heading_subtoc(O)( } #+END_SRC -**** navigation pre next +**** navigation pre next svg #+name: xhtml_format_objects #+BEGIN_SRC d -string nav_pre_next_table(O)( +auto nav_pre_next_svg(O)( auto return ref const O obj, ) { string prev, next, toc; - if (obj.segname_prev == "") { + if (obj.segment_anchor_tag == "toc") { + toc = ""; prev = ""; } else { + toc = format(q"¶ + + + +¶", + ); + } + if (obj.segname_prev == "") { + prev = ""; + } else { // previous prev = format(q"¶ - - -  << [ prev ] - - + + + ¶", obj.segname_prev, ); } - if (obj.segname_next == "") { + if (obj.segname_next == "") { // next next = ""; } else { next = format(q"¶ - - -  [ next ] >> - - + + + ¶", obj.segname_next, ); } - if (obj.segment_anchor_tag == "toc") { - toc = ""; - prev = ""; - } else { - toc = format(q"¶ - - -  [ toc ] - - -¶", - ); - } - string o = format(q"¶ + + ¶", - prev, toc, + prev, next, ); - return o; + string _pre_next = format(q"¶ + +¶", + prev, + next, + ); + struct bar { + string toc_pre_next() { + return _toc_pre_next; + } + string pre_next() { + return _pre_next; + } + } + return bar(); } #+END_SRC @@ -1155,7 +1285,6 @@ module sdp.output.html; template outputHTML() { <> mixin outputXHTMLs; - <> <> <> <> @@ -1205,8 +1334,7 @@ void scroll(D,I)( break; } break; - case "body": // assert(part == "body"); - assert(part == "body" || "head"); // surprise + case "body": assert(part == "body" || "head"); // surprise switch (obj.is_of) { case "para": switch (obj.is_a) { @@ -1308,7 +1436,7 @@ void scroll(D,I)( } } } - doc = xhtml_format.html_scroll_head(doc_matters) ~ doc_html ~ xhtml_format.tail; + doc = xhtml_format.html_head(doc_matters, "scroll") ~ doc_html ~ xhtml_format.tail; scroll_write_output(doc_matters, doc); } #+END_SRC @@ -1326,7 +1454,6 @@ void scroll_write_output(M,C)( } string fn_src = doc_matters.source_filename; auto src_path_info = doc_matters.src_path_info; - string fn_rel_pth = doc_matters.source_filename; string lng = doc_matters.language; auto pth_html = SiSUpathsHTML!()(src_path_info, lng); try { @@ -1341,6 +1468,7 @@ void scroll_write_output(M,C)( catch (ErrnoException ex) { // Handle error } + writeln(" ", doc_matters.environment["pwd"], "/", pth_html.fn_scroll(fn_src)); } #+END_SRC @@ -1361,6 +1489,8 @@ void seg(D,I)( string[] doc; string segment_filename; string[] top_level_headings = ["","","",""]; + string _bottom_bar =""; + string previous_seg_filename = ""; string suffix = ".html"; foreach (part; doc_matters.keys_seq.seg) { foreach (obj; doc_abstraction[part]) { @@ -1397,14 +1527,18 @@ void seg(D,I)( break; case 4: segment_filename = obj.segment_anchor_tag; - doc_html[segment_filename] ~= xhtml_format.html_seg_head(doc_matters); + doc_html[segment_filename] ~= xhtml_format.html_head(doc_matters, "seg"); + doc_html_endnotes[previous_seg_filename] ~= _bottom_bar; // places after segment text and endnotes + auto navigation_bar = xhtml_format.nav_pre_next_svg(obj); + doc_html[segment_filename] ~= navigation_bar.toc_pre_next; + _bottom_bar = navigation_bar.toc_pre_next; + previous_seg_filename = segment_filename; foreach (top_level_heading; top_level_headings) { // writeln(top_level_heading); doc_html[segment_filename] ~= top_level_heading; } auto t = xhtml_format.heading_seg(obj, _txt, suffix); doc_html[segment_filename] ~= to!string(t[0]); - doc_html[segment_filename] ~= xhtml_format.nav_pre_next_table(obj); doc_html[segment_filename] ~= xhtml_format.lev4_heading_subtoc(obj); doc_html_endnotes[segment_filename] ~= t[1]; break; @@ -1584,7 +1718,6 @@ void seg_write_output(M,D,E)( mixin SiSUoutputRgxInit; auto rgx = Rgx(); auto src_path_info = doc_matters.src_path_info; - string fn_rel_pth = doc_matters.source_filename; string lng = doc_matters.language; auto pth_html = SiSUpathsHTML!()(src_path_info, lng); auto xhtml_format = outputXHTMLs(); @@ -1607,6 +1740,7 @@ void seg_write_output(M,D,E)( catch (ErrnoException ex) { // handle error } + writeln(" ", doc_matters.environment["pwd"], "/", pth_html.fn_seg(doc_matters.source_filename, "toc")); } #+END_SRC @@ -1781,6 +1915,30 @@ string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) { content ~= parts["guide"]; content ~= " " ~ "" ~ "\n "; content ~= "" ~ ""; + debug(epubmanifest) { + foreach (s; doc_matters.keys_seq.seg) { + foreach (obj; doc_abstraction[s]) { + if (obj.is_a == "heading") { + if (obj.heading_lev_markup == 4) { + writefln( + "%s~ [%s.xhtml] %s", + obj.marked_up_level, + obj.segment_anchor_tag, + obj.text + ); + } else if (obj.heading_lev_markup > 4) { + writefln( + "%s~ [%s.xhtml#%s] %s", + obj.marked_up_level, + obj.segment_anchor_tag, + obj.obj_cite_number, + obj.text + ); + } + } + } + } + } return content; } #+END_SRC @@ -2276,7 +2434,6 @@ void epub3_write_output_files(M,D,E,Mt,Mic,Otnx,Otn,Oc)( static assert(is(typeof(oebps_content_opf) == string)); } auto src_path_info = doc_matters.src_path_info; - string fn_rel_pth = doc_matters.source_filename; string lng = doc_matters.language; auto pth_epub3 = SiSUpathsEPUB!()(src_path_info, lng); auto xhtml_format = outputXHTMLs(); @@ -2450,6 +2607,7 @@ void epub3_write_output_files(M,D,E,Mt,Mic,Otnx,Otn,Oc)( catch (ErrnoException ex) { // Handle error } + writeln(" ", doc_matters.environment["pwd"], "/", fn_epub); #+END_SRC ** zip debug, read zip archive -- cgit v1.2.3