diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-05-08 18:45:02 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-08-19 14:42:40 -0400 |
commit | 6b46ba599b7f687a592e2e50fdd007ed31319243 (patch) | |
tree | 9ba93fc931804a14506bae682eadaaef413f0024 /src/doc_reform/output | |
parent | book index sort: Aa-Zz (replaces A-Za-z) (diff) |
0.7.0 meta_abstruction, doc "has" struct replaces several tuples
Diffstat (limited to 'src/doc_reform/output')
-rw-r--r-- | src/doc_reform/output/epub3.d | 11 | ||||
-rw-r--r-- | src/doc_reform/output/html.d | 6 | ||||
-rw-r--r-- | src/doc_reform/output/sqlite.d | 8 | ||||
-rw-r--r-- | src/doc_reform/output/xmls.d | 6 |
4 files changed, 15 insertions, 16 deletions
diff --git a/src/doc_reform/output/epub3.d b/src/doc_reform/output/epub3.d index a49bb5d..cdfd2a6 100644 --- a/src/doc_reform/output/epub3.d +++ b/src/doc_reform/output/epub3.d @@ -103,7 +103,7 @@ template outputEPub3() { content ~= " " ~ "</guide>" ~ "\n "; content ~= "" ~ "</package>"; debug(epubmanifest) { - foreach (part; doc_matters.xml.keys_seq.seg) { // TODO + foreach (part; doc_matters.has.keys_seq.seg) { // TODO foreach (obj; doc_abstraction[part]) { if (obj.metainfo.is_a == "heading") { if (obj.metainfo.heading_lev_markup == 4) { @@ -145,7 +145,7 @@ template outputEPub3() { <nav epub:type=\"toc\" id=\"toc\">\n", doc_matters.conf_make_meta.meta.title_full, ); - foreach (sect; doc_matters.xml.keys_seq.seg) { + foreach (sect; doc_matters.has.keys_seq.seg) { foreach (obj; doc_abstraction[sect]) { if (obj.metainfo.is_a == "heading") { string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip; @@ -242,7 +242,7 @@ template outputEPub3() { (doc_matters.conf_make_meta.meta.creator_author.empty) ? "" : doc_matters.conf_make_meta.meta.creator_author, // author ); - foreach (sect; doc_matters.xml.keys_seq.seg) { + foreach (sect; doc_matters.has.keys_seq.seg) { foreach (obj; doc_abstraction[sect]) { if (obj.metainfo.is_a == "heading") { string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip; @@ -322,8 +322,7 @@ template outputEPub3() { string[] doc_parts; } auto epubWrite = writeOut(); - // writeln(doc_matters.xml.keys_seq.seg); - foreach (part; doc_matters.xml.keys_seq.seg) { + foreach (part; doc_matters.has.keys_seq.seg) { foreach (obj; doc_abstraction[part]) { string _txt = xhtml_format.special_characters(obj); if (obj.metainfo.is_a == "heading") { @@ -659,7 +658,7 @@ template outputEPub3() { } } { /+ OEBPS/[segments].xhtml (the document contents) +/ - foreach (seg_filename; doc_matters.xml.segnames_lv_0_to_4) { + foreach (seg_filename; doc_matters.has.segnames_lv_0_to_4) { string fn = pth_epub3.fn_oebps_content_xhtml(doc_matters.src.filename, seg_filename); auto zip_arc_member_file = new ArchiveMember(); zip_arc_member_file.name = fn; diff --git a/src/doc_reform/output/html.d b/src/doc_reform/output/html.d index 45b95ce..c9032e5 100644 --- a/src/doc_reform/output/html.d +++ b/src/doc_reform/output/html.d @@ -25,7 +25,7 @@ template outputHTML() { string suffix = ".html"; string previous_part = ""; string delimit = ""; - foreach (part; doc_matters.xml.keys_seq.scroll) { + foreach (part; doc_matters.has.keys_seq.scroll) { foreach (obj; doc_abstraction[part]) { delimit = xhtml_format.div_delimit(part, previous_part); string _txt = xhtml_format.special_characters(obj); @@ -222,7 +222,7 @@ template outputHTML() { string suffix = ".html"; string previous_part = ""; string delimit = ""; - foreach (part; doc_matters.xml.keys_seq.seg) { + foreach (part; doc_matters.has.keys_seq.seg) { foreach (obj; doc_abstraction[part]) { delimit = xhtml_format.div_delimit(part, previous_part); string _txt = xhtml_format.special_characters(obj); @@ -476,7 +476,7 @@ template outputHTML() { if (!exists(pth_html.seg(doc_matters.src.filename))) { pth_html.seg(doc_matters.src.filename).mkdirRecurse; } - foreach (seg_filename; doc_matters.xml.segnames) { + foreach (seg_filename; doc_matters.has.segnames_lv4) { auto f = File(pth_html.fn_seg(doc_matters.src.filename, seg_filename), "w"); foreach (docseg; doc_html[seg_filename]) { f.writeln(docseg); diff --git a/src/doc_reform/output/sqlite.d b/src/doc_reform/output/sqlite.d index 0be198b..832e2e7 100644 --- a/src/doc_reform/output/sqlite.d +++ b/src/doc_reform/output/sqlite.d @@ -299,8 +299,8 @@ template SQLiteFormatAndLoadObject() { auto pth_html = DocReformPathsHTML!()(doc_matters.output_path, doc_matters.src.language); if (_xml_type == "seg") { foreach (m; _txt.match(rgx.inline_link_hash)) { - if (m.captures[3] in doc_matters.xml.tag_associations) { - if (m.captures[3] == doc_matters.xml.tag_associations[(m.captures[3])]["seg_lv4"]) { + if (m.captures[3] in doc_matters.has.tag_associations) { + if (m.captures[3] == doc_matters.has.tag_associations[(m.captures[3])]["seg_lv4"]) { _txt = _txt.replaceFirst( rgx.inline_link_hash, "┥$1┝┤" @@ -315,7 +315,7 @@ template SQLiteFormatAndLoadObject() { "┥$1┝┤" ~ doc_matters.conf_make_meta.conf.webserv_url_doc_root ~ "/" - ~ doc_matters.xml.tag_associations[(m.captures[3])]["seg_lv4"] + ~ doc_matters.has.tag_associations[(m.captures[3])]["seg_lv4"] ~ ".html" ~ "#" ~ "$3" ~ "├" @@ -1212,7 +1212,7 @@ template SQLiteInsertDocObjectsLoop() { string[string] obj_txt; string doc_text; string[] _insert_doc_objects; - foreach (part; doc_matters.xml.keys_seq.sql) { + foreach (part; doc_matters.has.keys_seq.sql) { foreach (obj; doc_abstraction[part]) { switch (obj.metainfo.is_of_part) { case "frontmatter": assert(part == "head", part); diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d index f27b0f4..90f4e7d 100644 --- a/src/doc_reform/output/xmls.d +++ b/src/doc_reform/output/xmls.d @@ -372,10 +372,10 @@ template outputXHTMLs() { if (_xml_type == "seg" || _xml_type == "epub") { seg_lvs = (_xml_type == "epub") ? "seg_lv1_to_4" : "seg_lv4"; foreach (m; _txt.match(rgx.inline_link_hash)) { - if (m.captures[3] in doc_matters.xml.tag_associations) { + if (m.captures[3] in doc_matters.has.tag_associations) { if ( m.captures[3] - == doc_matters.xml.tag_associations[(m.captures[3])][seg_lvs] + == doc_matters.has.tag_associations[(m.captures[3])][seg_lvs] ) { _txt = _txt.replaceFirst( rgx.inline_link_hash, @@ -385,7 +385,7 @@ template outputXHTMLs() { _txt = _txt.replaceFirst( rgx.inline_link_hash, "┥$1┝┤" - ~ doc_matters.xml.tag_associations[(m.captures[3])][seg_lvs] + ~ doc_matters.has.tag_associations[(m.captures[3])][seg_lvs] ~ _suffix ~ "#" ~ "$3" ~ "├" ); |