From 0cdf764398b74a47744763e345b6a5a31e7bee69 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 5 Aug 2017 04:13:53 -0400 Subject: m_a, composite object, attributes, rename part & an addition - of_part renamed from use (frontmatter, body, backmatter) - of_section added (toc, body, glossary, bibliography, bookindex, blurb) --- org/meta_abstraction.org | 120 +++++++++++++++++++++++++++++++---------------- org/meta_debugs.org | 6 +-- org/output_xmls.org | 12 ++--- org/sdp.org | 2 +- 4 files changed, 90 insertions(+), 50 deletions(-) (limited to 'org') diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index d017407..e3b7b5f 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -491,7 +491,8 @@ string toc_txt_; an_object["glossary_nugget"] = ""; an_object["blurb_nugget"] = ""; comp_obj_heading_ = comp_obj_heading_.init; -comp_obj_heading_.use = "frontmatter"; +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"; @@ -634,7 +635,8 @@ if there is a glossary section you need to: an_object_key="glossary_nugget"; // if (line.matchFirst(rgx.heading_glossary)) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -650,7 +652,8 @@ if there is a glossary section you need to: 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_.use = "backmatter"; + 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"; @@ -669,7 +672,8 @@ if there is a glossary section you need to: } 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.use = "backmatter"; + 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.text = line.to!string.strip; @@ -720,7 +724,8 @@ if there is a blurb section you need to: an_object_key="blurb_nugget"; if (line.matchFirst(rgx.heading_blurb)) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -736,7 +741,8 @@ if there is a blurb section you need to: 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_.use = "backmatter"; + 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"; @@ -755,7 +761,8 @@ if there is a blurb section you need to: } else if (line.matchFirst(rgx.heading) && (opt_action["backmatter"] && opt_action["section_blurb"])) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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; @@ -771,7 +778,8 @@ if there is a blurb section you need to: } 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.use = "backmatter"; + 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.text = line.to!string.strip; @@ -936,7 +944,8 @@ if (line.matchFirst(rgx.book_index) } an_object[an_object_key] ~= line ~= "\n"; comp_obj_comment = comp_obj_comment.init; - comp_obj_comment.use = "comment"; + 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; @@ -1173,7 +1182,8 @@ if ((obj_type_status["heading"] == State.on) 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.use = "body"; + 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; @@ -1296,7 +1306,8 @@ debug(endnotes) { #+BEGIN_SRC d if (an_object["glossary_nugget"].length == 0) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "empty"; + 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"; @@ -1332,7 +1343,8 @@ auto biblio_ordered = #+BEGIN_SRC d if (biblio_ordered.length > 0) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -1346,7 +1358,8 @@ if (biblio_ordered.length > 0) { comp_obj_heading_.parent_lev_markup = 0; the_bibliography_section ~= comp_obj_heading_; comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -1362,7 +1375,8 @@ if (biblio_ordered.length > 0) { the_bibliography_section ~= comp_obj_heading_; } else { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "empty"; + 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"; @@ -1398,7 +1412,8 @@ foreach (entry; biblio_ordered) { ((entry["url"].str.empty) ? "" : ", [" ~ entry["url"].str ~ "]"), ); comp_obj_para = comp_obj_para.init; - comp_obj_para.use = "backmatter"; + 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; @@ -1481,7 +1496,8 @@ debug(bookindex) { #+BEGIN_SRC d if (an_object["blurb_nugget"].length == 0) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "empty"; + 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"; @@ -1511,7 +1527,8 @@ indent=[ "base_position" : 1, ]; comp_obj_toc = comp_obj_toc.init; -comp_obj_toc.use = "frontmatter"; +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; @@ -2161,7 +2178,8 @@ if (the_blurb_section.length > 1) { - obj.dom_collapsed = dom_collapsed; +/ comp_obj_heading_ = comp_obj_heading_.init; -comp_obj_heading_.use = "empty"; +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; @@ -3071,7 +3089,8 @@ void _poem_block_(L,O,T,C,N,Ma)( 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.use = "body"; + 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_number; @@ -3127,7 +3146,8 @@ void _poem_block_(L,O,T,C,N,Ma)( 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.use = "body"; + 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_number; @@ -3166,7 +3186,8 @@ void _poem_block_(L,O,T,C,N,Ma)( 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.use = "body"; + 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_number; @@ -3221,7 +3242,8 @@ void _poem_block_(L,O,T,C,N,Ma)( 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.use = "body"; + 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_number; @@ -3433,7 +3455,8 @@ void _block_flag_line_empty_(B)( 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.use = "body"; + 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_number; @@ -3480,7 +3503,8 @@ void _block_flag_line_empty_(B)( 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.use = "body"; + 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_number; @@ -3525,7 +3549,8 @@ void _block_flag_line_empty_(B)( obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; - comp_obj_block.use = "body"; + 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_number; @@ -3566,7 +3591,8 @@ void _block_flag_line_empty_(B)( an_object["is"] ); comp_obj_poem_ocn = comp_obj_poem_ocn.init; - comp_obj_poem_ocn.use = "body"; + 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_number; @@ -3609,7 +3635,8 @@ void _block_flag_line_empty_(B)( 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.use = "body"; + 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_number; @@ -4173,7 +4200,8 @@ auto table_instructions(O,H)( return ref H table_head, ) { static auto rgx = Rgx(); - table_object.use = "body"; + 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; @@ -5003,7 +5031,8 @@ static struct ObjInlineMarkup { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.use = "frontmatter"; + 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; @@ -5020,7 +5049,8 @@ static struct ObjInlineMarkup { "base_position" : 0, ]; comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.use = "frontmatter"; + 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; @@ -5033,7 +5063,8 @@ static struct ObjInlineMarkup { the_table_of_contents_section["scroll"] ~= comp_obj_toc; } comp_obj_toc = comp_obj_toc.init; - comp_obj_toc.use = "frontmatter"; + 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; @@ -5917,7 +5948,8 @@ struct BookIndexReportSection { string bi_tmp_seg, bi_tmp_scroll; string[] bi_tmp_tags; comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -5935,7 +5967,8 @@ struct BookIndexReportSection { ++obj_cite_number; ++mkn; comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -6011,7 +6044,8 @@ struct BookIndexReportSection { 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.use = "backmatter"; + 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; @@ -6168,7 +6202,8 @@ struct NotesSection { if ((endnotes_["notes"].length > 0) && (opt_action["backmatter"] && opt_action["section_endnotes"])) { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -6184,7 +6219,8 @@ struct NotesSection { ++obj_cite_number; ++mkn; comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "backmatter"; + 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"; @@ -6202,7 +6238,8 @@ struct NotesSection { ++mkn; } else { comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "empty"; + 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"; @@ -6218,7 +6255,8 @@ struct NotesSection { if (opt_action["backmatter"] && opt_action["section_endnotes"]) { ObjGenericComposite comp_obj_endnote_; comp_obj_endnote_ = comp_obj_endnote_.init; - comp_obj_endnote_.use = "backmatter"; + 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; @@ -6590,7 +6628,8 @@ struct NodeStructureMetadata { } ObjGenericComposite _comp_obj_heading_; _comp_obj_heading_ = _comp_obj_heading_.init; - _comp_obj_heading_.use = "body"; + _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; @@ -6942,7 +6981,8 @@ struct HeadingAttrib { #+BEGIN_SRC d struct ObjGenericComposite { // size_t id; - string use = ""; + string of_part = ""; + string of_section = ""; string is_of = ""; string is_a = ""; string text = ""; diff --git a/org/meta_debugs.org b/org/meta_debugs.org index cd457e4..6a6f1fa 100644 --- a/org/meta_debugs.org +++ b/org/meta_debugs.org @@ -89,7 +89,7 @@ debug(parent) { ); foreach (key; doc_matters.keys_seq.seg) { foreach (obj; contents[key]) { - if (obj.use != "empty") { + if (obj.of_part != "empty") { if (obj.is_a == "heading") { writefln( "%s node: %s heading: %s %s", @@ -117,7 +117,7 @@ debug(dumpdoc) { __LINE__, ); foreach (obj; contents[key]) { - if (obj.use != "empty") { + if (obj.of_part != "empty") { writefln( "[%s][%s]\n%s", obj.obj_cite_number, @@ -482,7 +482,7 @@ debug(objects) { __LINE__, ); foreach (obj; contents[key]) { - if (obj.use != "empty") { + if (obj.of_part != "empty") { writefln( "* [%s][%s] %s", obj.obj_cite_number, diff --git a/org/output_xmls.org b/org/output_xmls.org index 19ed021..4050a5e 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -1309,7 +1309,7 @@ void scroll(D,I)( foreach (part; doc_matters.keys_seq.scroll) { foreach (obj; doc_abstraction[part]) { string _txt = xhtml_format.special_characters(obj, obj.text); - switch (obj.use) { + switch (obj.of_part) { case "frontmatter": assert(part == "head" || "toc_scroll"); switch (obj.is_of) { case "para": @@ -1428,7 +1428,7 @@ void scroll(D,I)( break; default: if ((doc_matters.opt_action["debug"])) { - writeln(__FILE__, ":", __LINE__, ": ", obj.use); + writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); } @@ -1561,7 +1561,7 @@ void seg(D,I)( } } else { assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.use) { + switch (obj.of_part) { case "frontmatter": assert(part == "head" || "toc_seg"); switch (obj.is_of) { case "para": @@ -1692,7 +1692,7 @@ void seg(D,I)( break; default: if ((doc_matters.opt_action["debug"])) { - writeln(__FILE__, ":", __LINE__, ": ", obj.use); + writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); } break; } @@ -2206,7 +2206,7 @@ void outputEPub3(D,I)( } } else { assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail"); - switch (obj.use) { + switch (obj.of_part) { case "frontmatter": assert(part == "head" || "toc_seg"); switch (obj.is_of) { case "para": @@ -2339,7 +2339,7 @@ void outputEPub3(D,I)( break; default: if ((doc_matters.opt_action["debug"])) { - writeln(__FILE__, ":", __LINE__, ": ", obj.use); + writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); } break; } diff --git a/org/sdp.org b/org/sdp.org index 7b3a608..e06135f 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -709,7 +709,7 @@ string[string] check = [ ]; foreach (k; doc_matters.keys_seq.seg) { foreach (obj; doc_abstraction[k]) { - if (obj.use != "empty") { + if (obj.of_part != "empty") { if (!empty(obj.obj_cite_number)) { if (k == "body") { check["last_obj_cite_number_body"] = obj.obj_cite_number; -- cgit v1.2.3