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 --- org/meta_abstraction.org | 1938 +++++++++++++++++++++++----------------------- org/meta_debugs.org | 36 +- org/output_sqlite.org | 98 +-- org/output_xmls.org | 398 +++++----- org/sdp.org | 17 +- 5 files changed, 1247 insertions(+), 1240 deletions(-) (limited to 'org') diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index f74c8d6..b1c08ad 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -247,7 +247,7 @@ pure auto obj_heading_ancestors(O)( 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) { @@ -292,7 +292,7 @@ pure auto obj_heading_ancestors(O)( 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; } @@ -343,7 +343,7 @@ pure auto obj_dom_structure_set_markup_tags(O)( debug(dom_magic_numbers) { writeln("marked up: ", lev, ": ", dom); } - obj.dom_markedup = dom.dup; + obj.node.dom_markedup = dom.dup; return obj; } #+END_SRC @@ -393,7 +393,7 @@ pure auto obj_dom_set_collapsed_tags(O)( debug(dom_magic_numbers) { writeln("collapsed: ", lev, ": ", dom); } - obj.dom_collapsed = dom.dup; + obj.node.dom_collapsed = dom.dup; return obj; } #+END_SRC @@ -500,29 +500,29 @@ auto heading_match_rgx = [ ]; 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], @@ -679,60 +679,60 @@ if there is a glossary section you need to: 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; @@ -803,80 +803,80 @@ if there is a blurb section you need to: 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; @@ -1037,14 +1037,14 @@ if (line.matchFirst(rgx.book_index) 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; @@ -1281,26 +1281,26 @@ if ((obj_type_status["heading"] == State.on) = 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, @@ -1320,23 +1320,23 @@ if ((obj_type_status["heading"] == State.on) #+BEGIN_SRC d /+ 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 )) { @@ -1406,22 +1406,22 @@ debug(endnotes) { #+name: abs_post #+BEGIN_SRC d 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"); } @@ -1445,58 +1445,58 @@ auto biblio_ordered #+name: abs_post #+BEGIN_SRC d 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_; } #+END_SRC @@ -1520,21 +1520,21 @@ foreach (entry; biblio_ordered) { ((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; } #+END_SRC @@ -1606,23 +1606,23 @@ debug(bookindex) { #+name: abs_post #+BEGIN_SRC d 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) { @@ -1639,18 +1639,18 @@ indent=[ "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", @@ -1661,7 +1661,7 @@ if (the_endnotes_section.length > 1) { ); 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) { @@ -1674,7 +1674,7 @@ if (the_glossary_section.length > 1) { ); 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", @@ -1683,7 +1683,7 @@ if (the_glossary_section.length > 1) { ); 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){ @@ -1696,7 +1696,7 @@ if (the_bibliography_section.length > 1){ ); 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( @@ -1706,7 +1706,7 @@ if (the_bibliography_section.length > 1){ ); 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) { @@ -1719,7 +1719,7 @@ if (the_bookindex_section["seg"].length > 1) { ); 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) { @@ -1730,7 +1730,7 @@ if (the_bookindex_section["scroll"].length > 1) { ); 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) { @@ -1743,7 +1743,7 @@ if (the_blurb_section.length > 1) { ); 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", @@ -1751,7 +1751,7 @@ if (the_blurb_section.length > 1) { "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; } @@ -1762,7 +1762,7 @@ debug(toc) { 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) { @@ -1772,7 +1772,7 @@ debug(tocscroll) { 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); } } #+END_SRC @@ -1808,8 +1808,8 @@ if (the_endnotes_section.length > 1) { 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; } } @@ -1825,8 +1825,8 @@ if (the_glossary_section.length > 1) { 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; } } @@ -1842,8 +1842,8 @@ if (the_bibliography_section.length > 1) { 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; } } @@ -1859,14 +1859,14 @@ if (the_bookindex_section["scroll"].length > 1) { 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; } } @@ -1882,8 +1882,8 @@ if (the_blurb_section.length > 1) { 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; } } @@ -1949,7 +1949,7 @@ string[] segnames_0_4; #+name: abs_post #+BEGIN_SRC d 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; @@ -1989,21 +1989,21 @@ auto _image_dimensions(M,O)(M manifest_matter, O obj) { #+name: abs_post #+BEGIN_SRC d 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) @@ -2013,8 +2013,8 @@ foreach (ref obj; the_document_head_section) { || (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); } @@ -2030,13 +2030,13 @@ if (the_table_of_contents_section["scroll"].length > 1) { 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) +/ @@ -2047,8 +2047,8 @@ if (the_table_of_contents_section["scroll"].length > 1) { || (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); } @@ -2057,24 +2057,24 @@ if (the_table_of_contents_section["scroll"].length > 1) { 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); } @@ -2089,20 +2089,20 @@ if (the_table_of_contents_section["scroll"].length > 1) { /+ 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) +/ @@ -2113,11 +2113,11 @@ if (the_document_body_section.length > 1) { || (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); } @@ -2139,22 +2139,22 @@ if (the_endnotes_section.length > 1) { 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) +/ @@ -2165,8 +2165,8 @@ if (the_endnotes_section.length > 1) { || (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); } @@ -2183,22 +2183,22 @@ if (the_endnotes_section.length > 1) { /+ 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) +/ @@ -2209,14 +2209,14 @@ if (the_glossary_section.length > 1) { || (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; } } } @@ -2231,22 +2231,22 @@ if (the_glossary_section.length > 1) { /+ 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) +/ @@ -2257,14 +2257,14 @@ if (the_bibliography_section.length > 1) { || (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; } } } @@ -2285,21 +2285,21 @@ if (the_bookindex_section["scroll"].length > 1) { 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) +/ @@ -2310,36 +2310,36 @@ if (the_bookindex_section["scroll"].length > 1) { || (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) +/ @@ -2350,14 +2350,14 @@ if (the_bookindex_section["scroll"].length > 1) { || (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 @@ -2374,22 +2374,22 @@ if (the_bookindex_section["scroll"].length > 1) { /+ 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) +/ @@ -2400,14 +2400,14 @@ if (the_blurb_section.length > 1) { || (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; } } } @@ -2420,30 +2420,30 @@ if (the_blurb_section.length > 1) { /+ 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 #+END_SRC ** 4. _return document tuple_ :post: @@ -2536,16 +2536,16 @@ destroy(the_blurb_section); 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,]; #+END_SRC *** [#A] _return document tuple_ :return:tuple: @@ -3395,19 +3395,19 @@ void _poem_block_(L,O,T,C,N,CMM)( 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); @@ -3453,19 +3453,19 @@ void _poem_block_(L,O,T,C,N,CMM)( 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"); @@ -3496,19 +3496,19 @@ void _poem_block_(L,O,T,C,N,CMM)( 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); @@ -3554,19 +3554,19 @@ void _poem_block_(L,O,T,C,N,CMM)( 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"); @@ -3696,15 +3696,15 @@ void _table_closed_make_special_notation_table_(N,CMM)( 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; @@ -3771,19 +3771,19 @@ void _block_flag_line_empty_(B,N,CMM)( 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; @@ -3821,19 +3821,19 @@ void _block_flag_line_empty_(B,N,CMM)( 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; @@ -3870,19 +3870,19 @@ void _block_flag_line_empty_(B,N,CMM)( = 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; @@ -3914,20 +3914,20 @@ void _block_flag_line_empty_(B,N,CMM)( 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"); #+END_SRC @@ -3961,19 +3961,19 @@ void _block_flag_line_empty_(B,N,CMM)( 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; @@ -4011,11 +4011,11 @@ void _block_flag_line_empty_(B,N,CMM)( = 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; @@ -4526,20 +4526,20 @@ auto table_instructions(O,H)( 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; @@ -4587,26 +4587,26 @@ auto table_array_munge(O,T)( } 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"; } } } @@ -4620,55 +4620,55 @@ auto table_array_munge(O,T)( } _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; @@ -5441,19 +5441,19 @@ static struct ObjInlineMarkup { ); 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=[ @@ -5461,32 +5461,32 @@ static struct ObjInlineMarkup { "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=[ @@ -5495,10 +5495,10 @@ static struct ObjInlineMarkup { ]; 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: @@ -5511,10 +5511,10 @@ static struct ObjInlineMarkup { 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: @@ -5531,10 +5531,10 @@ static struct ObjInlineMarkup { "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: @@ -5560,10 +5560,10 @@ static struct ObjInlineMarkup { "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: @@ -6108,16 +6108,16 @@ struct ObjAttributes { (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; } @@ -6330,46 +6330,46 @@ struct BookIndexReportSection { && 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[])(); @@ -6426,42 +6426,42 @@ struct BookIndexReportSection { 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; @@ -6496,12 +6496,12 @@ struct NotesSection { 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( @@ -6589,81 +6589,81 @@ struct NotesSection { 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_; } @@ -6869,12 +6869,12 @@ struct NodeStructureMetadata { 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); @@ -6882,9 +6882,9 @@ struct NodeStructureMetadata { 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() { @@ -7026,29 +7026,29 @@ struct NodeStructureMetadata { 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); @@ -7059,34 +7059,34 @@ struct NodeStructureMetadata { 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_; @@ -7361,73 +7361,81 @@ template ObjectSetter() { #+END_SRC ** 1. initialize structs :struct: -*** heading attribute - -#+name: meta_structs_init -#+BEGIN_SRC d -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; -} -#+END_SRC - *** [#A] _composite object_ #+name: meta_structs_init #+BEGIN_SRC d -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_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 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; } #+END_SRC diff --git a/org/meta_debugs.org b/org/meta_debugs.org index e624181..5af5cc4 100644 --- a/org/meta_debugs.org +++ b/org/meta_debugs.org @@ -89,8 +89,8 @@ debug(parent) { ); 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, @@ -117,11 +117,11 @@ debug(dumpdoc) { ); 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 ); } @@ -190,7 +190,7 @@ debug(checkdoc) { foreach (obj; contents[key]) { writefln( "[%s]\n%s", - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -213,7 +213,7 @@ debug(checkdoc) { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -234,7 +234,7 @@ debug(section_head) { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -292,7 +292,7 @@ debug(section_body) { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -308,7 +308,7 @@ debug(toc_nav_dom) { 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 : @@ -335,7 +335,7 @@ debug(toc_nav_dom) { 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 : @@ -394,7 +394,7 @@ debug(section_glossary) { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -413,7 +413,7 @@ debug(section_bibliography) { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -463,7 +463,7 @@ debug(blurb_section) { writefln( "[%s][%s]\n%s", obj.obj_cite_number, - obj.is_a, + obj.typeinfo.is_a, obj.text ); } @@ -482,11 +482,11 @@ debug(objects) { __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 ); } @@ -666,7 +666,7 @@ debug(anchor) { ); 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, @@ -688,7 +688,7 @@ debug(anchor) { 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), @@ -714,7 +714,7 @@ debug(headings) { ); 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, diff --git a/org/output_sqlite.org b/org/output_sqlite.org index c7b6571..8348870 100644 --- a/org/output_sqlite.org +++ b/org/output_sqlite.org @@ -446,7 +446,7 @@ auto html_heading(O)( string o = format(q"¶

%s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt, ); return o; @@ -465,10 +465,10 @@ auto html_heading(O)( o = format(q"¶ %s ¶", - obj.heading_lev_markup, - obj.is_a, + obj.node.heading_lev_markup, + obj.typeinfo.is_a, _txt, - obj.heading_lev_markup, + obj.node.heading_lev_markup, ); return o; } @@ -482,13 +482,13 @@ auto html_para(O)( 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; @@ -506,7 +506,7 @@ auto html_quote(O)( string o = format(q"¶

%s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -524,7 +524,7 @@ auto html_group(O)( string o = format(q"¶

%s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -541,7 +541,7 @@ auto html_block(O)( string _txt = munge_html(obj); string o = format(q"¶

%s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt.stripRight ); return o; @@ -557,7 +557,7 @@ auto html_verse(O)( ) { string _txt = munge_html(obj); string o = format(q"¶

%s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -573,7 +573,7 @@ auto html_code(O)( ) { string _txt = html_special_characters_code(obj.text); string o = format(q"¶

%s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt ); return o; @@ -603,14 +603,14 @@ auto html_table(O)( && (_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 ~ ">"; @@ -638,7 +638,7 @@ auto html_table(O)( %s

¶", - obj.is_a, + obj.typeinfo.is_a, _txt, _note ); @@ -925,7 +925,7 @@ auto table(O)( } #+END_SRC -** 4. loop, identify, load - loop template +** 4. ↻ loop, identify, load - loop template #+name: sqlite_objects_loop #+BEGIN_SRC d @@ -935,32 +935,32 @@ string doc_text; 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") { @@ -974,13 +974,13 @@ foreach (part; doc_matters.xml.keys_seq.sql) { 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; @@ -1003,23 +1003,23 @@ foreach (part; doc_matters.xml.keys_seq.sql) { 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; @@ -1037,14 +1037,14 @@ foreach (part; doc_matters.xml.keys_seq.sql) { 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; } @@ -1053,28 +1053,28 @@ foreach (part; doc_matters.xml.keys_seq.sql) { 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 @@ -1302,12 +1302,12 @@ _insert_doc_objects_row = format(q"¶ #+BEGIN_SRC d ¶", _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, ); #+END_SRC diff --git a/org/output_xmls.org b/org/output_xmls.org index 7b86093..eb0e263 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -107,7 +107,7 @@ string special_characters(O)( .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, "
"); } @@ -455,7 +455,7 @@ auto inline_links(O)( 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( @@ -477,8 +477,8 @@ auto inline_links(O)( 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 ); } @@ -487,8 +487,8 @@ auto inline_links(O)( 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 ); } @@ -505,7 +505,7 @@ auto inline_notes_scroll(O)( 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, @@ -514,12 +514,12 @@ auto inline_notes_scroll(O)( } 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; @@ -535,7 +535,7 @@ auto inline_notes_seg(O)( 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)) { @@ -560,7 +560,7 @@ auto inline_notes_seg(O)( ); } 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( @@ -614,7 +614,7 @@ string lev4_heading_subtoc(O)( ) { 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; @@ -645,7 +645,7 @@ auto nav_pre_next_svg(O)( 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 { @@ -658,7 +658,7 @@ auto nav_pre_next_svg(O)( ¶", ); } - if (obj.segname_prev == "") { + if (obj.tags.segname_prev == "") { prev = ""; } else { prev = format(q"¶ @@ -668,10 +668,10 @@ auto nav_pre_next_svg(O)(
¶", - obj.segname_prev, + obj.tags.segname_prev, ); } - if (obj.segname_next == "") { + if (obj.tags.segname_next == "") { next = ""; } else { next = format(q"¶ @@ -681,7 +681,7 @@ auto nav_pre_next_svg(O)( ¶", - obj.segname_next, + obj.tags.segname_next, ); } string _toc_pre_next = format(q"¶
@@ -730,15 +730,15 @@ auto heading(O)( 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 @@ -746,11 +746,11 @@ auto heading(O)(
¶", _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 @@ -761,15 +761,15 @@ auto heading(O)(
¶", _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; @@ -785,7 +785,7 @@ auto heading_scroll(O)( 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; @@ -823,19 +823,19 @@ auto para(O)( 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 ); @@ -846,12 +846,12 @@ auto para(O)( %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 ); @@ -869,7 +869,7 @@ auto para_scroll(O)( 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; @@ -909,13 +909,13 @@ auto quote(O)( ) { _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 { @@ -925,10 +925,10 @@ auto quote(O)( %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 ); } @@ -945,7 +945,7 @@ auto quote_scroll(O)( 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; @@ -985,13 +985,13 @@ auto group(O)( ) { _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 { @@ -1001,10 +1001,10 @@ auto group(O)( %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 ); } @@ -1022,7 +1022,7 @@ auto group_scroll(O)( 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; @@ -1062,11 +1062,11 @@ auto block(O)( ) { _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 { @@ -1074,10 +1074,10 @@ auto block(O)(

%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 ); } @@ -1095,7 +1095,7 @@ auto block_scroll(O)( 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; @@ -1135,11 +1135,11 @@ auto verse(O)( ) { _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 { @@ -1147,10 +1147,10 @@ auto verse(O)(

%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 ); } @@ -1168,7 +1168,7 @@ auto verse_scroll(O)( 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; @@ -1206,11 +1206,11 @@ auto code(O)( 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 { @@ -1218,10 +1218,10 @@ auto code(O)(

%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 ); } @@ -1258,11 +1258,11 @@ auto tablarize(O)( && (_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 ~= ""; } @@ -1285,7 +1285,7 @@ auto table(O)( 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]; @@ -1300,10 +1300,10 @@ auto table(O)( %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 @@ -1324,9 +1324,9 @@ auto endnote(O)( 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; @@ -1349,7 +1349,7 @@ template outputHTML() { #+END_SRC ** scroll :scroll: -*** switch (sections & objects) format html output +*** ↻ loop & switch (sections & objects) format html output #+name: output_html_scroll #+BEGIN_SRC d @@ -1369,11 +1369,11 @@ void scroll(D,I)( 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; @@ -1382,22 +1382,22 @@ void scroll(D,I)( 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; @@ -1406,13 +1406,13 @@ void scroll(D,I)( 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; @@ -1435,23 +1435,23 @@ void scroll(D,I)( 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; @@ -1472,14 +1472,14 @@ void scroll(D,I)( 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; } @@ -1488,8 +1488,8 @@ void scroll(D,I)( 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; @@ -1530,7 +1530,7 @@ void scroll_write_output(M,C)( #+END_SRC ** seg :seg: -*** switch (sections & objects) format html output +*** ↻ loop & switch (sections & objects) format html output #+name: output_html_seg #+BEGIN_SRC d @@ -1554,12 +1554,12 @@ void seg(D,M)( 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] = ""; @@ -1580,12 +1580,12 @@ void seg(D,M)( 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 @@ -1606,45 +1606,45 @@ void seg(D,M)( 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; @@ -1652,13 +1652,13 @@ void seg(D,M)( 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; @@ -1690,23 +1690,23 @@ void seg(D,M)( 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]; @@ -1733,14 +1733,14 @@ void seg(D,M)( 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; } @@ -1749,7 +1749,7 @@ void seg(D,M)( break; default: if ((doc_matters.opt.action.debug_do)) { - writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); + writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part); } break; } @@ -2004,20 +2004,20 @@ string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) { 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 ); } @@ -2054,49 +2054,49 @@ string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) { ); 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"; } @@ -2160,11 +2160,11 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) { ); 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; @@ -2179,7 +2179,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) { ¶", counter, _txt, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, hashtag, ); break; @@ -2193,7 +2193,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) { ¶", counter, _txt, - obj.segment_anchor_tag, + obj.tags.segment_anchor_tag, hashtag, ); break; @@ -2211,7 +2211,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) { #+END_SRC ** the document contents :seg: -*** switch (sections & objects) format epub3 xhtml output +*** ↻ loop & switch (sections & objects) format epub3 xhtml output #+name: output_epub3_xhtml_seg #+BEGIN_SRC d @@ -2233,12 +2233,12 @@ void outputEPub3(D,I)( 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] = ""; @@ -2258,16 +2258,16 @@ void outputEPub3(D,I)( 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]; @@ -2280,23 +2280,23 @@ void outputEPub3(D,I)( 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]; @@ -2304,22 +2304,22 @@ void outputEPub3(D,I)( 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]; @@ -2327,13 +2327,13 @@ void outputEPub3(D,I)( 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; @@ -2365,23 +2365,23 @@ void outputEPub3(D,I)( 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]; @@ -2408,14 +2408,14 @@ void outputEPub3(D,I)( 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; } @@ -2424,53 +2424,53 @@ void outputEPub3(D,I)( 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/org/sdp.org b/org/sdp.org index 442fa7d..7a8d86d 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -26,7 +26,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 26, 2); +enum ver = Version(0, 26, 3); #+END_SRC ** compilation restrictions (supported compilers) @@ -179,7 +179,6 @@ mixin CompileTimeInfo; #+BEGIN_SRC d mixin SiSUrgxInit; mixin contentJSONtoSiSUstruct; -mixin SiSUnode; mixin SiSUbiblio; mixin SiSUrgxInitFlags; mixin outputHub; @@ -947,18 +946,18 @@ string[string] check = [ ]; 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; } } } -- cgit v1.2.3