From b157271169fe8cd896b54a89d28fd3b7c8768826 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 8 Jul 2019 17:57:23 -0400 Subject: 0.7.5 xmls css code reorganised; ocn can turn off or hide --- org/output_xmls.org | 150 ++++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 76 deletions(-) (limited to 'org/output_xmls.org') diff --git a/org/output_xmls.org b/org/output_xmls.org index 6b3b3d1..0777b21 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -805,9 +805,10 @@ auto nav_pre_next_svg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string heading(O)( - string _txt, - const O obj, +string heading(O,M)( + string _txt, + const O obj, + M doc_matters, string _xml_type = "html", ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); @@ -841,7 +842,7 @@ string heading(O)( ┃", _horizontal_rule, obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.heading_lev_markup, obj.metainfo.is_a, obj.metainfo.identifier, @@ -882,7 +883,7 @@ string heading_scroll(O,M)( string _suffix = ".html", ) { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); - string o = heading(_txt, obj); + string o = heading(_txt, obj, doc_matters); return o; } #+END_SRC @@ -901,7 +902,7 @@ auto heading_seg(O,M)( auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0]; string[] _endnotes = t[1]; - string o = heading(_txt, obj, _xml_type); + string o = heading(_txt, obj, doc_matters, _xml_type); auto u = tuple( o, _endnotes, @@ -915,9 +916,10 @@ auto heading_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string para(O)( - string _txt, - const O obj, +string para(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -937,7 +939,7 @@ string para(O)(

┃", obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.attrib.indent_hang, obj.attrib.indent_base, @@ -973,7 +975,7 @@ string para_scroll(O,M)( string _suffix = ".html", ) { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); - string o = para(_txt, obj); + string o = para(_txt, obj, doc_matters); return o; } #+END_SRC @@ -992,7 +994,7 @@ auto para_seg(O,M)( auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = para(_txt, obj); + string o = para(_txt, obj, doc_matters); auto u = tuple( o, _endnotes, @@ -1006,9 +1008,10 @@ auto para_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string quote(O)( - string _txt, - const O obj, +string quote(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1024,7 +1027,7 @@ string quote(O)(

┃", obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.metainfo.identifier, _txt @@ -1054,7 +1057,7 @@ string quote_scroll(O,M)( string _suffix = ".html", ) { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); - string o = quote(_txt, obj); + string o = quote(_txt, obj, doc_matters); return o; } #+END_SRC @@ -1073,7 +1076,7 @@ auto quote_seg(O,M)( auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = quote(_txt, obj); + string o = quote(_txt, obj, doc_matters); auto u = tuple( o, _endnotes, @@ -1087,9 +1090,10 @@ auto quote_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string group(O)( - string _txt, - const O obj, +string group(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1105,7 +1109,7 @@ string group(O)(

┃", obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.metainfo.identifier, _txt @@ -1136,7 +1140,7 @@ string group_scroll(O,M)( string _xml_type = "html", ) { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); - string o = group(_txt, obj); + string o = group(_txt, obj, doc_matters); return o; } #+END_SRC @@ -1155,7 +1159,7 @@ auto group_seg(O,M)( auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = group(_txt, obj); + string o = group(_txt, obj, doc_matters); auto u = tuple( o, _endnotes, @@ -1169,9 +1173,10 @@ auto group_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string block(O)( - string _txt, - const O obj, +string block(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1185,7 +1190,7 @@ string block(O)(

%s

┃", obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.metainfo.identifier, _txt.stripRight @@ -1214,7 +1219,7 @@ string block_scroll(O,M)( string _xml_type = "html", ) { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); - string o = block(_txt, obj); + string o = block(_txt, obj, doc_matters); return o; } #+END_SRC @@ -1233,7 +1238,7 @@ auto block_seg(O,M)( auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = block(_txt, obj); + string o = block(_txt, obj, doc_matters); auto u = tuple( o, _endnotes, @@ -1247,9 +1252,10 @@ auto block_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string verse(O)( - string _txt, - const O obj, +string verse(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1263,7 +1269,7 @@ string verse(O)(

%s

┃", obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.metainfo.identifier, _txt @@ -1292,7 +1298,7 @@ string verse_scroll(O,M)( string _xml_type = "html", ) { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); - string o = verse(_txt, obj); + string o = verse(_txt, obj, doc_matters); return o; } #+END_SRC @@ -1311,7 +1317,7 @@ auto verse_seg(O,M)( auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = verse(_txt, obj); + string o = verse(_txt, obj, doc_matters); auto u = tuple( o, _endnotes, @@ -1324,9 +1330,10 @@ auto verse_seg(O,M)( #+name: xhtml_format_objects_code #+BEGIN_SRC d -string code(O)( - string _txt, - const O obj, +string code(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -1339,7 +1346,7 @@ string code(O)(

%s

┃", obj.metainfo.identifier, - (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.metainfo.identifier, _txt @@ -1408,9 +1415,10 @@ auto tablarize(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -string table(O)( - string _txt, - const O obj, +string table(O,M)( + string _txt, + const O obj, + M doc_matters, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -1432,7 +1440,7 @@ string table(O)(

┃", obj.metainfo.object_number, - obj.metainfo.object_number, + (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), obj.metainfo.is_a, obj.metainfo.object_number, tags, @@ -1565,10 +1573,10 @@ void scroll(D,M)( doc_html ~= xhtml_format.verse_scroll(_txt, obj, doc_matters, suffix); break; case "code": - doc_html ~= xhtml_format.code(_txt, obj); + doc_html ~= xhtml_format.code(_txt, obj, doc_matters); break; case "table": - doc_html ~= xhtml_format.table(_txt, obj); + doc_html ~= xhtml_format.table(_txt, obj, doc_matters); break; default: { /+ debug +/ @@ -1661,7 +1669,7 @@ void scroll(D,M)( } } doc = xhtml_format.html_head(doc_matters, "scroll") ~ doc_html ~ xhtml_format.tail; - scroll_write_output(doc_matters, doc); + scroll_write_output(doc, doc_matters); } #+END_SRC @@ -1669,9 +1677,9 @@ void scroll(D,M)( #+name: output_html_scroll #+BEGIN_SRC d -void scroll_write_output(M,C)( +void scroll_write_output(D,M)( + D doc, M doc_matters, - C doc, ) { debug(asserts) { static assert(is(typeof(doc) == string[])); @@ -1891,10 +1899,10 @@ void seg(D,M)( doc_html_endnotes[segment_filename] ~= t[1]; break; case "code": - doc_html[segment_filename] ~= xhtml_format.code(_txt, obj); + doc_html[segment_filename] ~= xhtml_format.code(_txt, obj, doc_matters); break; case "table": - doc_html[segment_filename] ~= xhtml_format.table(_txt, obj); + doc_html[segment_filename] ~= xhtml_format.table(_txt, obj, doc_matters); doc_html_endnotes[segment_filename] ~= ""; break; default: @@ -1992,7 +2000,7 @@ void seg(D,M)( } } } - seg_write_output(doc_matters, doc_html, doc_html_endnotes); + seg_write_output(doc_html, doc_html_endnotes, doc_matters); } #+END_SRC @@ -2000,10 +2008,10 @@ void seg(D,M)( #+name: output_html_seg #+BEGIN_SRC d -void seg_write_output(M,D,E)( - M doc_matters, +void seg_write_output(D,E,M)( D doc_html, E doc_html_endnotes, + M doc_matters, ) { debug(asserts) { static assert(is(typeof(doc_html) == string[][string])); @@ -2040,23 +2048,17 @@ void seg_write_output(M,D,E)( #+name: output_html_css #+BEGIN_SRC d -void css(M)( - M doc_matters, -) { - auto css = DocReformCss(); +void css(M)(M doc_matters) { + auto css = DocReformCss(doc_matters); auto pth_html = DocReformPathsHTML!()(doc_matters.output_path, doc_matters.src.language); try { if (!exists(pth_html.css)) { (pth_html.css).mkdirRecurse; } auto f = File(pth_html.fn_seg_css, "w"); - (doc_matters.opt.action.css_theme_default) - ? f.writeln(css.light.html_seg) - : f.writeln(css.dark.html_seg); + f.writeln(css.html_seg); f = File(pth_html.fn_scroll_css, "w"); - (doc_matters.opt.action.css_theme_default) - ? f.writeln(css.light.html_scroll) - : f.writeln(css.dark.html_scroll); + f.writeln(css.html_scroll); } catch (ErrnoException ex) { // Handle error } @@ -2658,10 +2660,10 @@ void outputEPub3(D,I)( epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "code": - epubWrite.doc_epub3[segment_filename] ~= xhtml_format.code(_txt, obj); + epubWrite.doc_epub3[segment_filename] ~= xhtml_format.code(_txt, obj, doc_matters); break; case "table": - epubWrite.doc_epub3[segment_filename] ~= xhtml_format.table(_txt, obj); + epubWrite.doc_epub3[segment_filename] ~= xhtml_format.table(_txt, obj, doc_matters); epubWrite.doc_epub3_endnotes[segment_filename] ~= ""; break; default: @@ -2818,9 +2820,9 @@ void outputEPub3(D,I)( #+name: output_epub3_xhtml_seg #+BEGIN_SRC d -void epub3_write_output_files(W,I)( - W epub_write, - I doc_matters, +void epub3_write_output_files(W,M)( + W epub_write, + M doc_matters, ) { debug(asserts) { static assert(is(typeof(epub_write.doc_epub3) == string[][string])); @@ -2986,22 +2988,18 @@ void epub3_write_output_files(W,I)( } } { /+ OEBPS/epub.css +/ - auto css = DocReformCss(); + auto css = DocReformCss(doc_matters); { /+ debug +/ if (doc_matters.opt.action.debug_do) { fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.src.filename); - (doc_matters.opt.action.css_theme_default) - ? File(fn_dbg, "w").writeln(css.light.epub) - : File(fn_dbg, "w").writeln(css.dark.epub); + File(fn_dbg, "w").writeln(css.epub); } } fn = pth_epub3.fn_oebps_css; auto zip_arc_member_file = new ArchiveMember(); zip_arc_member_file.name = fn; auto zip_data = new OutBuffer(); - (doc_matters.opt.action.css_theme_default) - ? zip_data.write(css.light.epub.dup) - : zip_data.write(css.dark.epub.dup); + zip_data.write(css.epub.dup); zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); createZipFile!()(fn_epub, zip.build()); -- cgit v1.2.3