diff options
author | Ralph Amissah <ralph@amissah.com> | 2016-12-07 17:48:06 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:13 -0400 |
commit | d5cfec536fa3817e33a6bbe8607b67cc67ad621e (patch) | |
tree | 4afc9e856c7eb462d0848cb0dfce542d9334ffd7 /org/ao_abstract_doc_source.org | |
parent | 0.9.5 org files reorganized, tangles (code structure) to top of file (diff) |
0.9.6 node info, and output continueddoc-reform_v0.0.9
Diffstat (limited to 'org/ao_abstract_doc_source.org')
-rw-r--r-- | org/ao_abstract_doc_source.org | 796 |
1 files changed, 403 insertions, 393 deletions
diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index da435a1..4292328 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -229,8 +229,8 @@ auto obj_att = ObjAttributes(); /+ ocn +/ int obj_cite_number, obj_cite_number_; auto object_citation_number = OCNemitter(); -int obj_cite_number_emit(int obj_cite_number_status_flag) { - return object_citation_number.obj_cite_number_emitter(obj_cite_number_status_flag); +int ocn_emit(int ocn_status_flag) { + return object_citation_number.ocn_emitter(ocn_status_flag); } /+ book index variables +/ string book_idx_tmp; @@ -243,8 +243,8 @@ string[][string][string] bkidx_hash( return bookindex_extract_hash.bookindex_nugget_hash(bookindex_section, obj_cite_number); } /+ node +/ -string[string] _node_str; -int[string] _node_int; +string[string] _node_heading_str; +int[string] _node_heading_int; auto node_construct = NodeStructureMetadata(); #+END_SRC @@ -271,8 +271,10 @@ scope(exit) { #+name: abs_init_rest #+BEGIN_SRC d -auto node_int_ = node_metadata_int; -auto node_str_ = node_metadata_str; +auto node_heading_int_ = node_metadata_heading_int; +auto node_heading_str_ = node_metadata_heading_str; +auto node_para_int_ = node_metadata_para_int; +auto node_para_str_ = node_metadata_para_str; line_occur = [ "heading" : 0, "para" : 0, @@ -330,20 +332,20 @@ string _anchor_tag; string toc_txt_; an_object["glossary_nugget"] = ""; an_object["blurb_nugget"] = ""; -node_str_["is"] = "heading"; -node_str_["ocn"] = "0"; -node_str_["segment_anchor_tag"] = "toc"; -node_str_["attrib"] = ""; -node_str_["marked_up_lev"] = "1"; -node_int_["heading_lev_markup"] = 4; -node_int_["heading_lev_collapsed"] = 2; -node_int_["parent_ocn"] = 1; -node_int_["parent_lev_markup"] = 0; +node_heading_str_["is"] = "heading"; +node_heading_str_["ocn"] = "0"; +node_heading_str_["segment_anchor_tag"] = "toc"; +node_heading_str_["attrib"] = ""; +node_heading_str_["marked_up_lev"] = "1"; +node_heading_int_["heading_lev_markup"] = 4; +node_heading_int_["heading_lev_collapsed"] = 2; +node_heading_int_["parent_ocn"] = 1; +node_heading_int_["parent_lev_markup"] = 0; auto toc_head = set_abstract_object.contents_heading( "Table of Contents", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, ["toc"], // anchor tag ); the_table_of_contents_section = [ @@ -391,7 +393,7 @@ debug(srclines) { #+name: abs_in_loop_body_00 #+BEGIN_SRC d if (!line.empty) { - _check_obj_cite_number_status_(line, type); + _check_ocn_status_(line, type); } #+END_SRC @@ -466,53 +468,56 @@ if there is a glossary section you need to: line_occur["para"] = State.off; an_object_key="glossary_nugget"; // if (matchFirst(line, rgx.heading_glossary)) { - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_glossary_section ~= set_abstract_object.contents_heading( "Glossary", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = "glossary"; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "1"; - node_int_["heading_lev_markup"] = 4; - node_int_["heading_lev_collapsed"] = 2; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = "glossary"; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "1"; + node_heading_int_["heading_lev_markup"] = 4; + node_heading_int_["heading_lev_collapsed"] = 2; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_glossary_section ~= set_abstract_object.contents_heading( "Glossary", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, ["glossary"], // anchor tag ); // } else if (matchFirst(line, rgx.heading)) { // _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa); // levels? } else { _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur); + node_para_str_["is"] = "para"; + node_para_str_["attrib"] = ""; + node_para_int_["ocn"] = 0; + node_para_int_["indent_hang"] = indent["hang_position"]; + node_para_int_["indent_base"] = indent["base_position"]; + node_para_int_["bullet"] = (bullet) ? 1 : 0; the_glossary_section ~= set_abstract_object.contents_para( - "para", // an_object["is"], to!string(line), // an_object["substantive"], - "", // attrib - 0, // obj_cite_number, - indent, - bullet + node_para_str_, + node_para_int_, ); } - type["obj_cite_number_status"] = TriState.off; + type["ocn_status"] = TriState.off; } continue; #+END_SRC @@ -552,70 +557,73 @@ if there is a blurb section you need to: line_occur["para"] = State.off; an_object_key="blurb_nugget"; if (matchFirst(line, rgx.heading_blurb)) { - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_blurb_section ~= set_abstract_object.contents_heading( "Blurb", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = "blurb"; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "1"; - node_int_["heading_lev_markup"] = 4; - node_int_["heading_lev_collapsed"] = 2; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = "blurb"; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "1"; + node_heading_int_["heading_lev_markup"] = 4; + node_heading_int_["heading_lev_collapsed"] = 2; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_blurb_section ~= set_abstract_object.contents_heading( "Blurb", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, ["blurb"], // anchor tag ); } else if ((matchFirst(line, rgx.heading)) && (opt_action_bool["backmatter"] && opt_action_bool["section_blurb"])) { _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa); // levels? - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = "blurb"; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = to!string(an_object["lev"]); - node_int_["heading_lev_markup"] = to!int(an_object["lev_markup_number"]); // make int, remove need to conv - node_int_["heading_lev_collapsed"] = to!int(an_object["lev_collapsed_number"]); // make int, remove need to conv - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = "blurb"; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = to!string(an_object["lev"]); + node_heading_int_["heading_lev_markup"] = to!int(an_object["lev_markup_number"]); // make int, remove need to conv + node_heading_int_["heading_lev_collapsed"] = to!int(an_object["lev_collapsed_number"]); // make int, remove need to conv + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_blurb_section ~= set_abstract_object.contents_heading( to!string(line), // an_object["substantive"], - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); } else { _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur); + node_para_str_["is"] = "para"; + node_para_str_["attrib"] = ""; + node_para_int_["ocn"] = obj_cite_number; + node_para_int_["indent_hang"] = indent["hang_position"]; + node_para_int_["indent_base"] = indent["base_position"]; + node_para_int_["bullet"] = (bullet) ? 1 : 0; the_blurb_section ~= set_abstract_object.contents_para( - "para", // an_object["is"], to!string(line), // an_object["substantive"], - "", // attrib - obj_cite_number, - indent, - bullet + node_para_str_, + node_para_int_, ); } - type["obj_cite_number_status"] = TriState.off; + type["ocn_status"] = TriState.off; } continue; #+END_SRC @@ -842,8 +850,8 @@ _block_flag_line_empty_( the_document_body_section, bookindex_unordered_hashes, obj_cite_number, - _node_str, - _node_int, + _node_heading_str, + _node_heading_int, cntr, type, obj_cite_number_poem, @@ -874,7 +882,7 @@ assert( if ((type["heading"] == State.on) && (line_occur["heading"] > State.off)) { /+ heading object (current line empty) +/ - obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); + obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -915,10 +923,10 @@ if ((type["heading"] == State.on) an_object["is"], // string html_segnames_ptr, // int ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); ++heading_ptr; debug(segments) { writeln(an_object["lev_markup_number"]); @@ -927,8 +935,8 @@ if ((type["heading"] == State.on) the_document_body_section ~= set_abstract_object.contents_heading( an_object["substantive"], - _node_str, - _node_int, + _node_heading_str, + _node_heading_int, anchor_tags, ); // track previous heading and make assertions @@ -948,7 +956,7 @@ if ((type["heading"] == State.on) #+BEGIN_SRC d } else if ((type["para"] == State.on) && (line_occur["para"] > State.off)) { /+ paragraph object (current line empty) +/ - obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); + obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -963,22 +971,25 @@ if ((type["heading"] == State.on) heading_ptr-1, an_object["is"], ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); // ... an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); + node_para_str_["is"] = an_object["is"]; + node_para_str_["attrib"] = an_object["attrib"]; + node_para_int_["ocn"] = obj_cite_number; + node_para_int_["indent_hang"] = indent["hang_position"]; + node_para_int_["indent_base"] = indent["base_position"]; + node_para_int_["bullet"] = (bullet) ? 1 : 0; the_document_body_section ~= set_abstract_object.contents_para( - an_object["is"], an_object["substantive"], - an_object["attrib"], - obj_cite_number, - indent, - bullet + node_para_str_, + node_para_int_, ); _common_reset_(line_occur, an_object, type); indent=[ @@ -1080,20 +1091,20 @@ debug(endnotes) { #+BEGIN_SRC d if (an_object["glossary_nugget"].length == 0) { writeln("no gloss"); - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_glossary_section ~= set_abstract_object.contents_heading( "(skip) there is no Glossary section", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); } else { @@ -1120,53 +1131,53 @@ auto biblio_ordered = #+name: abs_post #+BEGIN_SRC d if (biblio_ordered.length > 0) { - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_bibliography_section ~= set_abstract_object.contents_heading( "Bibliography", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = "bibliography"; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "1"; - node_int_["heading_lev_markup"] = 4; - node_int_["heading_lev_collapsed"] = 2; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = "bibliography"; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "1"; + node_heading_int_["heading_lev_markup"] = 4; + node_heading_int_["heading_lev_collapsed"] = 2; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_bibliography_section ~= set_abstract_object.contents_heading( "Bibliography", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, ["bibliography"], // anchor tag ); } else { - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_bibliography_section ~= set_abstract_object.contents_heading( "(skip) there is no Bibliography", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); } @@ -1192,14 +1203,17 @@ foreach (entry; biblio_ordered) { ((entry["place"].str.empty) ? "" : ", " ~ entry["place"].str), ((entry["url"].str.empty) ? "" : ", [" ~ entry["url"].str ~ "]"), ); + node_para_str_["is"] = "bibliography"; + node_para_str_["attrib"] = ""; + node_para_int_["ocn"] = 0; + node_para_int_["indent_hang"] = 0; + node_para_int_["indent_base"] = 1; + node_para_int_["bullet"] = 0; the_bibliography_section ~= set_abstract_object.contents_para( - "bibliography", out_, // nugget/object - "", // attrib - 0, // obj_cite_number - ([ "hang_position" : 0, "base_position" : 1, ]), // indent - false + node_para_str_, + node_para_int_, ); } #+END_SRC @@ -1273,20 +1287,20 @@ debug(bookindex) { // bookindex #+BEGIN_SRC d if (an_object["blurb_nugget"].length == 0) { writeln("no blurb"); - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_blurb_section ~= set_abstract_object.contents_heading( "(skip) there is no Blurb section", // nugget/object - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], // anchor tag ); } else { @@ -1563,44 +1577,44 @@ auto _common_reset_( #+name: abs_functions_ocn_status #+BEGIN_SRC d -void _check_obj_cite_number_status_( +void _check_ocn_status_( char[] line, ref int[string] type ) { - if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] == TriState.off)) { + if ((!line.empty) && (type["ocn_status_multi_obj"] == TriState.off)) { /+ not multi-line object, check whether obj_cite_number is on or turned off +/ if (matchFirst(line, rgx.obj_cite_number_block_marks)) { /+ switch off obj_cite_number +/ if (matchFirst(line, rgx.obj_cite_number_off_block)) { - type["obj_cite_number_status_multi_obj"] = TriState.on; + type["ocn_status_multi_obj"] = TriState.on; debug(ocnoff) { writeln(line); } } if (matchFirst(line, rgx.obj_cite_number_off_block_dh)) { - type["obj_cite_number_status_multi_obj"] = TriState.closing; + type["ocn_status_multi_obj"] = TriState.closing; debug(ocnoff) { writeln(line); } } } else { - if (type["obj_cite_number_status_multi_obj"] == TriState.off) { + if (type["ocn_status_multi_obj"] == TriState.off) { if (matchFirst(line, rgx.obj_cite_number_off)) { - type["obj_cite_number_status"] = TriState.on; + type["ocn_status"] = TriState.on; } else if (matchFirst(line, rgx.obj_cite_number_off_dh)) { - type["obj_cite_number_status"] = TriState.closing; + type["ocn_status"] = TriState.closing; } else { - type["obj_cite_number_status"] = TriState.off; + type["ocn_status"] = TriState.off; } } else { - type["obj_cite_number_status"] = - type["obj_cite_number_status_multi_obj"]; + type["ocn_status"] = + type["ocn_status_multi_obj"]; } } - } else if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] > TriState.off)) { + } else if ((!line.empty) && (type["ocn_status_multi_obj"] > TriState.off)) { if (matchFirst(line, rgx.obj_cite_number_off_block_close)) { - type["obj_cite_number_status_multi_obj"] = TriState.off; - type["obj_cite_number_status"] = TriState.off; + type["ocn_status_multi_obj"] = TriState.off; + type["ocn_status"] = TriState.off; debug(ocnoff) { writeln(line); } @@ -2077,7 +2091,7 @@ void _poem_block_( an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2098,7 +2112,7 @@ void _poem_block_( processing["verse"] ~= line ~= "\n"; if (type["verse_new"] == State.on) { obj_cite_number = - obj_cite_number_emit(type["obj_cite_number_status"]); + ocn_emit(type["ocn_status"]); type["verse_new"] = State.off; } else if (matchFirst(line, rgx.newline_eol_delimiter_only)) { verse_line = TriState.off; @@ -2124,14 +2138,14 @@ void _poem_block_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2168,7 +2182,7 @@ void _poem_block_( an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2188,7 +2202,7 @@ void _poem_block_( processing["verse"] ~= line ~= "\n"; if (type["verse_new"] == State.on) { obj_cite_number = - obj_cite_number_emit(type["obj_cite_number_status"]); + ocn_emit(type["ocn_status"]); type["verse_new"] = State.off; } else if (matchFirst(line, rgx.newline_eol_delimiter_only)) { type["verse_new"] = State.on; @@ -2215,14 +2229,14 @@ void _poem_block_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2413,8 +2427,8 @@ void _block_flag_line_empty_( ref ObjComposite[] the_document_body_section, ref string[][string][string] bookindex_unordered_hashes, ref int obj_cite_number, - ref string[string] _node_str, - ref int[string] _node_int, + ref string[string] _node_heading_str, + ref int[string] _node_heading_int, ref int cntr, ref int[string] type, string[string] obj_cite_number_poem, @@ -2432,7 +2446,7 @@ void _block_flag_line_empty_( assertions_flag_types_block_status_none_or_closed(type); if (type["code"] == TriState.closing) { obj_cite_number = - obj_cite_number_emit(type["obj_cite_number_status"]); + ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -2447,14 +2461,14 @@ void _block_flag_line_empty_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block_code( an_object["is"], @@ -2482,15 +2496,15 @@ void _block_flag_line_empty_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; the_document_body_section ~= set_abstract_object.contents_block_obj_cite_number_string( "poem", "", (obj_cite_number_poem["start"], obj_cite_number_poem["end"]), - _node_str, - _node_int, + _node_heading_str, + _node_heading_int, ); // bookindex object_reset(an_object); processing.remove("verse"); @@ -2498,7 +2512,7 @@ void _block_flag_line_empty_( type["poem"] = TriState.off; } else if (type["table"] == TriState.closing) { obj_cite_number = - obj_cite_number_emit(type["obj_cite_number_status"]); + ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -2513,14 +2527,14 @@ void _block_flag_line_empty_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2535,7 +2549,7 @@ void _block_flag_line_empty_( type["table"] = TriState.off; } else if (type["group"] == TriState.closing) { obj_cite_number = - obj_cite_number_emit(type["obj_cite_number_status"]); + ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -2550,14 +2564,14 @@ void _block_flag_line_empty_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2571,7 +2585,7 @@ void _block_flag_line_empty_( type["blocks"] = TriState.off; type["group"] = TriState.off; } else if (type["block"] == TriState.closing) { - obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); + obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -2586,14 +2600,14 @@ void _block_flag_line_empty_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2608,7 +2622,7 @@ void _block_flag_line_empty_( type["block"] = TriState.off; } else if (type["quote"] == TriState.closing) { obj_cite_number = - obj_cite_number_emit(type["obj_cite_number_status"]); + ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -2623,14 +2637,14 @@ void _block_flag_line_empty_( heading_ptr-1, an_object["is"] ); - _node_str = _node_t[0]; - _node_int = _node_t[1]; + _node_heading_str = _node_t[0]; + _node_heading_int = _node_t[1]; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0]; anchor_tags = substantive_object_and_anchor_tags_tuple[1]; an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_str, _node_int); + obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node_heading_str, _node_heading_int); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -3068,10 +3082,10 @@ auto _para_match_( #+BEGIN_SRC d struct OCNemitter { int obj_cite_number, obj_cite_number_; - int obj_cite_number_emitter(int obj_cite_number_status_flag) - in { assert(obj_cite_number_status_flag <= 2); } + int ocn_emitter(int ocn_status_flag) + in { assert(ocn_status_flag <= 2); } body { - obj_cite_number=(obj_cite_number_status_flag == 0) + obj_cite_number=(ocn_status_flag == 0) ? ++obj_cite_number_ : 0; assert(obj_cite_number >= 0); @@ -3794,16 +3808,16 @@ struct ObjAttributes { string obj_attributes( string obj_is_, string obj_raw, - string[string] _node_str, - int[string] _node_int + string[string] _node_heading_str, + int[string] _node_heading_int ) in { } body { scope(exit) { destroy(obj_is_); destroy(obj_raw); - destroy(_node_str); - destroy(_node_int); + destroy(_node_heading_str); + destroy(_node_heading_int); } _obj_attrib.remove("json"); _obj_attrib["json"] ="{"; @@ -3843,7 +3857,7 @@ struct ObjAttributes { break; } _obj_attrib["json"] ~=" }"; - _obj_attrib["json"]=_set_additional_values_parse_as_json(_obj_attrib["json"], obj_is_, _node_str, _node_int); // check + _obj_attrib["json"]=_set_additional_values_parse_as_json(_obj_attrib["json"], obj_is_, _node_heading_str, _node_heading_int); // check debug(structattrib) { if (oa_j["is"].str() == "heading") { writeln(_obj_attrib["json"]); @@ -4052,24 +4066,24 @@ struct ObjAttributes { string _set_additional_values_parse_as_json( string _obj_attrib, string obj_is_, - string[string] _node_str, - int[string] _node_int + string[string] _node_heading_str, + int[string] _node_heading_int ) { // JSONValue oa_j = parseJSON(_obj_attrib); assert( (oa_j.type == JSON_TYPE.OBJECT) ); if (obj_is_ == "heading") { - oa_j.object["obj_cite_number"] = _node_str["ocn"]; - oa_j.object["lev_markup_number"] = _node_int["heading_lev_markup"]; - oa_j.object["lev_collapsed_number"] = _node_int["heading_lev_collapsed"]; + oa_j.object["obj_cite_number"] = _node_heading_str["ocn"]; + oa_j.object["lev_markup_number"] = _node_heading_int["heading_lev_markup"]; + oa_j.object["lev_collapsed_number"] = _node_heading_int["heading_lev_collapsed"]; oa_j.object["heading_ptr"] = - _node_int["ptr_heading"]; + _node_heading_int["ptr_heading"]; oa_j.object["doc_object_ptr"] = - _node_int["ptr_doc_object"]; + _node_heading_int["ptr_doc_object"]; } - oa_j.object["parent_obj_cite_number"] = _node_int["parent_ocn"]; - oa_j.object["parent_lev_markup_number"] = _node_int["parent_lev_markup"]; + oa_j.object["parent_obj_cite_number"] = _node_heading_int["parent_ocn"]; // + oa_j.object["parent_lev_markup_number"] = _node_heading_int["parent_lev_markup"]; // _obj_attrib = oa_j.toString(); return _obj_attrib; } @@ -4248,7 +4262,7 @@ struct BookIndexReportSection { bool[string] opt_action_bool, ) { mixin SiSUnode; - string type; + string type_is; string lev; int lev_int_markup, lev_int_collapsed; string attrib; @@ -4257,59 +4271,60 @@ struct BookIndexReportSection { auto mainkeys = bookindex_unordered_hashes.byKey.array.sort().release; ObjComposite[][string] bookindex_section; - auto node_int_ = node_metadata_int; - auto node_str_ = node_metadata_str; + auto node_heading_int_ = node_metadata_heading_int; + auto node_heading_str_ = node_metadata_heading_str; + auto node_para_int_ = node_metadata_para_int; + auto node_para_str_ = node_metadata_para_str; if ((mainkeys.length > 0) && (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"])) { string bi_tmp_seg, bi_tmp_scroll; - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; bookindex_section["scroll"] ~= set_abstract_object.contents_heading( "Book Index", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [], ); bookindex_section["seg"] ~= set_abstract_object.contents_heading( "Book Index", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [], ); ++obj_cite_number; ++mkn; - // 1~ Index - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = "bookindex"; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "1"; - node_int_["heading_lev_markup"] = 4; - node_int_["heading_lev_collapsed"] = 2; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = "bookindex"; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "1"; + node_heading_int_["heading_lev_markup"] = 4; + node_heading_int_["heading_lev_collapsed"] = 2; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; bookindex_section["scroll"] ~= set_abstract_object.contents_heading( "Index", - node_str_, - node_int_, - ["book_index"], + node_heading_str_, + node_heading_int_, + ["bookindex"], ); bookindex_section["seg"] ~= set_abstract_object.contents_heading( "Index", - node_str_, - node_int_, - ["book_index"], + node_heading_str_, + node_heading_int_, + ["bookindex"], ); ++obj_cite_number; ++mkn; @@ -4344,55 +4359,50 @@ struct BookIndexReportSection { } bi_tmp_scroll = replaceFirst(bi_tmp_scroll, rgx.trailing_linebreak, ""); bi_tmp_seg = replaceFirst(bi_tmp_seg, rgx.trailing_linebreak, ""); - type="para"; - attrib=""; - indent=[ - "hang_position" : 0, - "base_position" : 1, - ]; + indent=[ "hang_position" : 0, "base_position" : 1, ]; + node_para_str_["is"] = "para"; + node_para_str_["attrib"] = ""; + node_para_int_["ocn"] = obj_cite_number; + node_para_int_["indent_hang"] = 0; + node_para_int_["indent_base"] = 1; + node_para_int_["bullet"] = 0; bookindex_section["scroll"] ~= set_abstract_object.contents_para( - type, bi_tmp_scroll, - attrib, - obj_cite_number, - indent, - false + node_para_str_, + node_para_int_, ); bookindex_section["seg"] ~= set_abstract_object.contents_para( - type, bi_tmp_seg, - attrib, - obj_cite_number, - indent, - false + node_para_str_, + node_para_int_, ); ++obj_cite_number; ++mkn; } } else { // no book index, (figure out what to do here) - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; bookindex_section["scroll"] ~= set_abstract_object.contents_heading( "(skip) there is no Book Index", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], ); bookindex_section["seg"] ~= set_abstract_object.contents_heading( "(skip) there is no Book Index", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], ); } @@ -4514,86 +4524,86 @@ struct NotesSection { auto set_abstract_object = ObjectAbstractSet(); ObjComposite[][string] the_endnotes_section; auto endnotes_ = gathered_notes(); - string type; + string type_is; string lev, lev_markup_number, lev_collapsed_number; string attrib; int[string] indent; - auto node_int_ = node_metadata_int; - auto node_str_ = node_metadata_str; + auto node_heading_int_ = node_metadata_heading_int; + auto node_heading_str_ = node_metadata_heading_str; if ((endnotes_["seg"].length > 0) && (opt_action_bool["backmatter"] && opt_action_bool["section_endnotes"])) { - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_endnotes_section["seg"] ~= set_abstract_object.contents_heading( "Endnotes", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [], ); the_endnotes_section["scroll"] ~= set_abstract_object.contents_heading( "Endnotes", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [], ); ++obj_cite_number; ++mkn; - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = "endnotes"; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "1"; - node_int_["heading_lev_markup"] = 4; - node_int_["heading_lev_collapsed"] = 2; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = "endnotes"; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "1"; + node_heading_int_["heading_lev_markup"] = 4; + node_heading_int_["heading_lev_collapsed"] = 2; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_endnotes_section["seg"] ~= set_abstract_object.contents_heading( "Endnotes", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, ["endnotes"], ); the_endnotes_section["scroll"] ~= set_abstract_object.contents_heading( "Endnotes", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, ["endnotes"], ); ++obj_cite_number; ++mkn; } else { - node_str_["is"] = "heading"; - node_str_["ocn"] = "0"; - node_str_["segment_anchor_tag"] = ""; - node_str_["attrib"] = ""; - node_str_["marked_up_lev"] = "B"; - node_int_["heading_lev_markup"] = 1; - node_int_["heading_lev_collapsed"] = 1; - node_int_["parent_ocn"] = 1; - node_int_["parent_lev_markup"] = 0; + node_heading_str_["is"] = "heading"; + node_heading_str_["ocn"] = "0"; + node_heading_str_["segment_anchor_tag"] = ""; + node_heading_str_["attrib"] = ""; + node_heading_str_["marked_up_lev"] = "B"; + node_heading_int_["heading_lev_markup"] = 1; + node_heading_int_["heading_lev_collapsed"] = 1; + node_heading_int_["parent_ocn"] = 1; + node_heading_int_["parent_lev_markup"] = 0; the_endnotes_section["seg"] ~= set_abstract_object.contents_heading( "(skip) there are no Endnotes", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], ); the_endnotes_section["scroll"] ~= set_abstract_object.contents_heading( "(skip) there are no Endnotes", - node_str_, - node_int_, + node_heading_str_, + node_heading_int_, [""], ); } @@ -4783,14 +4793,14 @@ struct NodeStructureMetadata { p_["lev_markup_number"] = DocStructMarkupHeading.h_text_1; p_["obj_cite_number"] = lv4; } - string[string] _node_str = [ + string[string] _node_heading_str = [ "is" : is_, "ocn" : to!string(obj_cite_number_), "marked_up_lev" : "", "segment_anchor_tag" : to!string(segment_anchor_tag), "attrib" : "", ]; - int[string] _node_int = [ + int[string] _node_heading_int = [ "ocn" : obj_cite_number_, "ptr_doc_object" : 0, "ptr_html_segnames" : 0, @@ -4807,12 +4817,12 @@ struct NodeStructureMetadata { writeln("- ", to!string(_node)); } } - assert(_node_int["parent_lev_markup"] >= 4); // - assert(_node_int["parent_lev_markup"] <= 7); // - assert(_node_int["parent_ocn"] >= 0); // hmm, perhaps // + assert(_node_heading_int["parent_lev_markup"] >= 4); // + assert(_node_heading_int["parent_lev_markup"] <= 7); // + assert(_node_heading_int["parent_ocn"] >= 0); // hmm, perhaps // auto t = tuple( - _node_str, - _node_int, + _node_heading_str, + _node_heading_int, ); return t; } @@ -4932,14 +4942,14 @@ struct NodeStructureMetadata { default: break; } - string[string] _node_str = [ + string[string] _node_heading_str = [ "is" : is_, "ocn" : to!string(obj_cite_number_), "marked_up_lev" : lev, "segment_anchor_tag" : to!string(segment_anchor_tag), "attrib" : "", ]; - int[string] _node_int = [ + int[string] _node_heading_int = [ "ocn" : obj_cite_number_, "ptr_doc_object" : cntr_, "ptr_html_segnames" : ((lev_markup_number == "4") ? html_segnames_ptr : 0), @@ -4959,42 +4969,42 @@ struct NodeStructureMetadata { writeln("* ", to!string(_node)); } } - assert(_node_int["parent_lev_markup"] <= 7); - assert(_node_int["parent_ocn"] >= 0); + assert(_node_heading_int["parent_lev_markup"] <= 7); + assert(_node_heading_int["parent_ocn"] >= 0); if (match(lev_markup_number, rgx.levels_numbered_headings)) { - assert(_node_int["heading_lev_markup"] <= 7); // issues - assert(to!int(_node_str["ocn"]) >= 0); - if (_node_int["parent_lev_markup"] > 0) { - assert(_node_int["parent_lev_markup"] < _node_int["heading_lev_markup"]); - if (to!int(_node_str["ocn"]) != 0) { - assert(_node_int["parent_ocn"] < to!int(_node_str["ocn"])); + assert(_node_heading_int["heading_lev_markup"] <= 7); // issues + assert(to!int(_node_heading_str["ocn"]) >= 0); + if (_node_heading_int["parent_lev_markup"] > 0) { + assert(_node_heading_int["parent_lev_markup"] < _node_heading_int["heading_lev_markup"]); + if (to!int(_node_heading_str["ocn"]) != 0) { + assert(_node_heading_int["parent_ocn"] < to!int(_node_heading_str["ocn"])); } } - if (_node_int["heading_lev_markup"] == 0) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_A); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_sect_B) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_A); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_sect_C) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_B); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_sect_D) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_C); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_1) { - assert(_node_int["parent_lev_markup"] <= DocStructMarkupHeading.h_sect_D); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_2) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_text_1); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_3) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_text_2); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_4) { - assert(_node_int["parent_lev_markup"] == DocStructMarkupHeading.h_text_3); - } else if (_node_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_5) { - // // writeln(to!int(_node_int["parent_lev_markup"])); - // // assert(to!int(_node_int["parent_lev_markup"]) >= 4); - // // assert(to!int(_node_int["parent_lev_markup"]) <= 7); + if (_node_heading_int["heading_lev_markup"] == 0) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_A); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_sect_B) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_A); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_sect_C) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_B); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_sect_D) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_sect_C); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_1) { + assert(_node_heading_int["parent_lev_markup"] <= DocStructMarkupHeading.h_sect_D); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_2) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_text_1); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_3) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_text_2); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_4) { + assert(_node_heading_int["parent_lev_markup"] == DocStructMarkupHeading.h_text_3); + } else if (_node_heading_int["heading_lev_markup"] == DocStructMarkupHeading.h_text_5) { + // // writeln(to!int(_node_heading_int["parent_lev_markup"])); + // // assert(to!int(_node_heading_int["parent_lev_markup"]) >= 4); + // // assert(to!int(_node_heading_int["parent_lev_markup"]) <= 7); } } auto t = tuple( - _node_str, - _node_int, + _node_heading_str, + _node_heading_int, ); return t; } @@ -5341,20 +5351,20 @@ auto contents_comment(in string object) { #+BEGIN_SRC d auto contents_heading( in string object, - in string[string] _node_str, - in int[string] _node_int, + in string[string] _node_heading_str, + in int[string] _node_heading_int, in string[] tags, ) { ObjComposite object_set; object_set.use = "content"; object_set.of = "para"; object_set.is_a = "heading"; - object_set.object = object; - object_set.obj_cite_number = _node_str["ocn"]; + object_set.object = object.strip; + object_set.obj_cite_number = _node_heading_str["ocn"]; object_set.anchor_tags ~= tags; - object_set.heading_attrib.lev = _node_str["marked_up_lev"]; - object_set.heading_attrib.lev_int_markup = _node_int["heading_lev_markup"]; - object_set.heading_attrib.lev_int_collapsed = _node_int["heading_lev_collapsed"]; + object_set.heading_attrib.lev = _node_heading_str["marked_up_lev"]; + object_set.heading_attrib.lev_int_markup = _node_heading_int["heading_lev_markup"]; + object_set.heading_attrib.lev_int_collapsed = _node_heading_int["heading_lev_collapsed"]; return object_set; } #+END_SRC @@ -5364,22 +5374,20 @@ auto contents_heading( #+name: ao_object_setter_para #+BEGIN_SRC d auto contents_para( - in string is_a, - in string object, - in string attrib, - in int obj_cite_number, - in int[string] indent, - in bool bullet, + in string object, + in string[string] _node_para_str, + in int[string] _node_para_int, ) { ObjComposite object_set; object_set.use = "content"; object_set.of = "para"; object_set.is_a = "para"; object_set.object = object.strip; - object_set.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); - object_set.para_attrib.indent_start = to!int(indent["hang_position"]); - object_set.para_attrib.indent_rest = to!int(indent["base_position"]); - object_set.para_attrib.bullet = false; // bullet; + object_set.obj_cite_number = (_node_para_int["ocn"]==0) ? "" : to!string(_node_para_int["ocn"]); + object_set.anchor_tags = []; + object_set.para_attrib.indent_start = _node_para_int["indent_hang"]; + object_set.para_attrib.indent_rest = _node_para_int["indent_base"]; + object_set.para_attrib.bullet = (_node_para_int["bullet"] == 1) ? true : false; return object_set; } #+END_SRC @@ -5439,7 +5447,7 @@ auto contents_endnote( #+name: ao_object_setter_block #+BEGIN_SRC d auto contents_block( - in string type, + in string type_is, in string object, in string attrib, in int obj_cite_number, @@ -5447,9 +5455,10 @@ auto contents_block( ObjComposite object_set; object_set.use = "content"; object_set.of = "block"; - object_set.is_a = type; + object_set.is_a = type_is; object_set.object = object; object_set.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + object_set.anchor_tags = []; return object_set; } #+END_SRC @@ -5459,7 +5468,7 @@ auto contents_block( #+name: ao_object_setter_block_code #+BEGIN_SRC d auto contents_block_code( - in string type, + in string type_is, in string object, in string attrib_language_syntax, in int obj_cite_number, @@ -5467,10 +5476,11 @@ auto contents_block_code( ObjComposite object_set; object_set.use = "content"; object_set.of = "block"; - object_set.is_a = type; + object_set.is_a = type_is; object_set.block_attrib.syntax = attrib_language_syntax; object_set.object = object; object_set.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + object_set.anchor_tags = []; return object_set; } #+END_SRC @@ -5480,7 +5490,7 @@ auto contents_block_code( #+name: ao_object_setter_block_obj_cite_number_string #+BEGIN_SRC d auto contents_block_obj_cite_number_string( - in string type, + in string type_is, in string object, in string obj_cite_number, in string[string] _node_str, @@ -5489,7 +5499,7 @@ auto contents_block_obj_cite_number_string( ObjComposite object_set; object_set.use = "content"; object_set.of = "block"; - object_set.is_a = type; + object_set.is_a = type_is; object_set.object = object; object_set.obj_cite_number = obj_cite_number; return object_set; |