From 6f8fddb2dfa5faad56af2a0bfd0bf3b694695136 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 12 Jun 2018 15:38:38 -0400 Subject: 0.26.3 object info changes --- src/sdp/meta/doc_debugs.d | 36 +- src/sdp/meta/metadoc.d | 1 - src/sdp/meta/metadoc_from_src.d | 1834 +++++++++++++++++++-------------------- src/sdp/meta/metadoc_summary.d | 14 +- src/sdp/meta/object_setter.d | 96 +- src/sdp/output/epub3.d | 134 +-- src/sdp/output/html.d | 80 +- src/sdp/output/sqlite.d | 90 +- src/sdp/output/xmls.d | 178 ++-- src/sdp/sdp.d | 1 - 10 files changed, 1238 insertions(+), 1226 deletions(-) (limited to 'src') diff --git a/src/sdp/meta/doc_debugs.d b/src/sdp/meta/doc_debugs.d index 18f50ad..60ad63f 100644 --- a/src/sdp/meta/doc_debugs.d +++ b/src/sdp/meta/doc_debugs.d @@ -39,8 +39,8 @@ template SiSUdebugs() { ); foreach (key; doc_matters.xml.keys_seq.seg) { foreach (obj; contents[key]) { - if (obj.of_part != "empty") { - if (obj.is_a == "heading") { + if (obj.typeinfo.of_part != "empty") { + if (obj.typeinfo.is_a == "heading") { writefln( "%s node: %s heading: %s %s", obj.obj_cite_number, @@ -61,11 +61,11 @@ template SiSUdebugs() { ); if (key.length > 0) { foreach (obj; contents[key]) { - if (obj.of_part != "empty") { + if (obj.typeinfo.of_part != "empty") { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -79,7 +79,7 @@ template SiSUdebugs() { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -108,7 +108,7 @@ template SiSUdebugs() { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -118,7 +118,7 @@ template SiSUdebugs() { enum DomTags { none, open, close, close_and_open, open_still, } foreach (sect; doc_matters.xml.keys_seq.seg) { foreach (obj; contents[sect]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { foreach_reverse (k; 0 .. 7) { switch (obj.dom_markedup[k]) { case DomTags.close : @@ -145,7 +145,7 @@ template SiSUdebugs() { writeln("--------------------"); foreach (sect; doc_matters.xml.keys_seq.seg) { foreach (obj; contents[sect]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { foreach_reverse (k; 0 .. 7) { switch (obj.dom_collapsed[k]) { case DomTags.close : @@ -185,7 +185,7 @@ template SiSUdebugs() { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -198,7 +198,7 @@ template SiSUdebugs() { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -223,7 +223,7 @@ template SiSUdebugs() { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -236,11 +236,11 @@ template SiSUdebugs() { __LINE__, ); foreach (obj; contents[key]) { - if (obj.of_part != "empty") { + if (obj.typeinfo.of_part != "empty") { writefln( "* [%s][%s] %s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -402,7 +402,7 @@ template SiSUdebugs() { ); foreach (k; doc_matters.xml.keys_seq.seg) { foreach (obj; contents[k]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { writefln( "%s~ [%s] %s %s", obj.marked_up_level, @@ -418,7 +418,7 @@ template SiSUdebugs() { debug(heading) { // heading foreach (k; doc_matters.xml.keys_seq.seg) { foreach (o; contents[k]) { - if (o.is_a == "heading") { + if (o.typeinfo.is_a == "heading") { writefln( "%s* %s\n (markup level: %s; collapsed level: %s)", replicate(" ", o.heading_lev_markup), @@ -438,7 +438,7 @@ template SiSUdebugs() { ); foreach (k; doc_matters.xml.keys_seq.seg) { foreach (obj; contents[k]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { writefln( "%s~ [%s] %s", obj.marked_up_level, @@ -627,7 +627,7 @@ template SiSUdebugs() { foreach (obj; contents[key]) { writefln( "[%s]\n%s", - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -644,7 +644,7 @@ template SiSUdebugs() { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d index 4aaafce..8160010 100644 --- a/src/sdp/meta/metadoc.d +++ b/src/sdp/meta/metadoc.d @@ -21,7 +21,6 @@ template SiSUabstraction() { sdp.output.paths_source; mixin SiSUrgxInit; mixin contentJSONtoSiSUstruct; - mixin SiSUnode; mixin SiSUbiblio; mixin SiSUrgxInitFlags; mixin outputHub; diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d index 8fb22be..ba85b68 100644 --- a/src/sdp/meta/metadoc_from_src.d +++ b/src/sdp/meta/metadoc_from_src.d @@ -88,7 +88,7 @@ template SiSUdocAbstraction() { O obj, string[] lv_ancestors_txt, ) { - switch (obj.heading_lev_markup) { + switch (obj.node.heading_lev_markup) { case 0: lv_ancestors_txt[0] = obj.text.to!string; foreach(k; 1..8) { @@ -133,7 +133,7 @@ template SiSUdocAbstraction() { lv_ancestors_txt[7] = obj.text.to!string; goto default; default: - obj.heading_ancestors_text = lv_ancestors_txt.dup; + obj.tags.heading_ancestors_text = lv_ancestors_txt.dup; } return obj; } @@ -178,7 +178,7 @@ template SiSUdocAbstraction() { debug(dom_magic_numbers) { writeln("marked up: ", lev, ": ", dom); } - obj.dom_markedup = dom.dup; + obj.node.dom_markedup = dom.dup; return obj; } pure auto obj_dom_set_collapsed_tags(O)( @@ -222,7 +222,7 @@ template SiSUdocAbstraction() { debug(dom_magic_numbers) { writeln("collapsed: ", lev, ": ", dom); } - obj.dom_collapsed = dom.dup; + obj.node.dom_collapsed = dom.dup; return obj; } static auto ocn_emit(int ocn_status_flag) { @@ -323,29 +323,29 @@ template SiSUdocAbstraction() { ]; string _anchor_tag; string toc_txt_; - an_object["glossary_nugget"] = ""; - an_object["blurb_nugget"] = ""; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "frontmatter"; - comp_obj_heading_.of_section = "toc"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Table of Contents"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "toc"; - comp_obj_heading_.marked_up_level = "1"; - comp_obj_heading_.heading_lev_markup = 4; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.ptr_html_segnames = html_segnames_ptr; - comp_obj_heading_.anchor_tags = ["toc"]; - comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; - comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; - auto toc_head = comp_obj_heading_; + an_object["glossary_nugget"] = ""; + an_object["blurb_nugget"] = ""; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "frontmatter"; + comp_obj_heading_.typeinfo.of_section = "toc"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Table of Contents"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "toc"; + comp_obj_heading_.node.marked_up_level = "1"; + comp_obj_heading_.node.heading_lev_markup = 4; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.ptr.html_segnames = html_segnames_ptr; + comp_obj_heading_.tags.anchor_tags = ["toc"]; + comp_obj_heading_.node.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.node.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; + auto toc_head = comp_obj_heading_; html_segnames_ptr_cntr++; the_table_of_contents_section = [ "seg": [toc_head], @@ -466,60 +466,60 @@ template SiSUdocAbstraction() { line_occur["para"] = State.off; an_object_key="glossary_nugget"; // if (line.matchFirst(rgx.heading_glossary)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "glossary"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Glossary"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "_part_glossary"; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; - comp_obj_heading_.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; - the_glossary_section ~= comp_obj_heading_; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "glossary"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Glossary"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "glossary"; - comp_obj_heading_.marked_up_level = "1"; - comp_obj_heading_.heading_lev_markup = 4; - comp_obj_heading_.heading_lev_collapsed = 2; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; - comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; - comp_obj_heading_.anchor_tags = ["glossary"]; - the_glossary_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "glossary"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Glossary"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "_part_glossary"; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.node.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.node.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; + the_glossary_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "glossary"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Glossary"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "glossary"; + comp_obj_heading_.node.marked_up_level = "1"; + comp_obj_heading_.node.heading_lev_markup = 4; + comp_obj_heading_.node.heading_lev_collapsed = 2; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.node.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.node.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; + comp_obj_heading_.tags.anchor_tags = ["glossary"]; + the_glossary_section ~= comp_obj_heading_; } else { _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "glossary"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "glossary"; + comp_obj_para.typeinfo.of_part = "backmatter"; + comp_obj_para.typeinfo.of_section = "glossary"; + comp_obj_para.typeinfo.is_of = "para"; + comp_obj_para.typeinfo.is_a = "glossary"; comp_obj_para.text = line.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.bullet = bullet; + comp_obj_para.node.ocn = 0; + comp_obj_para.node.obj_cite_number = ""; + comp_obj_para.misc.obj_cite_number_off = ""; + comp_obj_para.misc.obj_cite_number_type = 0; + comp_obj_para.attrib.indent_hang = indent["hang_position"]; + comp_obj_para.attrib.indent_base = indent["base_position"]; + comp_obj_para.attrib.bullet = bullet; the_glossary_section ~= comp_obj_para; } obj_type_status["ocn_status"] = OCNstatus.on; @@ -577,80 +577,80 @@ template SiSUdocAbstraction() { line_occur["para"] = State.off; an_object_key="blurb_nugget"; if (line.matchFirst(rgx.heading_blurb)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "blurb"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Blurb"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "_part_blurb"; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; - comp_obj_heading_.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; - the_blurb_section ~= comp_obj_heading_; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "blurb"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Blurb"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "blurb"; - comp_obj_heading_.marked_up_level = "1"; - comp_obj_heading_.heading_lev_markup = 4; - comp_obj_heading_.heading_lev_collapsed = 2; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.anchor_tags = ["blurb"]; - comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; - comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; - the_blurb_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "blurb"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Blurb"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "_part_blurb"; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.node.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.node.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; + the_blurb_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "blurb"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Blurb"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "blurb"; + comp_obj_heading_.node.marked_up_level = "1"; + comp_obj_heading_.node.heading_lev_markup = 4; + comp_obj_heading_.node.heading_lev_collapsed = 2; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.tags.anchor_tags = ["blurb"]; + comp_obj_heading_.node.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.node.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; + the_blurb_section ~= comp_obj_heading_; } else if (line.matchFirst(rgx.heading) && (opt_action.backmatter && opt_action.section_blurb)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "blurb"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = line.to!string; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "blurb"; - comp_obj_heading_.marked_up_level = an_object["lev"].to!string; - comp_obj_heading_.heading_lev_markup = an_object["lev_markup_number"].to!int; // make int, remove need to conv - comp_obj_heading_.heading_lev_collapsed = an_object["lev_collapsed_number"].to!int; // make int, remove need to conv - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_blurb_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "blurb"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = line.to!string; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "blurb"; + comp_obj_heading_.node.marked_up_level = an_object["lev"].to!string; + comp_obj_heading_.node.heading_lev_markup = an_object["lev_markup_number"].to!int; // make int, remove need to conv + comp_obj_heading_.node.heading_lev_collapsed = an_object["lev_collapsed_number"].to!int; // make int, remove need to conv + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_blurb_section ~= comp_obj_heading_; } else { _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "blurb"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "blurb"; + comp_obj_para.typeinfo.of_part = "backmatter"; + comp_obj_para.typeinfo.of_section = "blurb"; + comp_obj_para.typeinfo.is_of = "para"; + comp_obj_para.typeinfo.is_a = "blurb"; comp_obj_para.text = munge.url_links(line.to!string.strip).replaceFirst(rgx.para_attribs, ""); - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.inline_links = true; - comp_obj_para.bullet = bullet; + comp_obj_para.node.ocn = 0; + comp_obj_para.node.obj_cite_number = ""; + comp_obj_para.misc.obj_cite_number_off = ""; + comp_obj_para.misc.obj_cite_number_type = 0; + comp_obj_para.attrib.indent_hang = indent["hang_position"]; + comp_obj_para.attrib.indent_base = indent["base_position"]; + comp_obj_para.has.inline_links = true; + comp_obj_para.attrib.bullet = bullet; the_blurb_section ~= comp_obj_para; } obj_type_status["ocn_status"] = OCNstatus.on; @@ -748,14 +748,14 @@ template SiSUdocAbstraction() { debug(comment) { writeln(line); } - an_object[an_object_key] ~= line ~= "\n"; - comp_obj_comment = comp_obj_comment.init; - comp_obj_comment.of_part = "comment"; // breaks flow - comp_obj_comment.of_section = "comment"; // breaks flow - comp_obj_comment.is_of = "comment"; - comp_obj_comment.is_a = "comment"; - comp_obj_comment.text = an_object[an_object_key].strip; - the_document_body_section ~= comp_obj_comment; + an_object[an_object_key] ~= line ~= "\n"; + comp_obj_comment = comp_obj_comment.init; + comp_obj_comment.typeinfo.of_part = "comment"; // breaks flow + comp_obj_comment.typeinfo.of_section = "comment"; // breaks flow + comp_obj_comment.typeinfo.is_of = "comment"; + comp_obj_comment.typeinfo.is_a = "comment"; + comp_obj_comment.text = an_object[an_object_key].strip; + the_document_body_section ~= comp_obj_comment; _common_reset_(line_occur, an_object, obj_type_status); processing.remove("verse"); ++cntr; @@ -953,26 +953,26 @@ template SiSUdocAbstraction() { = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "body"; - comp_obj_para.of_section = "body"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "para"; - comp_obj_para.text = an_object["substantive"].to!string.strip; - comp_obj_para.ocn = obj_cite_digits.digit; - comp_obj_para.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_para.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_para.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_para.obj_cite_number_type = obj_cite_digits.type; - comp_obj_para.indent_hang = indent["hang_position"]; - comp_obj_para.indent_base = indent["base_position"]; - comp_obj_para.bullet = bullet; - comp_obj_para.anchor_tags = anchor_tags; - comp_obj_para.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_para.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_para.inline_links = substantive_obj_misc_tuple[sObj.links]; - comp_obj_para.contains_image_without_dimensions = substantive_obj_misc_tuple[sObj.image_no_dimensions]; - the_document_body_section ~= comp_obj_para; + comp_obj_para = comp_obj_para.init; + comp_obj_para.typeinfo.of_part = "body"; + comp_obj_para.typeinfo.of_section = "body"; + comp_obj_para.typeinfo.is_of = "para"; + comp_obj_para.typeinfo.is_a = "para"; + comp_obj_para.text = an_object["substantive"].to!string.strip; + comp_obj_para.node.ocn = obj_cite_digits.digit; + comp_obj_para.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_para.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_para.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_para.misc.obj_cite_number_type = obj_cite_digits.type; + comp_obj_para.attrib.indent_hang = indent["hang_position"]; + comp_obj_para.attrib.indent_base = indent["base_position"]; + comp_obj_para.attrib.bullet = bullet; + comp_obj_para.tags.anchor_tags = anchor_tags; + comp_obj_para.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_para.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_para.has.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_para.has.contains_image_without_dimensions = substantive_obj_misc_tuple[sObj.image_no_dimensions]; + the_document_body_section ~= comp_obj_para; _common_reset_(line_occur, an_object, obj_type_status); indent=[ "hang_position" : 0, @@ -989,23 +989,23 @@ template SiSUdocAbstraction() { } // close after non code, other blocks or regular text /+ unless (the_document_body_section.length == 0) ? +/ if (the_document_body_section.length > 0) { - if (((the_document_body_section[$-1].is_a == "para") - || (the_document_body_section[$-1].is_a == "heading") - || (the_document_body_section[$-1].is_a == "quote") - || (the_document_body_section[$-1].is_a == "group") - || (the_document_body_section[$-1].is_a == "block") - || (the_document_body_section[$-1].is_a == "verse")) + if (((the_document_body_section[$-1].typeinfo.is_a == "para") + || (the_document_body_section[$-1].typeinfo.is_a == "heading") + || (the_document_body_section[$-1].typeinfo.is_a == "quote") + || (the_document_body_section[$-1].typeinfo.is_a == "group") + || (the_document_body_section[$-1].typeinfo.is_a == "block") + || (the_document_body_section[$-1].typeinfo.is_a == "verse")) && (the_document_body_section.length > previous_length)) { - if ((the_document_body_section[$-1].is_a == "heading") - && (the_document_body_section[$-1].heading_lev_markup < 5)) { + if ((the_document_body_section[$-1].typeinfo.is_a == "heading") + && (the_document_body_section[$-1].node.heading_lev_markup < 5)) { obj_type_status["biblio_section"] = State.off; obj_type_status["glossary_section"] = State.off; obj_type_status["blurb_section"] = State.off; } - if (the_document_body_section[$-1].is_a == "verse") { + if (the_document_body_section[$-1].typeinfo.is_a == "verse") { /+ scan for endnotes for whole poem (each verse in poem) +/ foreach (i; previous_length .. the_document_body_section.length) { - if (the_document_body_section[i].is_a == "verse") { + if (the_document_body_section[i].typeinfo.is_a == "verse") { if ((the_document_body_section[i].text).match( rgx.inline_notes_delimiter_al_regular_number_note )) { @@ -1052,22 +1052,22 @@ template SiSUdocAbstraction() { } } if (an_object["glossary_nugget"].length == 0) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "empty"; - comp_obj_heading_.of_section = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "(skip) there is no Glossary section"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_glossary_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "empty"; + comp_obj_heading_.typeinfo.of_section = "empty"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "(skip) there is no Glossary section"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_glossary_section ~= comp_obj_heading_; } else { writeln("gloss"); } @@ -1081,58 +1081,58 @@ template SiSUdocAbstraction() { auto biblio_ordered = biblio._bibliography_(biblio_unsorted_incomplete, bib_arr_json); if (biblio_ordered.length > 0) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "bibliography"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Bibliography"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "_part_bibliography"; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_bibliography_section ~= comp_obj_heading_; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "bibliography"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Bibliography"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "bibliography"; - comp_obj_heading_.marked_up_level = "1"; - comp_obj_heading_.heading_lev_markup = 4; - comp_obj_heading_.heading_lev_collapsed = 2; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.anchor_tags = ["bibliography"]; - the_bibliography_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "bibliography"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Bibliography"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "_part_bibliography"; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_bibliography_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "bibliography"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Bibliography"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "bibliography"; + comp_obj_heading_.node.marked_up_level = "1"; + comp_obj_heading_.node.heading_lev_markup = 4; + comp_obj_heading_.node.heading_lev_collapsed = 2; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.tags.anchor_tags = ["bibliography"]; + the_bibliography_section ~= comp_obj_heading_; } else { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "empty"; - comp_obj_heading_.of_section = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "(skip) there is no Bibliography"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_bibliography_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "empty"; + comp_obj_heading_.typeinfo.of_section = "empty"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "(skip) there is no Bibliography"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_bibliography_section ~= comp_obj_heading_; } string out_; foreach (entry; biblio_ordered) { @@ -1150,21 +1150,21 @@ template SiSUdocAbstraction() { ((entry["place"].str.empty) ? "" : ", " ~ entry["place"].str), ((entry["url"].str.empty) ? "" : ", [" ~ entry["url"].str ~ "]"), ); - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "bibliography"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "bibliography"; - comp_obj_para.text = out_.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.indent_hang = 0; - comp_obj_para.indent_base = 1; - comp_obj_para.bullet = bullet; - comp_obj_para.anchor_tags = anchor_tags; - the_bibliography_section ~= comp_obj_para; + comp_obj_para = comp_obj_para.init; + comp_obj_para.typeinfo.of_part = "backmatter"; + comp_obj_para.typeinfo.of_section = "bibliography"; + comp_obj_para.typeinfo.is_of = "para"; + comp_obj_para.typeinfo.is_a = "bibliography"; + comp_obj_para.text = out_.to!string.strip; + comp_obj_para.node.ocn = 0; + comp_obj_para.node.obj_cite_number = ""; + comp_obj_para.misc.obj_cite_number_off = ""; + comp_obj_para.misc.obj_cite_number_type = 0; + comp_obj_para.attrib.indent_hang = 0; + comp_obj_para.attrib.indent_base = 1; + comp_obj_para.attrib.bullet = bullet; + comp_obj_para.tags.anchor_tags = anchor_tags; + the_bibliography_section ~= comp_obj_para; } debug(bibliosection) { foreach (o; the_bibliography_section) { @@ -1188,23 +1188,23 @@ template SiSUdocAbstraction() { } } if (an_object["blurb_nugget"].length == 0) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "empty"; - comp_obj_heading_.of_section = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "(skip) there is no Blurb section"; - comp_obj_heading_.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = ""; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_blurb_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "empty"; + comp_obj_heading_.typeinfo.of_section = "empty"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "(skip) there is no Blurb section"; + comp_obj_heading_.node.ocn = 0; + comp_obj_para.node.obj_cite_number = ""; + comp_obj_para.misc.obj_cite_number_off = ""; + comp_obj_para.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = ""; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_blurb_section ~= comp_obj_heading_; } debug(blurb) { foreach (blurb; the_blurb_section) { @@ -1215,18 +1215,18 @@ template SiSUdocAbstraction() { "hang_position" : 1, "base_position" : 1, ]; - comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; + comp_obj_toc = comp_obj_toc.init; + comp_obj_toc.typeinfo.of_part = "frontmatter"; + comp_obj_toc.typeinfo.of_section = "toc"; + comp_obj_toc.typeinfo.is_of = "para"; + comp_obj_toc.typeinfo.is_a = "toc"; + comp_obj_toc.node.ocn = 0; + comp_obj_toc.node.obj_cite_number = ""; + comp_obj_toc.misc.obj_cite_number_off = ""; + comp_obj_toc.misc.obj_cite_number_type = 0; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; + comp_obj_toc.attrib.bullet = false; if (the_endnotes_section.length > 1) { toc_txt_ = format( "{ %s }%s%s%s", @@ -1237,7 +1237,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; } if (the_glossary_section.length > 1) { @@ -1250,7 +1250,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; toc_txt_ = format( "{ %s }#%s", @@ -1259,7 +1259,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } if (the_bibliography_section.length > 1){ @@ -1272,7 +1272,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; toc_txt_ = format( @@ -1282,7 +1282,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } if (the_bookindex_section["seg"].length > 1) { @@ -1295,7 +1295,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; } if (the_bookindex_section["scroll"].length > 1) { @@ -1306,7 +1306,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } if (the_blurb_section.length > 1) { @@ -1319,7 +1319,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; toc_txt_ = format( "{ %s }#%s", @@ -1327,7 +1327,7 @@ template SiSUdocAbstraction() { "blurb", // _anchor_tag ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; comp_obj_toc.text = toc_txt_.to!string.strip; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } @@ -1338,7 +1338,7 @@ template SiSUdocAbstraction() { the_table_of_contents_section["seg"].length ); foreach (toc_linked_heading; the_table_of_contents_section["seg"]) { - writeln(mkup.indent_by_spaces_provided(toc_linked_heading.indent_hang), toc_linked_heading.text); + writeln(mkup.indent_by_spaces_provided(toc_linked_heading.attrib.indent_hang), toc_linked_heading.text); } } debug(tocscroll) { @@ -1348,7 +1348,7 @@ template SiSUdocAbstraction() { the_table_of_contents_section["seg"].length ); foreach (toc_linked_heading; the_table_of_contents_section["scroll"]) { - writeln(mkup.indent_by_spaces_provided(toc_linked_heading.indent_hang), toc_linked_heading.text); + writeln(mkup.indent_by_spaces_provided(toc_linked_heading.attrib.indent_hang), toc_linked_heading.text); } } the_document_head_section ~= the_document_body_section[0]; @@ -1357,8 +1357,8 @@ template SiSUdocAbstraction() { html_segnames ~= "endnotes"; html_segnames_ptr = html_segnames_ptr_cntr; foreach (ref section; the_endnotes_section) { - if (section.heading_lev_markup == 4) { - section.ptr_html_segnames = html_segnames_ptr; + if (section.node.heading_lev_markup == 4) { + section.ptr.html_segnames = html_segnames_ptr; break; } } @@ -1368,8 +1368,8 @@ template SiSUdocAbstraction() { html_segnames ~= "glossary"; html_segnames_ptr = html_segnames_ptr_cntr; foreach (ref section; the_glossary_section) { - if (section.heading_lev_markup == 4) { - section.ptr_html_segnames = html_segnames_ptr; + if (section.node.heading_lev_markup == 4) { + section.ptr.html_segnames = html_segnames_ptr; break; } } @@ -1379,8 +1379,8 @@ template SiSUdocAbstraction() { html_segnames ~= "bibliography"; html_segnames_ptr = html_segnames_ptr_cntr; foreach (ref section; the_bibliography_section) { - if (section.heading_lev_markup == 4) { - section.ptr_html_segnames = html_segnames_ptr; + if (section.node.heading_lev_markup == 4) { + section.ptr.html_segnames = html_segnames_ptr; break; } } @@ -1390,14 +1390,14 @@ template SiSUdocAbstraction() { html_segnames ~= "bookindex"; html_segnames_ptr = html_segnames_ptr_cntr; foreach (ref section; the_bookindex_section["scroll"]) { - if (section.heading_lev_markup == 4) { - section.ptr_html_segnames = html_segnames_ptr; + if (section.node.heading_lev_markup == 4) { + section.ptr.html_segnames = html_segnames_ptr; break; } } foreach (ref section; the_bookindex_section["seg"]) { - if (section.heading_lev_markup == 4) { - section.ptr_html_segnames = html_segnames_ptr; + if (section.node.heading_lev_markup == 4) { + section.ptr.html_segnames = html_segnames_ptr; break; } } @@ -1407,8 +1407,8 @@ template SiSUdocAbstraction() { html_segnames ~= "blurb"; html_segnames_ptr = html_segnames_ptr_cntr; foreach (ref section; the_blurb_section) { - if (section.heading_lev_markup == 4) { - section.ptr_html_segnames = html_segnames_ptr; + if (section.node.heading_lev_markup == 4) { + section.ptr.html_segnames = html_segnames_ptr; break; } } @@ -1424,7 +1424,7 @@ template SiSUdocAbstraction() { } string[] segnames_0_4; auto _image_dimensions(M,O)(M manifest_matter, O obj) { - if (obj.contains_image_without_dimensions) { + if (obj.has.contains_image_without_dimensions) { import std.math; import imageformats; int w, h, chans; @@ -1458,21 +1458,21 @@ template SiSUdocAbstraction() { return obj; } foreach (ref obj; the_document_head_section) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; } - if (obj.heading_lev_markup == 0) { + if (obj.node.heading_lev_markup == 0) { /+ TODO second hit (of two) with same assertion failure, check, fix and reinstate - assert( obj.ocn == 1, - "Title OCN should be 1 not: " ~ obj.ocn.to!string); // bug introduced 0.18.1 + assert( obj.node.ocn == 1, + "Title OCN should be 1 not: " ~ obj.node.ocn.to!string); // bug introduced 0.18.1 +/ - obj.ocn = 1; - obj.obj_cite_number = "1"; - obj.obj_cite_number_type = OCNtype.ocn; + obj.node.ocn = 1; + obj.node.obj_cite_number = "1"; + obj.misc.obj_cite_number_type = OCNtype.ocn; } /+ dom structure (marked up & collapsed) +/ if ((opt_action.html) @@ -1482,8 +1482,8 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); } @@ -1493,13 +1493,13 @@ template SiSUdocAbstraction() { dom_markedup_buffer = dom_markedup.dup; dom_collapsed_buffer = dom_collapsed.dup; foreach (ref obj; the_table_of_contents_section["scroll"]) { - if (obj.is_a == "heading") { - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + if (obj.typeinfo.is_a == "heading") { + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1510,8 +1510,8 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); } @@ -1520,24 +1520,24 @@ template SiSUdocAbstraction() { dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_table_of_contents_section["seg"]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } if ((opt_action.html) || (opt_action.html_scroll) || (opt_action.html_seg) || (opt_action.epub)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); } @@ -1546,20 +1546,20 @@ template SiSUdocAbstraction() { /+ multiple 1~ levels, loop through document body +/ if (the_document_body_section.length > 1) { foreach (ref obj; the_document_body_section) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.lev4_subtoc = lev4_subtoc[obj.segment_anchor_tag]; - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.lev4_subtoc = lev4_subtoc[obj.tags.segment_anchor_tag]; + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1570,11 +1570,11 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); - } else if (obj.is_a == "para") { + } else if (obj.typeinfo.is_a == "para") { _images ~= extract_images(obj.text); obj = _image_dimensions(manifest_matter, obj); } @@ -1588,22 +1588,22 @@ template SiSUdocAbstraction() { dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_endnotes_section) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.digit; - obj.obj_cite_number = obj_cite_digits.on.to!string; - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + obj.node.ocn = obj_cite_digits.digit; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1614,8 +1614,8 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); } @@ -1624,22 +1624,22 @@ template SiSUdocAbstraction() { /+ optional only one 1~ level +/ if (the_glossary_section.length > 1) { foreach (ref obj; the_glossary_section) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.digit; - obj.obj_cite_number = obj_cite_digits.on.to!string; - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + obj.node.ocn = obj_cite_digits.digit; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1650,36 +1650,36 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); - } else if (obj.is_a == "glossary") { + } else if (obj.typeinfo.is_a == "glossary") { obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.digit; - obj.obj_cite_number = obj_cite_digits.on.to!string; + obj.node.ocn = obj_cite_digits.digit; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; } } } /+ optional only one 1~ level +/ if (the_bibliography_section.length > 1) { foreach (ref obj; the_bibliography_section) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.digit; - obj.obj_cite_number = obj_cite_digits.on.to!string; // check - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + obj.node.ocn = obj_cite_digits.digit; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; // check + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1690,14 +1690,14 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); - } else if (obj.is_a == "bibliography") { + } else if (obj.typeinfo.is_a == "bibliography") { obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.on; - obj.obj_cite_number = obj_cite_digits.on.to!string; + obj.node.ocn = obj_cite_digits.on; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; } } } @@ -1710,21 +1710,21 @@ template SiSUdocAbstraction() { dom_markedup_buffer = dom_markedup.dup; dom_collapsed_buffer = dom_collapsed.dup; foreach (ref obj; the_bookindex_section["scroll"]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { } obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.on; - obj.obj_cite_number = obj_cite_digits.on.to!string; - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + obj.node.ocn = obj_cite_digits.on; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1735,36 +1735,36 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); - } else if (obj.is_a == "bookindex") { + } else if (obj.typeinfo.is_a == "bookindex") { obj_cite_digits = ocn_emit(OCNstatus.bkidx); - obj.ocn = obj_cite_digits.digit; - obj.obj_cite_number_bkidx = obj_cite_digits.bkidx.to!string; - obj.obj_cite_number_type = OCNtype.bkidx; + obj.node.ocn = obj_cite_digits.digit; + obj.misc.obj_cite_number_bkidx = obj_cite_digits.bkidx.to!string; + obj.misc.obj_cite_number_type = OCNtype.bkidx; } } /+ seg +/ dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_bookindex_section["seg"]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } - obj.ocn = ++ocn_; - obj.obj_cite_number = obj.ocn.to!string; - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + obj.node.ocn = ++ocn_; + obj.node.obj_cite_number = obj.node.ocn.to!string; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1775,14 +1775,14 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); - } else if (obj.is_a == "bookindex") { + } else if (obj.typeinfo.is_a == "bookindex") { ocn_bidx_ = ++ocn_bkidx_; - obj.obj_cite_number_bkidx = ocn_bidx_.to!string; // FIX need to distinguish from regular ocn - obj.obj_cite_number_type = OCNtype.bkidx; + obj.misc.obj_cite_number_bkidx = ocn_bidx_.to!string; // FIX need to distinguish from regular ocn + obj.misc.obj_cite_number_type = OCNtype.bkidx; } } /+ TODO assert failure, reinstate @@ -1793,22 +1793,22 @@ template SiSUdocAbstraction() { /+ optional only one 1~ level +/ if (the_blurb_section.length > 1) { foreach (ref obj; the_blurb_section) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { debug(dom) { writeln(obj.text); } obj_cite_digits = ocn_emit(OCNstatus.on); - obj.ocn = obj_cite_digits.on; - obj.obj_cite_number = obj_cite_digits.on.to!string; - if (obj.heading_lev_markup <= 4) { - segnames_0_4 ~= obj.segment_anchor_tag; - if (obj.heading_lev_markup == 4) { - obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; - if (html_segnames.length > obj.ptr_html_segnames + 1) { - obj.segname_next = html_segnames[obj.ptr_html_segnames + 1]; + obj.node.ocn = obj_cite_digits.on; + obj.node.obj_cite_number = obj_cite_digits.on.to!string; + if (obj.node.heading_lev_markup <= 4) { + segnames_0_4 ~= obj.tags.segment_anchor_tag; + if (obj.node.heading_lev_markup == 4) { + obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1]; + if (html_segnames.length > obj.ptr.html_segnames + 1) { + obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1]; } - assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames], - obj.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr_html_segnames]); + assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames], + obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]); } } /+ dom structure (marked up & collapsed) +/ @@ -1819,44 +1819,44 @@ template SiSUdocAbstraction() { || (opt_action.sqlite_discrete) || (opt_action.sqlite_update) || (opt_action.postgresql)) { - obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); - obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); + obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.node.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.node.heading_lev_collapsed); } obj = obj_heading_ancestors(obj, lv_ancestors_txt); - } else if (obj.is_a == "blurb") { + } else if (obj.typeinfo.is_a == "blurb") { obj_cite_digits = ocn_emit(OCNstatus.off); - obj.obj_cite_number_off = obj_cite_digits.off.to!string; - obj.obj_cite_number_type = OCNtype.non; + obj.misc.obj_cite_number_off = obj_cite_digits.off.to!string; + obj.misc.obj_cite_number_type = OCNtype.non; } } } /+ TODO - note create/insert heading object sole purpose eof close all open tags sort out: - - obj.dom_markedup = dom_markedup; - - obj.dom_collapsed = dom_collapsed; + - obj.node.dom_markedup = dom_markedup; + - obj.node.dom_collapsed = dom_collapsed; +/ - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "empty"; - comp_obj_heading_.of_section = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = ""; - comp_obj_heading_.marked_up_level = ""; - comp_obj_heading_.heading_lev_markup = 9; - comp_obj_heading_.heading_lev_collapsed = 9; - comp_obj_heading_.parent_ocn = 0; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.dom_markedup = dom_markedup.dup; - comp_obj_heading_.dom_collapsed = dom_collapsed.dup; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "empty"; + comp_obj_heading_.typeinfo.of_section = "empty"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.node.ocn = 0; + comp_obj_para.node.obj_cite_number = ""; + comp_obj_para.misc.obj_cite_number_off = ""; + comp_obj_para.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = ""; + comp_obj_heading_.node.marked_up_level = ""; + comp_obj_heading_.node.heading_lev_markup = 9; + comp_obj_heading_.node.heading_lev_collapsed = 9; + comp_obj_heading_.node.parent_ocn = 0; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.node.dom_markedup = dom_markedup.dup; + comp_obj_heading_.node.dom_collapsed = dom_collapsed.dup; comp_obj_heading_ = obj_dom_structure_set_markup_tags(comp_obj_heading_, dom_markedup, 0); comp_obj_heading_ = obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0); comp_obj_heading_ = obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt); - // the_dom_tail_section ~= comp_obj_heading_; // remove tail for now, decide on later + // the_dom_tail_section ~= comp_obj_heading_; // remove tail for now, decide on later auto document_the = [ "head": the_document_head_section, "toc_seg": the_table_of_contents_section["seg"], @@ -1924,16 +1924,16 @@ template SiSUdocAbstraction() { destroy(html_segnames); destroy(bookindex_unordered_hashes); destroy(an_object); - biblio_arr_json = []; - obj_cite_digits=ocn_emit(OCNstatus.reset); - obj_cite_digit_=0; - html_segnames_ptr=0; - html_segnames_ptr_cntr=0; - content_non_header = "8"; - dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; - dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; - dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; - dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + obj_cite_digits = ocn_emit(OCNstatus.reset); + biblio_arr_json = []; + obj_cite_digit_ = 0; + html_segnames_ptr = 0; + html_segnames_ptr_cntr = 0; + content_non_header = "8"; + dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; auto t = tuple( document_the, sequenced_document_keys, @@ -2414,19 +2414,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "verse"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "verse"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; } object_reset(an_object); @@ -2472,19 +2472,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "verse"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "verse"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; object_reset(an_object); processing.remove("verse"); @@ -2515,19 +2515,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "verse"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "verse"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; obj_cite_number_poem["end"] = obj_cite_digits.on.to!string; object_reset(an_object); @@ -2573,19 +2573,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "verse"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "verse"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; object_reset(an_object); processing.remove("verse"); @@ -2872,15 +2872,15 @@ template SiSUdocAbstraction() { an_object["is"] = "table"; auto substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta); - an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; - comp_obj_block = table_instructions(comp_obj_block, an_object["table_head"]); - comp_obj_block = table_substantive_munge_special(comp_obj_block, an_object["substantive"]); - the_document_body_section ~= comp_obj_block; + an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block = table_instructions(comp_obj_block, an_object["table_head"]); + comp_obj_block = table_substantive_munge_special(comp_obj_block, an_object["substantive"]); + the_document_body_section ~= comp_obj_block; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -2933,19 +2933,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "quote"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digit_type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "quote"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digit_type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; obj_type_status["blocks"] = TriState.off; obj_type_status["quote"] = TriState.off; @@ -2977,19 +2977,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "group"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "group"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; obj_type_status["blocks"] = TriState.off; obj_type_status["group"] = TriState.off; @@ -3020,19 +3020,19 @@ template SiSUdocAbstraction() { = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; - comp_obj_block.of_part = "body"; - comp_obj_block.of_section = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "block"; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digit_type; + comp_obj_block.typeinfo.of_part = "body"; + comp_obj_block.typeinfo.of_section = "body"; + comp_obj_block.typeinfo.is_of = "block"; + comp_obj_block.typeinfo.is_a = "block"; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digit_type; comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; obj_type_status["blocks"] = TriState.off; obj_type_status["block"] = TriState.off; @@ -3058,20 +3058,20 @@ template SiSUdocAbstraction() { heading_ptr-1, an_object["is"] ); - comp_obj_poem_ocn = comp_obj_poem_ocn.init; - comp_obj_poem_ocn.of_part = "body"; - comp_obj_poem_ocn.of_section = "body"; - comp_obj_poem_ocn.is_of = "block"; - comp_obj_poem_ocn.is_a = "poem"; - comp_obj_poem_ocn.ocn = obj_cite_digits.on; - comp_obj_poem_ocn.obj_cite_number = (obj_cite_number_poem["start"] ~ "..." ~ obj_cite_number_poem["end"]); - comp_obj_poem_ocn.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; // - comp_obj_poem_ocn.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; // - comp_obj_poem_ocn.obj_cite_number_type = obj_cite_digits.type; - comp_obj_poem_ocn.text = ""; - the_document_body_section ~= comp_obj_poem_ocn; - obj_type_status["blocks"] = TriState.off; - obj_type_status["poem"] = TriState.off; + comp_obj_poem_ocn = comp_obj_poem_ocn.init; + comp_obj_poem_ocn.typeinfo.of_part = "body"; + comp_obj_poem_ocn.typeinfo.of_section = "body"; + comp_obj_poem_ocn.typeinfo.is_of = "block"; + comp_obj_poem_ocn.typeinfo.is_a = "poem"; + comp_obj_poem_ocn.node.ocn = obj_cite_digits.on; + comp_obj_poem_ocn.node.obj_cite_number = (obj_cite_number_poem["start"] ~ "..." ~ obj_cite_number_poem["end"]); + comp_obj_poem_ocn.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; // + comp_obj_poem_ocn.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; // + comp_obj_poem_ocn.misc.obj_cite_number_type = obj_cite_digits.type; + comp_obj_poem_ocn.text = ""; + the_document_body_section ~= comp_obj_poem_ocn; + obj_type_status["blocks"] = TriState.off; + obj_type_status["poem"] = TriState.off; object_reset(an_object); processing.remove("verse"); } else if (obj_type_status["code"] == TriState.closing) { @@ -3099,19 +3099,19 @@ template SiSUdocAbstraction() { an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_code = comp_obj_code.init; - comp_obj_code.of_part = "body"; - comp_obj_code.of_section = "body"; - comp_obj_code.is_of = "block"; - comp_obj_code.is_a = "code"; - comp_obj_code.ocn = obj_cite_digits.on; - comp_obj_code.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_code.typeinfo.of_part = "body"; + comp_obj_code.typeinfo.of_section = "body"; + comp_obj_code.typeinfo.is_of = "block"; + comp_obj_code.typeinfo.is_a = "code"; + comp_obj_code.node.ocn = obj_cite_digits.on; + comp_obj_code.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_code.text = an_object["substantive"]; - comp_obj_code.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_code.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_code.inline_links = substantive_obj_misc_tuple[sObj.links]; + comp_obj_code.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_code.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_code.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_code; obj_type_status["blocks"] = TriState.off; obj_type_status["code"] = TriState.off; @@ -3143,11 +3143,11 @@ template SiSUdocAbstraction() { = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; - comp_obj_block.ocn = obj_cite_digits.on; - comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - comp_obj_block.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - comp_obj_block.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; - comp_obj_block.obj_cite_number_type = obj_cite_digits.type; + comp_obj_block.node.ocn = obj_cite_digits.on; + comp_obj_block.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + comp_obj_block.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + comp_obj_block.misc.obj_cite_number_bkidx = (obj_cite_digits.bkidx==0) ? "" : obj_cite_digits.bkidx.to!string; + comp_obj_block.misc.obj_cite_number_type = obj_cite_digits.type; comp_obj_block = table_instructions(comp_obj_block, an_object["table_head"]); comp_obj_block = table_substantive_munge(comp_obj_block, an_object["substantive"]); the_document_body_section ~= comp_obj_block; @@ -3600,20 +3600,20 @@ template SiSUdocAbstraction() { return ref H table_head, ) { static auto rgx = Rgx(); - table_object.of_part = "body"; - table_object.of_section = "body"; - table_object.is_of = "block"; - table_object.is_a = "table"; - table_object.inline_notes_reg = false; - table_object.inline_notes_star = false; - table_object.inline_links = false; + table_object.typeinfo.of_part = "body"; + table_object.typeinfo.of_section = "body"; + table_object.typeinfo.is_of = "block"; + table_object.typeinfo.is_a = "table"; + table_object.has.inline_notes_reg = false; + table_object.has.inline_notes_star = false; + table_object.has.inline_links = false; if (auto m = table_head.matchFirst(rgx.table_head_instructions)) { - table_object.table_heading = ((m["c_heading"].length > 0) && (m["c_heading"] == "h")) ? true : false; - table_object.table_number_of_columns = ((m["c_num"].length > 0) && (m["c_num"].to!int > 0)) ? m["c_num"].to!int : 0; // double check, may be obsolete + table_object.table.heading = ((m["c_heading"].length > 0) && (m["c_heading"] == "h")) ? true : false; + table_object.table.number_of_columns = ((m["c_num"].length > 0) && (m["c_num"].to!int > 0)) ? m["c_num"].to!int : 0; // double check, may be obsolete foreach (cw; m["c_widths"].matchAll(rgx.table_col_widths)) { auto x = cw.hit.matchFirst(rgx.table_col_widths_and_alignment); - table_object.table_column_widths ~= x["width"].to!int; - table_object.table_column_aligns ~= (x["align"].empty) ? "" : x["align"]; + table_object.table.column_widths ~= x["width"].to!int; + table_object.table.column_aligns ~= (x["align"].empty) ? "" : x["align"]; } } return table_object; @@ -3655,26 +3655,26 @@ template SiSUdocAbstraction() { } col_num_ = idx_c; _table_substantive ~= col ~ mng.tc_s; - if (idx_r == 0 && comp_obj_block.table_heading) { + if (idx_r == 0 && comp_obj_block.table.heading) { } else if (col.match(rgx.numeric_col) && idx_r == 1) { // conditions reversed to avoid: gdc compiled program run segfault - if ((comp_obj_block.table_column_aligns.length > idx_c) - && (comp_obj_block.table_column_aligns[idx_c].matchFirst(rgx.table_col_align_match))) { - comp_obj_block.table_column_aligns[idx_c] - = comp_obj_block.table_column_aligns[idx_c]; - } else if (comp_obj_block.table_column_aligns.length > idx_c) { - comp_obj_block.table_column_aligns[idx_c] = "r"; + if ((comp_obj_block.table.column_aligns.length > idx_c) + && (comp_obj_block.table.column_aligns[idx_c].matchFirst(rgx.table_col_align_match))) { + comp_obj_block.table.column_aligns[idx_c] + = comp_obj_block.table.column_aligns[idx_c]; + } else if (comp_obj_block.table.column_aligns.length > idx_c) { + comp_obj_block.table.column_aligns[idx_c] = "r"; } else { - comp_obj_block.table_column_aligns ~= "r"; + comp_obj_block.table.column_aligns ~= "r"; } } else if (idx_r == 1) { - if ((comp_obj_block.table_column_aligns.length > idx_c) - && (comp_obj_block.table_column_aligns[idx_c].matchFirst(rgx.table_col_align_match))) { - comp_obj_block.table_column_aligns[idx_c] - = comp_obj_block.table_column_aligns[idx_c]; - } else if (comp_obj_block.table_column_aligns.length > idx_c) { - comp_obj_block.table_column_aligns[idx_c] = "l"; + if ((comp_obj_block.table.column_aligns.length > idx_c) + && (comp_obj_block.table.column_aligns[idx_c].matchFirst(rgx.table_col_align_match))) { + comp_obj_block.table.column_aligns[idx_c] + = comp_obj_block.table.column_aligns[idx_c]; + } else if (comp_obj_block.table.column_aligns.length > idx_c) { + comp_obj_block.table.column_aligns[idx_c] = "l"; } else { - comp_obj_block.table_column_aligns ~= "l"; + comp_obj_block.table.column_aligns ~= "l"; } } } @@ -3688,55 +3688,55 @@ template SiSUdocAbstraction() { } _table_substantive = _table_substantive.replaceFirst(rgx.table_col_separator_nl, "\n"); } - if (comp_obj_block.table_number_of_columns != col_num) { - if (comp_obj_block.table_number_of_columns == 0) { - comp_obj_block.table_number_of_columns = (col_num).to!int; + if (comp_obj_block.table.number_of_columns != col_num) { + if (comp_obj_block.table.number_of_columns == 0) { + comp_obj_block.table.number_of_columns = (col_num).to!int; } else { debug(table_dev) { - writeln(comp_obj_block.table_number_of_columns, " != ", col_num); + writeln(comp_obj_block.table.number_of_columns, " != ", col_num); } } } - if (table_object.table_number_of_columns == 0 - && table_object.table_column_widths.length > 0) { + if (table_object.table.number_of_columns == 0 + && table_object.table.column_widths.length > 0) { writeln(__LINE__, " ERROR"); } - if (table_object.table_number_of_columns > 0 - && table_object.table_column_widths.length == 0) { - double col_w = (100.00 / table_object.table_number_of_columns); - foreach (i; 0..table_object.table_number_of_columns) { - table_object.table_column_widths ~= col_w; + if (table_object.table.number_of_columns > 0 + && table_object.table.column_widths.length == 0) { + double col_w = (100.00 / table_object.table.number_of_columns); + foreach (i; 0..table_object.table.number_of_columns) { + table_object.table.column_widths ~= col_w; } - } else if (table_object.table_number_of_columns - != table_object.table_column_widths.length) { + } else if (table_object.table.number_of_columns + != table_object.table.column_widths.length) { debug(table_dev) { writeln(m.hit); // further logic required } - if (table_object.table_number_of_columns > table_object.table_column_widths.length) { - double col_w = (100.00 - (table_object.table_column_widths).sum) - / (table_object.table_number_of_columns - table_object.table_column_widths.length); - foreach (i; 0..table_object.table_column_widths.length) { - table_object.table_column_widths ~= col_w; + if (table_object.table.number_of_columns > table_object.table.column_widths.length) { + double col_w = (100.00 - (table_object.table.column_widths).sum) + / (table_object.table.number_of_columns - table_object.table.column_widths.length); + foreach (i; 0..table_object.table.column_widths.length) { + table_object.table.column_widths ~= col_w; } - foreach (i; 0..(table_object.table_number_of_columns - table_object.table_column_widths.length)) { - table_object.table_column_widths ~= col_w; + foreach (i; 0..(table_object.table.number_of_columns - table_object.table.column_widths.length)) { + table_object.table.column_widths ~= col_w; } - } else if (table_object.table_number_of_columns < table_object.table_column_widths.length) { + } else if (table_object.table.number_of_columns < table_object.table.column_widths.length) { writeln(__LINE__, " warning, ERROR"); } } - if (table_object.table_column_widths.sum > 101 - || table_object.table_column_widths.sum < 95 ) { - writeln("sum: ", table_object.table_column_widths.sum, - ", array: ", table_object.table_column_widths, - ", cols: ", table_object.table_number_of_columns); + if (table_object.table.column_widths.sum > 101 + || table_object.table.column_widths.sum < 95 ) { + writeln("sum: ", table_object.table.column_widths.sum, + ", array: ", table_object.table.column_widths, + ", cols: ", table_object.table.number_of_columns); writeln(_table_substantive); } debug(table_res) { - writeln("aligns: ", comp_obj_block.table_column_aligns, "\n", - "no. of columns: ", comp_obj_block.table_number_of_columns, "\n", - "col widths: ", comp_obj_block.table_column_widths, - " sum: ", comp_obj_block.table_column_widths.sum, "\n", + writeln("aligns: ", comp_obj_block.table.column_aligns, "\n", + "no. of columns: ", comp_obj_block.table.number_of_columns, "\n", + "col widths: ", comp_obj_block.table.column_widths, + " sum: ", comp_obj_block.table.column_widths.sum, "\n", _table_substantive); } comp_obj_block.text = _table_substantive; @@ -4340,19 +4340,19 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; + comp_obj_toc.typeinfo.of_part = "frontmatter"; + comp_obj_toc.typeinfo.of_section = "toc"; + comp_obj_toc.typeinfo.is_of = "para"; + comp_obj_toc.typeinfo.is_a = "toc"; + comp_obj_toc.node.ocn = 0; + comp_obj_toc.node.obj_cite_number = ""; + comp_obj_toc.misc.obj_cite_number_off = ""; + comp_obj_toc.misc.obj_cite_number_type = 0; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; + comp_obj_toc.attrib.bullet = false; comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } else { indent=[ @@ -4360,32 +4360,32 @@ template SiSUdocAbstraction() { "base_position" : 0, ]; comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.bullet = false; + comp_obj_toc.typeinfo.of_part = "frontmatter"; + comp_obj_toc.typeinfo.of_section = "toc"; + comp_obj_toc.typeinfo.is_of = "para"; + comp_obj_toc.typeinfo.is_a = "toc"; + comp_obj_toc.node.ocn = 0; + comp_obj_toc.node.obj_cite_number = ""; + comp_obj_toc.misc.obj_cite_number_off = ""; + comp_obj_toc.misc.obj_cite_number_type = 0; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; + comp_obj_toc.attrib.bullet = false; comp_obj_toc.text = "Table of Contents"; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.of_part = "frontmatter"; - comp_obj_toc.of_section = "toc"; - comp_obj_toc.is_of = "para"; - comp_obj_toc.is_a = "toc"; - comp_obj_toc.ocn = 0; - comp_obj_toc.obj_cite_number = ""; - comp_obj_toc.obj_cite_number_off = ""; - comp_obj_toc.obj_cite_number_type = 0; - comp_obj_toc.bullet = false; - comp_obj_toc.inline_links = true; + comp_obj_toc.typeinfo.of_part = "frontmatter"; + comp_obj_toc.typeinfo.of_section = "toc"; + comp_obj_toc.typeinfo.is_of = "para"; + comp_obj_toc.typeinfo.is_a = "toc"; + comp_obj_toc.node.ocn = 0; + comp_obj_toc.node.obj_cite_number = ""; + comp_obj_toc.misc.obj_cite_number_off = ""; + comp_obj_toc.misc.obj_cite_number_type = 0; + comp_obj_toc.attrib.bullet = false; + comp_obj_toc.has.inline_links = true; switch (obj_["lev_markup_number"].to!int) { case 0: indent=[ @@ -4394,10 +4394,10 @@ template SiSUdocAbstraction() { ]; toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "toc.fnSuffix"; toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 1: .. case 3: @@ -4410,10 +4410,10 @@ template SiSUdocAbstraction() { heading_toc_, ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 4: @@ -4430,10 +4430,10 @@ template SiSUdocAbstraction() { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 5: .. case 7: @@ -4459,10 +4459,10 @@ template SiSUdocAbstraction() { "hang_position" : obj_["lev_markup_number"].to!int, "base_position" : obj_["lev_markup_number"].to!int, ]; - comp_obj_toc.indent_hang = indent["hang_position"]; - comp_obj_toc.indent_base = indent["base_position"]; + comp_obj_toc.attrib.indent_hang = indent["hang_position"]; + comp_obj_toc.attrib.indent_base = indent["base_position"]; comp_obj_toc.text = toc_txt_.to!string.strip; - comp_obj_toc.inline_links = true; + comp_obj_toc.has.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; default: @@ -4893,16 +4893,16 @@ template SiSUdocAbstraction() { (oa_j.type == JSON_TYPE.OBJECT) ); if (obj_is_ == "heading") { - oa_j.object["obj_cite_number"] = _comp_obj_heading.ocn; - oa_j.object["lev_markup_number"] = _comp_obj_heading.heading_lev_markup; - oa_j.object["lev_collapsed_number"] = _comp_obj_heading.heading_lev_collapsed; + oa_j.object["obj_cite_number"] = _comp_obj_heading.node.ocn; + oa_j.object["lev_markup_number"] = _comp_obj_heading.node.heading_lev_markup; + oa_j.object["lev_collapsed_number"] = _comp_obj_heading.node.heading_lev_collapsed; oa_j.object["heading_ptr"] - = _comp_obj_heading.ptr_heading; + = _comp_obj_heading.ptr.heading; oa_j.object["doc_object_ptr"] - = _comp_obj_heading.ptr_doc_object; + = _comp_obj_heading.ptr.doc_object; } - oa_j.object["parent_obj_cite_number"] = _comp_obj_heading.parent_ocn; - oa_j.object["parent_lev_markup_number"] = _comp_obj_heading.parent_lev_markup; + oa_j.object["parent_obj_cite_number"] = _comp_obj_heading.node.parent_ocn; + oa_j.object["parent_lev_markup_number"] = _comp_obj_heading.node.parent_lev_markup; _obj_attrib = oa_j.toString(); return _obj_attrib; } @@ -5078,46 +5078,46 @@ template SiSUdocAbstraction() { && opt_action.section_bookindex)) { string bi_tmp_seg, bi_tmp_scroll; string[] bi_tmp_tags; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "bookindex"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Book Index"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "_part_book_index"; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading.inline_links = true; - bookindex_section["scroll"] ~= comp_obj_heading_; - bookindex_section["seg"] ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "bookindex"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Book Index"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "_part_book_index"; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading.has.inline_links = true; + bookindex_section["scroll"] ~= comp_obj_heading_; + bookindex_section["seg"] ~= comp_obj_heading_; ++mkn; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "bookindex"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Index"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "bookindex"; - comp_obj_heading_.marked_up_level = "1"; - comp_obj_heading_.heading_lev_markup = 4; - comp_obj_heading_.heading_lev_collapsed = 2; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading.inline_links = false; - comp_obj_heading_.anchor_tags = ["bookindex"]; - bookindex_section["scroll"] ~= comp_obj_heading_; - bookindex_section["seg"] ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "bookindex"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Index"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "bookindex"; + comp_obj_heading_.node.marked_up_level = "1"; + comp_obj_heading_.node.heading_lev_markup = 4; + comp_obj_heading_.node.heading_lev_collapsed = 2; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading.has.inline_links = false; + comp_obj_heading_.tags.anchor_tags = ["bookindex"]; + bookindex_section["scroll"] ~= comp_obj_heading_; + bookindex_section["seg"] ~= comp_obj_heading_; ++mkn; import std.array : appender; auto buffer = appender!(char[])(); @@ -5174,42 +5174,42 @@ template SiSUdocAbstraction() { bi_tmp_seg ~= " \\\\\n "; ++skn; } - bi_tmp_scroll = (bi_tmp_scroll).replaceFirst(rgx.trailing_linebreak, ""); - bi_tmp_seg = (bi_tmp_seg).replaceFirst(rgx.trailing_linebreak, ""); - comp_obj_para = comp_obj_para.init; - comp_obj_para.of_part = "backmatter"; - comp_obj_para.of_section = "bookindex"; - comp_obj_para.is_of = "para"; - comp_obj_para.is_a = "bookindex"; - comp_obj_para.text = bi_tmp_scroll.to!string.strip; - comp_obj_para.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_para.obj_cite_number_off = ""; - comp_obj_para.obj_cite_number_type = 0; - comp_obj_para.anchor_tags = bi_tmp_tags; - comp_obj_para.indent_hang = 0; - comp_obj_para.indent_base = 1; - comp_obj_para.bullet = false; - comp_obj_para.inline_links = true; - bookindex_section["scroll"] ~= comp_obj_para; - comp_obj_para.text = bi_tmp_seg.to!string.strip; - bookindex_section["seg"] ~= comp_obj_para; + bi_tmp_scroll = (bi_tmp_scroll).replaceFirst(rgx.trailing_linebreak, ""); + bi_tmp_seg = (bi_tmp_seg).replaceFirst(rgx.trailing_linebreak, ""); + comp_obj_para = comp_obj_para.init; + comp_obj_para.typeinfo.of_part = "backmatter"; + comp_obj_para.typeinfo.of_section = "bookindex"; + comp_obj_para.typeinfo.is_of = "para"; + comp_obj_para.typeinfo.is_a = "bookindex"; + comp_obj_para.text = bi_tmp_scroll.to!string.strip; + comp_obj_para.node.ocn = 0; + comp_obj_para.node.obj_cite_number = ""; + comp_obj_para.misc.obj_cite_number_off = ""; + comp_obj_para.misc.obj_cite_number_type = 0; + comp_obj_para.tags.anchor_tags = bi_tmp_tags; + comp_obj_para.attrib.indent_hang = 0; + comp_obj_para.attrib.indent_base = 1; + comp_obj_para.attrib.bullet = false; + comp_obj_para.has.inline_links = true; + bookindex_section["scroll"] ~= comp_obj_para; + comp_obj_para.text = bi_tmp_seg.to!string.strip; + bookindex_section["seg"] ~= comp_obj_para; ++mkn; } } else { // no book index, (figure out what to do here) - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.text = "(skip) there is no Book Index"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - bookindex_section["scroll"] ~= comp_obj_heading_; - bookindex_section["seg"] ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.text = "(skip) there is no Book Index"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + bookindex_section["scroll"] ~= comp_obj_heading_; + bookindex_section["seg"] ~= comp_obj_heading_; } auto t = tuple(bookindex_section, obj_cite_digits); return t; @@ -5227,12 +5227,12 @@ template SiSUdocAbstraction() { int cntr, ) in { - assert((contents_am[cntr].is_a == "para") - || (contents_am[cntr].is_a == "heading") - || (contents_am[cntr].is_a == "quote") - || (contents_am[cntr].is_a == "group") - || (contents_am[cntr].is_a == "block") - || (contents_am[cntr].is_a == "verse")); + assert((contents_am[cntr].typeinfo.is_a == "para") + || (contents_am[cntr].typeinfo.is_a == "heading") + || (contents_am[cntr].typeinfo.is_a == "quote") + || (contents_am[cntr].typeinfo.is_a == "group") + || (contents_am[cntr].typeinfo.is_a == "block") + || (contents_am[cntr].typeinfo.is_a == "verse")); assert(cntr >= previous_count); previous_count=cntr; assert( @@ -5308,81 +5308,81 @@ template SiSUdocAbstraction() { ObjGenericComposite comp_obj_heading_; if ((endnotes_["notes"].length > 0) && (opt_action.backmatter && opt_action.section_endnotes)) { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "endnotes"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Endnotes"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "_part_endnotes"; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_endnotes_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "endnotes"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Endnotes"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "_part_endnotes"; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_endnotes_section ~= comp_obj_heading_; ++mkn; - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "backmatter"; - comp_obj_heading_.of_section = "endnotes"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "Endnotes"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.segment_anchor_tag = "endnotes"; - comp_obj_heading_.marked_up_level = "1"; - comp_obj_heading_.heading_lev_markup = 4; - comp_obj_heading_.heading_lev_collapsed = 2; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.anchor_tags = ["endnotes"]; - the_endnotes_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "backmatter"; + comp_obj_heading_.typeinfo.of_section = "endnotes"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "Endnotes"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.tags.segment_anchor_tag = "endnotes"; + comp_obj_heading_.node.marked_up_level = "1"; + comp_obj_heading_.node.heading_lev_markup = 4; + comp_obj_heading_.node.heading_lev_collapsed = 2; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + comp_obj_heading_.tags.anchor_tags = ["endnotes"]; + the_endnotes_section ~= comp_obj_heading_; ++mkn; } else { - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.of_part = "empty"; - comp_obj_heading_.of_section = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = "(skip) there are no Endnotes"; - comp_obj_heading_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_heading_.marked_up_level = "B"; - comp_obj_heading_.heading_lev_markup = 1; - comp_obj_heading_.heading_lev_collapsed = 1; - comp_obj_heading_.parent_ocn = 1; - comp_obj_heading_.parent_lev_markup = 0; - the_endnotes_section ~= comp_obj_heading_; + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.typeinfo.of_part = "empty"; + comp_obj_heading_.typeinfo.of_section = "empty"; + comp_obj_heading_.typeinfo.is_of = "para"; + comp_obj_heading_.typeinfo.is_a = "heading"; + comp_obj_heading_.text = "(skip) there are no Endnotes"; + comp_obj_heading_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_heading_.node.marked_up_level = "B"; + comp_obj_heading_.node.heading_lev_markup = 1; + comp_obj_heading_.node.heading_lev_collapsed = 1; + comp_obj_heading_.node.parent_ocn = 1; + comp_obj_heading_.node.parent_lev_markup = 0; + the_endnotes_section ~= comp_obj_heading_; } if (opt_action.backmatter && opt_action.section_endnotes) { ObjGenericComposite comp_obj_endnote_; - comp_obj_endnote_ = comp_obj_endnote_.init; - comp_obj_endnote_.of_part = "backmatter"; - comp_obj_endnote_.of_section = "endnote"; - comp_obj_endnote_.is_of = "para"; - comp_obj_endnote_.is_a = "endnote"; - comp_obj_endnote_.ocn = 0; - comp_obj_heading_.obj_cite_number = ""; - comp_obj_heading_.obj_cite_number_off = ""; - comp_obj_heading_.obj_cite_number_type = 0; - comp_obj_endnote_.indent_hang = 0; - comp_obj_endnote_.indent_base = 0; - comp_obj_endnote_.bullet = false; + comp_obj_endnote_ = comp_obj_endnote_.init; + comp_obj_endnote_.typeinfo.of_part = "backmatter"; + comp_obj_endnote_.typeinfo.of_section = "endnote"; + comp_obj_endnote_.typeinfo.is_of = "para"; + comp_obj_endnote_.typeinfo.is_a = "endnote"; + comp_obj_endnote_.node.ocn = 0; + comp_obj_heading_.node.obj_cite_number = ""; + comp_obj_heading_.misc.obj_cite_number_off = ""; + comp_obj_heading_.misc.obj_cite_number_type = 0; + comp_obj_endnote_.attrib.indent_hang = 0; + comp_obj_endnote_.attrib.indent_base = 0; + comp_obj_endnote_.attrib.bullet = false; foreach (i, endnote; endnotes_["notes"]) { auto m = endnote.matchFirst(rgx.note_ref); string notenumber = m.captures[1].to!string; string anchor_tag = "note_" ~ notenumber; - comp_obj_endnote_.anchor_tags = [ endnotes_["anchor"][i] ]; - comp_obj_endnote_.inline_links = true; + comp_obj_endnote_.tags.anchor_tags = [ endnotes_["anchor"][i] ]; + comp_obj_endnote_.has.inline_links = true; comp_obj_endnote_.text = endnote.strip; the_endnotes_section ~= comp_obj_endnote_; } @@ -5534,12 +5534,12 @@ template SiSUdocAbstraction() { p_["obj_cite_number"] = lv4; } ObjGenericComposite comp_obj_location; - comp_obj_location = comp_obj_location.init; - comp_obj_location.is_a = is_; - comp_obj_location.ocn = obj_cite_digits.on; - comp_obj_location.segment_anchor_tag = segment_anchor_tag.to!string; - comp_obj_location.parent_ocn = p_["obj_cite_number"]; - comp_obj_location.parent_lev_markup = p_["lev_markup_number"]; + comp_obj_location = comp_obj_location.init; + comp_obj_location.typeinfo.is_a = is_; + comp_obj_location.node.ocn = obj_cite_digits.on; + comp_obj_location.tags.segment_anchor_tag = segment_anchor_tag.to!string; + comp_obj_location.node.parent_ocn = p_["obj_cite_number"]; + comp_obj_location.node.parent_lev_markup = p_["lev_markup_number"]; debug(node) { if (lev_markup_number.match(rgx.levels_numbered_headings)) { writeln("x ", _node.to!string); @@ -5547,9 +5547,9 @@ template SiSUdocAbstraction() { writeln("- ", _node.to!string); } } - assert(comp_obj_location.parent_lev_markup >= 4); - assert(comp_obj_location.parent_lev_markup <= 7); - assert(comp_obj_location.parent_ocn >= 0); + assert(comp_obj_location.node.parent_lev_markup >= 4); + assert(comp_obj_location.node.parent_lev_markup <= 7); + assert(comp_obj_location.node.parent_ocn >= 0); return comp_obj_location; } invariant() { @@ -5685,29 +5685,29 @@ template SiSUdocAbstraction() { break; } ObjGenericComposite _comp_obj_heading_; - _comp_obj_heading_ = _comp_obj_heading_.init; - _comp_obj_heading_.of_part = "body"; - _comp_obj_heading_.of_section = "body"; - _comp_obj_heading_.is_of = "para"; - _comp_obj_heading_.is_a = "heading"; - _comp_obj_heading_.text = _text.to!string.strip; - _comp_obj_heading_.ocn = obj_cite_digits.on; - _comp_obj_heading_.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; - _comp_obj_heading_.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; - _comp_obj_heading_.obj_cite_number_type = obj_cite_digits.type; - _comp_obj_heading_.segment_anchor_tag = segment_anchor_tag.to!string; - _comp_obj_heading_.marked_up_level = lev; - _comp_obj_heading_.heading_lev_markup = (!(lev_markup_number.empty) ? lev_markup_number.to!int : 0); - _comp_obj_heading_.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? lev_collapsed_number.to!int : 0); - _comp_obj_heading_.parent_ocn = p_["obj_cite_number"]; - _comp_obj_heading_.parent_lev_markup = p_["lev_markup_number"]; - _comp_obj_heading_.heading_ancestors_text = lv_ancestors_txt; - _comp_obj_heading_.ptr_doc_object = cntr_; - _comp_obj_heading_.ptr_html_segnames = ((lev_markup_number == "4") ? html_segnames_ptr : 0); - _comp_obj_heading_.ptr_heading = ptr_; - _comp_obj_heading_.inline_notes_reg = flag_notes_reg; - _comp_obj_heading_.inline_notes_star = flag_notes_star; - _comp_obj_heading_.inline_links = flag_links; + _comp_obj_heading_ = _comp_obj_heading_.init; + _comp_obj_heading_.typeinfo.of_part = "body"; + _comp_obj_heading_.typeinfo.of_section = "body"; + _comp_obj_heading_.typeinfo.is_of = "para"; + _comp_obj_heading_.typeinfo.is_a = "heading"; + _comp_obj_heading_.text = _text.to!string.strip; + _comp_obj_heading_.node.ocn = obj_cite_digits.on; + _comp_obj_heading_.node.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string; + _comp_obj_heading_.misc.obj_cite_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; + _comp_obj_heading_.misc.obj_cite_number_type = obj_cite_digits.type; + _comp_obj_heading_.tags.segment_anchor_tag = segment_anchor_tag.to!string; + _comp_obj_heading_.node.marked_up_level = lev; + _comp_obj_heading_.node.heading_lev_markup = (!(lev_markup_number.empty) ? lev_markup_number.to!int : 0); + _comp_obj_heading_.node.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? lev_collapsed_number.to!int : 0); + _comp_obj_heading_.node.parent_ocn = p_["obj_cite_number"]; + _comp_obj_heading_.node.parent_lev_markup = p_["lev_markup_number"]; + _comp_obj_heading_.tags.heading_ancestors_text = lv_ancestors_txt; + _comp_obj_heading_.ptr.doc_object = cntr_; + _comp_obj_heading_.ptr.html_segnames = ((lev_markup_number == "4") ? html_segnames_ptr : 0); + _comp_obj_heading_.ptr.heading = ptr_; + _comp_obj_heading_.has.inline_notes_reg = flag_notes_reg; + _comp_obj_heading_.has.inline_notes_star = flag_notes_star; + _comp_obj_heading_.has.inline_links = flag_links; debug(node) { if (lev_markup_number.match(rgx.levels_numbered_headings)) { writeln("* ", _node.to!string); @@ -5718,34 +5718,34 @@ template SiSUdocAbstraction() { writeln("* ", _node.to!string); } } - assert(_comp_obj_heading_.parent_lev_markup <= 7); - assert(_comp_obj_heading_.parent_ocn >= 0); + assert(_comp_obj_heading_.node.parent_lev_markup <= 7); + assert(_comp_obj_heading_.node.parent_ocn >= 0); if (lev_markup_number.match(rgx.levels_numbered_headings)) { - assert(_comp_obj_heading_.heading_lev_markup <= 7); - assert(_comp_obj_heading_.ocn >= 0); - if (_comp_obj_heading_.parent_lev_markup > 0) { - assert(_comp_obj_heading_.parent_lev_markup < _comp_obj_heading_.heading_lev_markup); - if (_comp_obj_heading_.ocn != 0) { - assert(_comp_obj_heading_.parent_ocn < _comp_obj_heading_.ocn); + assert(_comp_obj_heading_.node.heading_lev_markup <= 7); + assert(_comp_obj_heading_.node.ocn >= 0); + if (_comp_obj_heading_.node.parent_lev_markup > 0) { + assert(_comp_obj_heading_.node.parent_lev_markup < _comp_obj_heading_.node.heading_lev_markup); + if (_comp_obj_heading_.node.ocn != 0) { + assert(_comp_obj_heading_.node.parent_ocn < _comp_obj_heading_.node.ocn); } } - if (_comp_obj_heading_.heading_lev_markup == 0) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_sect_A); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_sect_B) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_sect_A); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_sect_C) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_sect_B); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_sect_D) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_sect_C); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_text_1) { - assert(_comp_obj_heading_.parent_lev_markup <= DocStructMarkupHeading.h_sect_D); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_text_2) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_text_1); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_text_3) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_text_2); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_text_4) { - assert(_comp_obj_heading_.parent_lev_markup == DocStructMarkupHeading.h_text_3); - } else if (_comp_obj_heading_.heading_lev_markup == DocStructMarkupHeading.h_text_5) { + if (_comp_obj_heading_.node.heading_lev_markup == 0) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_sect_A); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_sect_B) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_sect_A); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_sect_C) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_sect_B); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_sect_D) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_sect_C); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_text_1) { + assert(_comp_obj_heading_.node.parent_lev_markup <= DocStructMarkupHeading.h_sect_D); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_text_2) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_text_1); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_text_3) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_text_2); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_text_4) { + assert(_comp_obj_heading_.node.parent_lev_markup == DocStructMarkupHeading.h_text_3); + } else if (_comp_obj_heading_.node.heading_lev_markup == DocStructMarkupHeading.h_text_5) { } } return _comp_obj_heading_; diff --git a/src/sdp/meta/metadoc_summary.d b/src/sdp/meta/metadoc_summary.d index 7db1b23..0566ff5 100644 --- a/src/sdp/meta/metadoc_summary.d +++ b/src/sdp/meta/metadoc_summary.d @@ -28,18 +28,18 @@ template SiSUabstractionSummary() { ]; foreach (k; doc_matters.xml.keys_seq.seg) { foreach (obj; doc_abstraction[k]) { - if (obj.of_part != "empty") { - if (!empty(obj.obj_cite_number)) { + if (obj.typeinfo.of_part != "empty") { + if (!empty(obj.node.obj_cite_number)) { if (k == "body") { - check["last_obj_cite_number_body"] = obj.obj_cite_number; + check["last_obj_cite_number_body"] = obj.node.obj_cite_number; } - if (!(obj.obj_cite_number.empty)) { - check["last_obj_cite_number"] = obj.obj_cite_number; + if (!(obj.node.obj_cite_number.empty)) { + check["last_obj_cite_number"] = obj.node.obj_cite_number; } } if (k == "bookindex_seg") { - if (obj.obj_cite_number_type == 2) { - check["last_obj_cite_number_bkidx"] = obj.obj_cite_number_bkidx; + if (obj.misc.obj_cite_number_type == 2) { + check["last_obj_cite_number_bkidx"] = obj.misc.obj_cite_number_bkidx; } } } diff --git a/src/sdp/meta/object_setter.d b/src/sdp/meta/object_setter.d index 380bab7..2e92877 100644 --- a/src/sdp/meta/object_setter.d +++ b/src/sdp/meta/object_setter.d @@ -6,63 +6,77 @@ module sdp.meta.object_setter; template ObjectSetter() { /+ structs +/ - struct HeadingAttrib { - string lev = "9"; - int heading_lev_markup = 9; - int heading_lev_collapsed = 9; - int[] closes_lev_collapsed = []; - int[] closes_lev_markup = []; - int array_ptr = 0; - int heading_array_ptr_segments = 0; + struct DocObj_TypeInfo_ { + string of_part = ""; // frontmatter, body, backmatter + string of_section = ""; // toc, body, glossary, biography, book index, blurb + string is_of = ""; // para, block ? + string is_a = ""; // heading, para, table, code block, group, ... } - struct ObjGenericComposite { - // size_t id; - string of_part = ""; - string of_section = ""; - string is_of = ""; - string is_a = ""; - string text = ""; - string obj_cite_number = ""; - string obj_cite_number_off = ""; - string obj_cite_number_bkidx = ""; - int obj_cite_number_type = 0; - string[] anchor_tags = []; + struct DocObj_TxtAttrib_ { int indent_base = 0; int indent_hang = 0; bool bullet = false; + string language = ""; // not implemented, consider + } + struct DocObj_Has_ { bool inline_links = false; bool inline_notes_reg = false; bool inline_notes_star = false; bool contains_image_without_dimensions = false; - string language = ""; // not implemented, consider - string code_block_syntax = ""; - int table_number_of_columns = 0; - double[] table_column_widths = []; - string[] table_column_aligns = []; - bool table_heading = false; - bool table_walls = false; // not implemented - int ocn = 0; - string segment_anchor_tag = ""; - string segname_prev = ""; - string segname_next = ""; - int parent_lev_markup = 0; - int parent_ocn = 0; - int[] ancestors = []; + } + struct DocObj_Node_ { + string[string][string] node; + int ocn = 0; // duplicated as string with obj_cite_number + string obj_cite_number = ""; // duplicated as int with ocn may apply additional info for backmatter (glossary, biblio etc.) string marked_up_level = "9"; int heading_lev_markup = 9; int heading_lev_collapsed = 9; int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,]; int[] heading_ancestors = [ 0, 0, 0, 0, 0, 0, 0, 0,]; + int parent_lev_markup = 0; + int parent_ocn = 0; + int[] ancestors = []; + } + struct DocObj_Table_ { + int number_of_columns = 0; + double[] column_widths = []; + string[] column_aligns = []; + bool heading = false; + bool walls = false; // not implemented + } + struct DocObj_CodeBlock_ { + string syntax = ""; + } + struct DocObj_Pointer_ { + int doc_object = 0; + int html_segnames = 0; + int heading = 0; + } + struct DocObj_Tags_ { string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; + string segment_anchor_tag = ""; + string segname_prev = ""; + string segname_next = ""; string[] lev4_subtoc = []; - int heading_array_ptr = 0; - int ptr_doc_object = 0; - int ptr_html_segnames = 0; - int ptr_heading = 0; - int array_ptr = 0; - int heading_array_ptr_segments = 0; - string[string][string] node; + string[] anchor_tags = []; + } + struct DocObj_Misc_ { + string obj_cite_number_bkidx = ""; + string obj_cite_number_off = ""; + int obj_cite_number_type = 0; // { ocn, non, bkidx } + } + struct ObjGenericComposite { + string text = ""; + DocObj_TypeInfo_ typeinfo; + DocObj_TxtAttrib_ attrib; + DocObj_Tags_ tags; + DocObj_Has_ has; + DocObj_Table_ table; + DocObj_CodeBlock_ code_block; + DocObj_Misc_ misc; + DocObj_Pointer_ ptr; + DocObj_Node_ node; } struct TheObjects { ObjGenericComposite[] oca; diff --git a/src/sdp/output/epub3.d b/src/sdp/output/epub3.d index 3209fae..18b9986 100644 --- a/src/sdp/output/epub3.d +++ b/src/sdp/output/epub3.d @@ -104,20 +104,20 @@ template outputEPub3() { debug(epubmanifest) { foreach (s; doc_matters.xml.keys_seq.seg) { foreach (obj; doc_abstraction[s]) { - if (obj.is_a == "heading") { - if (obj.heading_lev_markup == 4) { + if (obj.typeinfo.is_a == "heading") { + if (obj.node.heading_lev_markup == 4) { writefln( "%s~ [%s.xhtml] %s", obj.marked_up_level, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, obj.text ); - } else if (obj.heading_lev_markup > 4) { + } else if (obj.node.heading_lev_markup > 4) { writefln( "%s~ [%s.xhtml#%s] %s", obj.marked_up_level, - obj.segment_anchor_tag, - obj.obj_cite_number, + obj.tags.segment_anchor_tag, + obj.node.obj_cite_number, obj.text ); } @@ -146,49 +146,49 @@ template outputEPub3() { ); foreach (sect; doc_matters.xml.keys_seq.seg) { foreach (obj; doc_abstraction[sect]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip; foreach_reverse (n; 0 .. 7) { string k = n.to!string; - switch (obj.dom_collapsed[n]) { + switch (obj.node.dom_collapsed[n]) { case DomTags.close : toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "" ~ "\n"; toc ~= markup.indent_by_spaces_provided(n, " ") ~ "" ~ "\n"; break; case DomTags.close_and_open : toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "" ~ "\n"; - if (obj.heading_lev_markup < 4) { + if (obj.node.heading_lev_markup < 4) { toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "
  • " ~ "\n" ~ markup.indent_by_spaces_provided((n + 2), " ") - ~ "" + ~ "" ~ _txt ~ "" ~ "\n"; } else { - string hashtag =(obj.heading_lev_markup == 4) + string hashtag =(obj.node.heading_lev_markup == 4) ? "" - : ("#" ~ obj.ocn.to!string); + : ("#" ~ obj.node.ocn.to!string); toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "
  • " ~ "\n" ~ markup.indent_by_spaces_provided((n + 2), " ") - ~ "" + ~ "" ~ _txt ~ "" ~ "\n"; } break; case DomTags.open : toc ~= markup.indent_by_spaces_provided(n, " ") ~ "
      " ~ "\n"; - if (obj.heading_lev_markup < 4) { + if (obj.node.heading_lev_markup < 4) { toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "
    1. " ~ "\n" ~ markup.indent_by_spaces_provided((n + 2), " ") - ~ "" + ~ "" ~ _txt ~ "" ~ "\n"; } else { - string hashtag =(obj.heading_lev_markup == 4) + string hashtag =(obj.node.heading_lev_markup == 4) ? "" - : ("#" ~ obj.ocn.to!string); + : ("#" ~ obj.node.ocn.to!string); toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "
    2. " ~ "\n" ~ markup.indent_by_spaces_provided((n + 2), " ") - ~ "" + ~ "" ~ _txt ~ "" ~ "\n"; } @@ -243,11 +243,11 @@ template outputEPub3() { ); foreach (sect; doc_matters.xml.keys_seq.seg) { foreach (obj; doc_abstraction[sect]) { - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip; - string hashtag =(obj.heading_lev_markup <= 4) ? "" : ("#" ~ obj.ocn.to!string); + string hashtag =(obj.node.heading_lev_markup <= 4) ? "" : ("#" ~ obj.node.ocn.to!string); foreach_reverse (k; 0 .. 7) { - switch (obj.dom_markedup[k]) { + switch (obj.node.dom_markedup[k]) { case DomTags.close : toc ~= "\n "; break; @@ -262,7 +262,7 @@ template outputEPub3() { ¶", counter, _txt, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, hashtag, ); break; @@ -276,7 +276,7 @@ template outputEPub3() { ¶", counter, _txt, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, hashtag, ); break; @@ -310,12 +310,12 @@ template outputEPub3() { foreach (part; doc_matters.xml.keys_seq.seg) { foreach (obj; doc_abstraction[part]) { string _txt = xhtml_format.special_characters(obj, obj.text); - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.heading_lev_markup) { + switch (obj.node.heading_lev_markup) { case 0: .. case 3: /+ fill buffer, and replace with new levels from 1 to 3 +/ - switch (obj.heading_lev_markup) { + switch (obj.node.heading_lev_markup) { case 0: top_level_headings[0] = ""; top_level_headings[1] = ""; @@ -335,16 +335,16 @@ template outputEPub3() { top_level_headings[3] = ""; goto default; default: - doc_parts_ ~= obj.segment_anchor_tag; - doc_epub3[obj.segment_anchor_tag] ~= xhtml_format.epub3_seg_head(doc_matters); + doc_parts_ ~= obj.tags.segment_anchor_tag; + doc_epub3[obj.tags.segment_anchor_tag] ~= xhtml_format.epub3_seg_head(doc_matters); auto t = xhtml_format.heading_seg(obj, _txt, suffix, "epub"); - doc_epub3[obj.segment_anchor_tag] ~= t[0]; - doc_epub3_endnotes[obj.segment_anchor_tag] ~= t[1]; + doc_epub3[obj.tags.segment_anchor_tag] ~= t[0]; + doc_epub3_endnotes[obj.tags.segment_anchor_tag] ~= t[1]; break; } break; case 4: - segment_filename = obj.segment_anchor_tag; + segment_filename = obj.tags.segment_anchor_tag; doc_epub3[segment_filename] ~= xhtml_format.epub3_seg_head(doc_matters); auto t = xhtml_format.heading_seg(obj, _txt, suffix, "epub"); doc_epub3[segment_filename] ~= t[0]; @@ -357,23 +357,23 @@ template outputEPub3() { break; case 8: .. case 9: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup); writeln(__FILE__, ":", __LINE__, ": ", obj.text); } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup); } break; } } else { assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.of_part) { + switch (obj.typeinfo.of_part) { case "frontmatter": assert(part == "head" || "toc_seg"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "toc": auto t = xhtml_format.para_seg(obj, _txt, suffix, "epub"); doc_epub3[segment_filename] ~= t[0]; @@ -381,22 +381,22 @@ template outputEPub3() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "body": assert(part == "body"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "para": auto t = xhtml_format.para_seg(obj, _txt, suffix, "epub"); doc_epub3[segment_filename] ~= t[0]; @@ -404,13 +404,13 @@ template outputEPub3() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; case "block": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "quote": auto t = xhtml_format.quote_seg(obj, _txt, suffix, "epub"); doc_epub3[segment_filename] ~= t[0].to!string; @@ -442,23 +442,23 @@ template outputEPub3() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "backmatter": assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "endnote": assert(part == "endnotes"); auto t = xhtml_format.para_seg(obj, _txt, suffix, "epub"); doc_epub3[segment_filename] ~= t[0]; @@ -485,14 +485,14 @@ template outputEPub3() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } @@ -501,53 +501,53 @@ template outputEPub3() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part); } break; } } - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { assert(obj.text.length > 0); - if (obj.heading_lev_markup <= 4) { + if (obj.node.heading_lev_markup <= 4) { oepbs_content_parts["manifest_documents"] ~= format(q"¶ ¶", - obj.segment_anchor_tag, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, + obj.tags.segment_anchor_tag, ); oepbs_content_parts["spine"] ~= format(q"¶ ¶", - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, ); oepbs_content_parts["guide"] ~= format(q"¶ ¶", - obj.segment_anchor_tag, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, + obj.tags.segment_anchor_tag, ); - } else if (obj.heading_lev_markup > 4) { + } else if (obj.node.heading_lev_markup > 4) { oepbs_content_parts["manifest_documents"] ~= format(q"¶ ¶", - obj.segment_anchor_tag, - obj.obj_cite_number, - obj.segment_anchor_tag, - obj.obj_cite_number, + obj.tags.segment_anchor_tag, + obj.node.obj_cite_number, + obj.tags.segment_anchor_tag, + obj.node.obj_cite_number, ); oepbs_content_parts["spine"] ~= format(q"¶ ¶", - obj.segment_anchor_tag, - obj.obj_cite_number, + obj.tags.segment_anchor_tag, + obj.node.obj_cite_number, ); oepbs_content_parts["guide"] ~= format(q"¶ ¶", - obj.segment_anchor_tag, - obj.obj_cite_number, - obj.segment_anchor_tag, - obj.obj_cite_number, + obj.tags.segment_anchor_tag, + obj.node.obj_cite_number, + obj.tags.segment_anchor_tag, + obj.node.obj_cite_number, ); } } diff --git a/src/sdp/output/html.d b/src/sdp/output/html.d index ddd3c9f..6078c00 100644 --- a/src/sdp/output/html.d +++ b/src/sdp/output/html.d @@ -28,11 +28,11 @@ template outputHTML() { foreach (obj; doc_abstraction[part]) { delimit = xhtml_format.div_delimit(part, previous_part); string _txt = xhtml_format.special_characters(obj, obj.text); - switch (obj.of_part) { + switch (obj.typeinfo.of_part) { case "frontmatter": assert(part == "head" || "toc_scroll"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "heading": doc_html ~= delimit ~ xhtml_format.heading_scroll(obj, _txt, suffix); break; @@ -41,22 +41,22 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "body": assert(part == "body" || "head"); // surprise - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "heading": doc_html ~= delimit ~ xhtml_format.heading_scroll(obj, _txt, suffix); break; @@ -65,13 +65,13 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; case "block": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "quote": doc_html ~= xhtml_format.quote_scroll(obj, _txt); break; @@ -94,23 +94,23 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "backmatter": assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_scroll" || "blurb" || "tail"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "heading": doc_html ~= delimit ~ xhtml_format.heading_scroll(obj, _txt, suffix); break; @@ -131,14 +131,14 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } @@ -147,8 +147,8 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); } break; @@ -200,12 +200,12 @@ template outputHTML() { foreach (obj; doc_abstraction[part]) { delimit = xhtml_format.div_delimit(part, previous_part); string _txt = xhtml_format.special_characters(obj, obj.text); - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.heading_lev_markup) { + switch (obj.node.heading_lev_markup) { case 0: .. case 3: /+ fill buffer, and replace with new levels from 1 to 3 +/ - switch (obj.heading_lev_markup) { + switch (obj.node.heading_lev_markup) { case 0: top_level_headings[0] = ""; top_level_headings[1] = ""; @@ -226,12 +226,12 @@ template outputHTML() { goto default; default: auto t = xhtml_format.heading_seg(obj, _txt, suffix, "seg"); - top_level_headings[obj.heading_lev_markup] = t[0]; + top_level_headings[obj.node.heading_lev_markup] = t[0]; break; } break; case 4: - segment_filename = obj.segment_anchor_tag; + segment_filename = obj.tags.segment_anchor_tag; doc_html[segment_filename] ~= xhtml_format.html_head(doc_matters, "seg"); auto navigation_bar = xhtml_format.nav_pre_next_svg(obj); doc_html[segment_filename] ~= navigation_bar.toc_pre_next; // navigation bar @@ -252,45 +252,45 @@ template outputHTML() { break; case 8: .. case 9: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup); writeln(__FILE__, ":", __LINE__, ": ", obj.text); } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup); } break; } } else { assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.of_part) { + switch (obj.typeinfo.of_part) { case "frontmatter": assert(part == "head" || "toc_seg"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "toc": auto t = xhtml_format.para_seg(obj, _txt, suffix, "seg"); doc_html[segment_filename] ~= t[0].to!string; break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; case "body": assert(part == "body"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "para": auto t = xhtml_format.para_seg(obj, _txt, suffix, "seg"); doc_html[segment_filename] ~= t[0].to!string; @@ -298,13 +298,13 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; case "block": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "quote": auto t = xhtml_format.quote_seg(obj, _txt, suffix, "seg"); doc_html[segment_filename] ~= t[0].to!string; @@ -336,23 +336,23 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "backmatter": assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "endnote": assert(part == "endnotes"); auto t = xhtml_format.para_seg(obj, _txt, suffix, "seg"); doc_html[segment_filename] ~= t[0]; @@ -379,14 +379,14 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } @@ -395,7 +395,7 @@ template outputHTML() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part); } break; } diff --git a/src/sdp/output/sqlite.d b/src/sdp/output/sqlite.d index e9667ae..f45eec6 100644 --- a/src/sdp/output/sqlite.d +++ b/src/sdp/output/sqlite.d @@ -246,7 +246,7 @@ template SQLiteFormatAndLoadObject() { string o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt, ); return o; @@ -255,13 +255,13 @@ template SQLiteFormatAndLoadObject() { auto return ref const O obj, ) { string _txt = munge_html(obj); - _txt = (obj.bullet) ? ("●  " ~ _txt) : _txt; + _txt = (obj.attrib.bullet) ? ("●  " ~ _txt) : _txt; string o = format(q"¶

      %s

      ¶", - obj.is_a, - obj.indent_hang, - obj.indent_base, + obj.typeinfo.is_a, + obj.attrib.indent_hang, + obj.attrib.indent_base, _txt ); return o; @@ -273,7 +273,7 @@ template SQLiteFormatAndLoadObject() { string o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -285,7 +285,7 @@ template SQLiteFormatAndLoadObject() { string o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -296,7 +296,7 @@ template SQLiteFormatAndLoadObject() { string _txt = munge_html(obj); string o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt.stripRight ); return o; @@ -306,7 +306,7 @@ template SQLiteFormatAndLoadObject() { ) { string _txt = munge_html(obj); string o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -316,7 +316,7 @@ template SQLiteFormatAndLoadObject() { ) { string _txt = html_special_characters_code(obj.text); string o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -340,14 +340,14 @@ template SQLiteFormatAndLoadObject() { && (_table_rows.length <= row_idx+2)) { // check row_idx+2 (rather than == ++row_idx) _tablenote ~= cell; } else { - string _col_is = (row_idx == 0 && obj.table_heading) ? "th" : "td"; + string _col_is = (row_idx == 0 && obj.table.heading) ? "th" : "td"; string _align = ("style=\"text-align:" - ~ ((obj.table_column_aligns[col_idx] == "l") + ~ ((obj.table.column_aligns[col_idx] == "l") ? "left\"" : "right\"")); _table ~= "<" ~ _col_is ~ " width=\"" - ~ obj.table_column_widths[col_idx].to!string + ~ obj.table.column_widths[col_idx].to!string ~ "%\" " ~ _align ~ ">"; @@ -375,7 +375,7 @@ template SQLiteFormatAndLoadObject() { %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt, _note ); @@ -888,12 +888,12 @@ template SQLiteInsertDocObjectsLoop() { ); ¶", _metadata_tid, - obj.ocn, + obj.node.ocn, SQLinsertDelimiter!()(obj_txt["text"]), SQLinsertDelimiter!()(obj_txt["html"]), - obj.heading_lev_markup, - obj.is_of, - obj.is_a, + obj.node.heading_lev_markup, + obj.typeinfo.is_of, + obj.typeinfo.is_a, ); return _insert_doc_objects_row; } @@ -903,32 +903,32 @@ template SQLiteInsertDocObjectsLoop() { string[] _insert_doc_objects; foreach (part; doc_matters.xml.keys_seq.sql) { foreach (obj; doc_abstraction[part]) { - switch (obj.of_part) { + switch (obj.typeinfo.of_part) { case "frontmatter": assert(part == "head", part); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "heading": obj_txt = format_and_sqlite_load.heading(obj); break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "body": // assert(part == "body", part); // TODO broken - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "heading": debug (asserts) { // TODO consider and fix or remove if (part != "body") { @@ -942,13 +942,13 @@ template SQLiteInsertDocObjectsLoop() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; case "block": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "quote": obj_txt = format_and_sqlite_load.quote(obj); break; @@ -971,23 +971,23 @@ template SQLiteInsertDocObjectsLoop() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } break; case "backmatter": assert(part == "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail", part); - switch (obj.is_of) { + switch (obj.typeinfo.is_of) { case "para": - switch (obj.is_a) { + switch (obj.typeinfo.is_a) { case "heading": obj_txt = format_and_sqlite_load.heading(obj); break; @@ -1005,14 +1005,14 @@ template SQLiteInsertDocObjectsLoop() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); } break; } break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.is_of); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of); } break; } @@ -1021,28 +1021,28 @@ template SQLiteInsertDocObjectsLoop() { break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); // check where empty value could come from - writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part); // check where empty value could come from + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from } break; } - if (obj.is_a == "heading") { + if (obj.typeinfo.is_a == "heading") { if ((doc_matters.opt.action.verbose)) { writeln( - "markup: ", obj.heading_lev_markup, - "> ", obj.dom_markedup, - "; collapsed: ", obj.heading_lev_collapsed, - "> ", obj.dom_collapsed, - "; ocn: ", obj.ocn, - " node: ", obj.node, - "; parent: ", obj.parent_lev_markup, - "; ocn: ", obj.parent_ocn, + "markup: ", obj.node.heading_lev_markup, + "> ", obj.node.dom_markedup, + "; collapsed: ", obj.node.heading_lev_collapsed, + "> ", obj.node.dom_collapsed, + "; ocn: ", obj.node.ocn, + " node: ", obj.node.node, + "; parent: ", obj.node.parent_lev_markup, + "; ocn: ", obj.node.parent_ocn, "; ", ); } } - if (!(obj.is_a == "comment")) { + if (!(obj.typeinfo.is_a == "comment")) { _insert_doc_objects ~= insertDocObjectsRow(obj); } } // loop closes diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d index 785d87e..cc08bfe 100644 --- a/src/sdp/output/xmls.d +++ b/src/sdp/output/xmls.d @@ -60,7 +60,7 @@ template outputXHTMLs() { .replaceAll(rgx.xhtml_less_than, "<") .replaceAll(rgx.xhtml_greater_than, ">") .replaceAll(rgx.nbsp_char, " "); - if (!(obj.is_a == "code")) { + if (!(obj.typeinfo.is_a == "code")) { _txt = (_txt) .replaceAll(rgx.xhtml_line_break, "
      "); } @@ -340,7 +340,7 @@ template outputXHTMLs() { string _suffix = ".html", string _xml_type = "seg", ) { - if (obj.inline_links) { + if (obj.has.inline_links) { if ((_txt.match(rgx.mark_internal_site_lnk)) && (_xml_type == "scroll")) { // conditions reversed to avoid: gdc compiled program run segfault _txt = (_txt).replaceAll( @@ -362,8 +362,8 @@ template outputXHTMLs() { if (_txt.match(rgx.inline_link)) { writeln(__LINE__, " (missed) markup link identified (", - obj.inline_links, - "): ", obj.is_a, ": ", + obj.has.inline_links, + "): ", obj.typeinfo.is_a, ": ", obj.text ); } @@ -372,8 +372,8 @@ template outputXHTMLs() { if (_txt.match(rgx.inline_link)) { writeln(__LINE__, " (missed) markup link identified (", - obj.inline_links, - "): ", obj.is_a, ": ", + obj.has.inline_links, + "): ", obj.typeinfo.is_a, ": ", obj.text ); } @@ -384,7 +384,7 @@ template outputXHTMLs() { auto return ref const O obj, string _txt, ) { - if (obj.inline_notes_reg) { + if (obj.has.inline_notes_reg) { _txt = font_face(_txt); _txt = (_txt).replaceAll( rgx.inline_notes_delimiter_al_regular_number_note, @@ -393,12 +393,12 @@ template outputXHTMLs() { } debug(markup_endnotes) { if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) { - writeln(__LINE__, " (missed) markup endnote: ", obj.is_a, ": ", obj.text); + writeln(__LINE__, " (missed) markup endnote: ", obj.typeinfo.is_a, ": ", obj.text); } } debug(markup) { if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) { - writeln(__LINE__, " (missed) markup endnote: ", obj.is_a, ": ", obj.text); + writeln(__LINE__, " (missed) markup endnote: ", obj.typeinfo.is_a, ": ", obj.text); } } return _txt; @@ -408,7 +408,7 @@ template outputXHTMLs() { string _txt, ) { string[] _endnotes; - if (obj.inline_notes_reg) { + if (obj.has.inline_notes_reg) { _txt = font_face(_txt); /+ need markup for text, and separated footnote +/ foreach(m; _txt.matchAll(rgx.inline_notes_delimiter_al_regular_number_note)) { @@ -433,7 +433,7 @@ template outputXHTMLs() { ); } else if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) { debug(markup) { - writeln(__LINE__, " endnote: ", obj.is_a, ": ", obj.text); + writeln(__LINE__, " endnote: ", obj.typeinfo.is_a, ": ", obj.text); } } auto t = tuple( @@ -468,7 +468,7 @@ template outputXHTMLs() { ) { char[] lev4_subtoc; lev4_subtoc ~= "
      \n"; - foreach (subtoc; obj.lev4_subtoc) { + foreach (subtoc; obj.tags.lev4_subtoc) { if (auto m = subtoc.match(rgx.inline_link_subtoc)) { auto indent = m.captures[1].to!string; auto text = m.captures[2].to!string; @@ -493,7 +493,7 @@ template outputXHTMLs() { auto return ref const O obj, ) { string prev, next, toc; - if (obj.segment_anchor_tag == "toc") { + if (obj.tags.segment_anchor_tag == "toc") { toc = ""; prev = ""; } else { @@ -506,7 +506,7 @@ template outputXHTMLs() { ¶", ); } - if (obj.segname_prev == "") { + if (obj.tags.segname_prev == "") { prev = ""; } else { prev = format(q"¶ @@ -516,10 +516,10 @@ template outputXHTMLs() {
      ¶", - obj.segname_prev, + obj.tags.segname_prev, ); } - if (obj.segname_next == "") { + if (obj.tags.segname_next == "") { next = ""; } else { next = format(q"¶ @@ -529,7 +529,7 @@ template outputXHTMLs() { ¶", - obj.segname_next, + obj.tags.segname_next, ); } string _toc_pre_next = format(q"¶
      @@ -571,15 +571,15 @@ template outputXHTMLs() { string _txt, string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); string _horizontal_rule = "
      "; if ((_xml_type != "html") - || (obj.heading_lev_markup == 0 || obj.heading_lev_markup > 4)) { + || (obj.node.heading_lev_markup == 0 || obj.node.heading_lev_markup > 4)) { _horizontal_rule = ""; } _txt = font_face(_txt); string o; - if (obj.obj_cite_number.empty) { + if (obj.node.obj_cite_number.empty) { o = format(q"¶%s
      %s @@ -587,11 +587,11 @@ template outputXHTMLs() {
      ¶", _horizontal_rule, - obj.heading_lev_markup, - obj.is_a, + obj.node.heading_lev_markup, + obj.typeinfo.is_a, tags, _txt, - obj.heading_lev_markup, + obj.node.heading_lev_markup, ); } else { o = format(q"¶%s @@ -602,15 +602,15 @@ template outputXHTMLs() {
      ¶", _horizontal_rule, - obj.obj_cite_number, - obj.obj_cite_number, - obj.heading_lev_markup, - obj.is_a, - obj.obj_cite_number, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.node.heading_lev_markup, + obj.typeinfo.is_a, + obj.node.obj_cite_number, + obj.node.obj_cite_number, tags, _txt, - obj.heading_lev_markup, + obj.node.heading_lev_markup, ); } return o; @@ -620,7 +620,7 @@ template outputXHTMLs() { string _txt, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = inline_markup_scroll(obj, _txt, _suffix); string o = heading(obj, _txt); return o; @@ -645,19 +645,19 @@ template outputXHTMLs() { auto return ref const O obj, string _txt, ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = font_face(_txt); string o; - _txt = (obj.bullet) ? ("●  " ~ _txt) : _txt; - if (obj.obj_cite_number.empty) { + _txt = (obj.attrib.bullet) ? ("●  " ~ _txt) : _txt; + if (obj.node.obj_cite_number.empty) { o = format(q"¶

      %s %s

      ¶", - obj.is_a, - obj.indent_hang, - obj.indent_base, + obj.typeinfo.is_a, + obj.attrib.indent_hang, + obj.attrib.indent_base, tags, _txt ); @@ -668,12 +668,12 @@ template outputXHTMLs() { %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.indent_hang, - obj.indent_base, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.attrib.indent_hang, + obj.attrib.indent_base, + obj.node.obj_cite_number, tags, _txt ); @@ -685,7 +685,7 @@ template outputXHTMLs() { string _txt, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = inline_markup_scroll(obj, _txt, _suffix); string o = para(obj, _txt); return o; @@ -712,13 +712,13 @@ template outputXHTMLs() { ) { _txt = font_face(_txt); string o; - if (obj.obj_cite_number.empty) { + if (obj.node.obj_cite_number.empty) { o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); } else { @@ -728,10 +728,10 @@ template outputXHTMLs() { %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.node.obj_cite_number, _txt ); } @@ -742,7 +742,7 @@ template outputXHTMLs() { string _txt, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = inline_markup_scroll(obj, _txt, _suffix); string o = quote(obj, _txt); return o; @@ -769,13 +769,13 @@ template outputXHTMLs() { ) { _txt = font_face(_txt); string o; - if (obj.obj_cite_number.empty) { + if (obj.node.obj_cite_number.empty) { o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); } else { @@ -785,10 +785,10 @@ template outputXHTMLs() { %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.node.obj_cite_number, _txt ); } @@ -800,7 +800,7 @@ template outputXHTMLs() { string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = inline_markup_scroll(obj, _txt, _suffix); string o = group(obj, _txt); return o; @@ -827,11 +827,11 @@ template outputXHTMLs() { ) { _txt = font_face(_txt); string o; - if (obj.obj_cite_number.empty) { + if (obj.node.obj_cite_number.empty) { o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt.stripRight ); } else { @@ -839,10 +839,10 @@ template outputXHTMLs() {

      %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.node.obj_cite_number, _txt.stripRight ); } @@ -854,7 +854,7 @@ template outputXHTMLs() { string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = inline_markup_scroll(obj, _txt, _suffix); string o = block(obj, _txt); return o; @@ -881,11 +881,11 @@ template outputXHTMLs() { ) { _txt = font_face(_txt); string o; - if (obj.obj_cite_number.empty) { + if (obj.node.obj_cite_number.empty) { o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); } else { @@ -893,10 +893,10 @@ template outputXHTMLs() {

      %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.node.obj_cite_number, _txt ); } @@ -908,7 +908,7 @@ template outputXHTMLs() { string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = inline_markup_scroll(obj, _txt, _suffix); string o = verse(obj, _txt); return o; @@ -945,11 +945,11 @@ template outputXHTMLs() { && (_table_rows.length <= row_idx+2)) { _tablenote ~= cell; } else { - string _col_is = (row_idx == 0 && obj.table_heading) ? "th" : "td"; + string _col_is = (row_idx == 0 && obj.table.heading) ? "th" : "td"; string _align = ("style=\"text-align:" - ~ ((obj.table_column_aligns[col_idx] == "l") + ~ ((obj.table.column_aligns[col_idx] == "l") ? "left\"" : "right\"")); - _table ~= "<" ~ _col_is ~ " width=\"" ~ obj.table_column_widths[col_idx].to!string ~ "%\" " ~ _align ~ ">"; + _table ~= "<" ~ _col_is ~ " width=\"" ~ obj.table.column_widths[col_idx].to!string ~ "%\" " ~ _align ~ ">"; _table ~= cell; _table ~= ""; } @@ -966,7 +966,7 @@ template outputXHTMLs() { auto return ref const O obj, string _txt, ) { - auto tags = _xhtml_anchor_tags(obj.anchor_tags); + auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags); _txt = font_face(_txt); auto t = tablarize(obj, _txt); _txt = t[0]; @@ -981,10 +981,10 @@ template outputXHTMLs() { %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.node.obj_cite_number, tags, _txt, _note @@ -999,9 +999,9 @@ template outputXHTMLs() { o = format(q"¶

      %s

      ¶", - obj.is_a, - obj.indent_hang, - obj.indent_base, + obj.typeinfo.is_a, + obj.attrib.indent_hang, + obj.attrib.indent_base, _txt ); return o; @@ -1011,11 +1011,11 @@ template outputXHTMLs() { string _txt, ) { string o; - if (obj.obj_cite_number.empty) { + if (obj.node.obj_cite_number.empty) { o = format(q"¶

      %s

      ¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); } else { @@ -1023,10 +1023,10 @@ template outputXHTMLs() {

      %s

      ¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, + obj.node.obj_cite_number, + obj.node.obj_cite_number, + obj.typeinfo.is_a, + obj.node.obj_cite_number, _txt ); } diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d index c5ee70a..0093f74 100755 --- a/src/sdp/sdp.d +++ b/src/sdp/sdp.d @@ -32,7 +32,6 @@ homepage "http://sisudoc.org" void main(string[] args) { mixin SiSUrgxInit; mixin contentJSONtoSiSUstruct; - mixin SiSUnode; mixin SiSUbiblio; mixin SiSUrgxInitFlags; mixin outputHub; -- cgit v1.2.3