diff options
author | Ralph Amissah <ralph@amissah.com> | 2016-11-02 10:27:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:13 -0400 |
commit | 98314b3de50e356568524708951ca507c80b3af2 (patch) | |
tree | 9dac05207a3690ce25927eed79791d1df1fdbab0 /org/ao_abstract_doc_source.org | |
parent | 0.8.0 the document parts (& org babel tangle) (diff) |
cleaning (one hash key renamed)
Diffstat (limited to 'org/ao_abstract_doc_source.org')
-rw-r--r-- | org/ao_abstract_doc_source.org | 237 |
1 files changed, 69 insertions, 168 deletions
diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 0efc339..1578ce3 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -392,9 +392,9 @@ if ((matchFirst(line, rgx.book_index)) debug(comment) { writeln(line); } - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; the_document_body_section ~= - set_abstract_object.contents_comment(strip(an_object["obj"])); + set_abstract_object.contents_comment(strip(an_object["nugget"])); _common_reset_(line_occur, an_object, type); processing.remove("verse"); ++counter; @@ -447,7 +447,7 @@ if ((matchFirst(line, rgx.book_index)) debug(heading) { // heading writeln(line); } - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; ++line_occur["heading"]; #+END_SRC @@ -460,7 +460,7 @@ if ((matchFirst(line, rgx.book_index)) debug(para) { writeln(line); } - an_object["obj"] ~= line; + an_object["nugget"] ~= line; ++line_occur["para"]; } } @@ -540,7 +540,7 @@ if ((type["heading"] == State.on) an_object["is"] ); // heading an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); ++heading_pointer; debug(segments) { writeln(an_object["lev_markup_number"]); @@ -559,14 +559,10 @@ if ((type["heading"] == State.on) // track previous heading and make assertions debug(objectrelated1) { // check writeln(line); - // writeln(an_object["obj"]); - // writeln(contents_am[counter]["obj_cite_number"], " ", contents_am[counter]["obj"]); - // writeln(m.hit, "\n"); } _common_reset_(line_occur, an_object, type); an_object.remove("lev"); an_object.remove("lev_markup_number"); - // an_object["lev_markup_number"]="9"; processing.remove("verse"); ++counter; #+END_SRC @@ -597,7 +593,7 @@ if ((type["heading"] == State.on) 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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_para( an_object["is"], @@ -641,7 +637,7 @@ if (the_document_body_section.length > 0) { note_section.gather_notes_for_endnote_section( the_document_body_section, segment_object_belongs_to, - the_document_body_section.length -1 + the_document_body_section.length-1 ); } } @@ -886,7 +882,7 @@ functions used in document abstraction #+name: abs_functions_object_reset #+BEGIN_SRC d auto object_reset(ref string[string] an_object) { - an_object.remove("obj"); + an_object.remove("nugget"); an_object.remove("substantive"); an_object.remove("is"); an_object.remove("attrib"); @@ -942,7 +938,6 @@ void _check_obj_cite_number_status_( } else if (matchFirst(line, rgx.obj_cite_number_off_dh)) { type["obj_cite_number_status"] = TriState.closing; } else { - // type["obj_cite_number_status"] = TriState.closing; type["obj_cite_number_status"] = TriState.off; } } else { @@ -1154,7 +1149,7 @@ void _code_block_( debug(code) { // code (curly) line writeln(line); } - an_object["obj"] ~= line ~= "\n"; // code (curly) line + an_object["nugget"] ~= line ~= "\n"; // code (curly) line } } else if (type["tic_code"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1168,7 +1163,7 @@ void _code_block_( debug(code) { // code (tic) line writeln(line); } - an_object["obj"] ~= line ~= "\n"; // code (tic) line + an_object["nugget"] ~= line ~= "\n"; // code (tic) line } } } @@ -1293,8 +1288,6 @@ void _biblio_block_( writeln("check problem entry (Title missing): ", biblio_entry_str_json); } else if ((biblio_entry["author_raw"].str.empty) && (biblio_entry["editor_raw"].str.empty)) { writeln("check problem entry (No author and no editor): ", biblio_entry_str_json); - // } else if (biblio_entry["sortby_deemed_author_year_title"].str.empty) { - // writeln("check problem entry (Sort Field missing): ", biblio_entry_str_json); } else { biblio_arr_json ~= biblio_entry_str_json; } @@ -1335,7 +1328,6 @@ void _biblio_block_( } } tmp = replace(tmp, rgx.trailing_comma, ""); - // tmp = replace(tmp, regex(r"(,[ ]*)$","g"), ""); j["author"].str = tmp; goto default; case "editor_raw": // editor_arr editor (fn sn) @@ -1351,7 +1343,6 @@ void _biblio_block_( } } tmp = replace(tmp, rgx.trailing_comma, ""); - // tmp = replace(tmp, regex(r"(,[ ]*)$","g"), ""); j["editor"].str = tmp; goto default; case "fulltitle": // title & subtitle @@ -1401,7 +1392,7 @@ void _poem_block_( ) { if (type["curly_poem"] == TriState.on) { if (matchFirst(line, rgx.block_curly_poem_close)) { - an_object["obj"]="verse"; // check that this is as you please + an_object["nugget"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( "* [poem curly] %s", @@ -1409,7 +1400,7 @@ void _poem_block_( ); } if (processing.length > 0) { - an_object["obj"] = processing["verse"]; + an_object["nugget"] = processing["verse"]; } debug(poem) { // poem (curly) close writeln(__LINE__); @@ -1418,14 +1409,12 @@ void _poem_block_( obj_cite_number, line ); - // writeln(an_object.keys); - // writeln(an_object.length); } if (an_object.length > 0) { debug(poem) { // poem (curly) close writeln( obj_cite_number, - an_object["obj"] + an_object["nugget"] ); } an_object["is"] = "verse"; @@ -1434,7 +1423,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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1463,12 +1452,12 @@ void _poem_block_( } if (type["verse_new"] == State.on) { verse_line=1; - an_object["obj"] = processing["verse"]; + an_object["nugget"] = processing["verse"]; debug(poem) { // poem verse writefln( "* %s curly\n%s", obj_cite_number, - an_object["obj"] + an_object["nugget"] ); } processing.remove("verse"); @@ -1486,7 +1475,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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1501,7 +1490,7 @@ void _poem_block_( } } else if (type["tic_poem"] == TriState.on) { if (auto m = matchFirst(line, rgx.block_tic_close)) { // tic_poem_close - an_object["obj"]="verse"; // check that this is as you please + an_object["nugget"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( "* [poem tic] %s", @@ -1509,7 +1498,7 @@ void _poem_block_( ); } if (processing.length > 0) { // needs looking at - an_object["obj"] = processing["verse"]; + an_object["nugget"] = processing["verse"]; } if (an_object.length > 0) { debug(poem) { // poem (tic) close @@ -1523,7 +1512,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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1551,12 +1540,12 @@ void _poem_block_( } if (type["verse_new"] == State.on) { verse_line=1; - an_object["obj"] = processing["verse"]; + an_object["nugget"] = processing["verse"]; debug(poem) { // poem (tic) close writefln( "* %s tic\n%s", obj_cite_number, - an_object["obj"] + an_object["nugget"] ); } processing.remove("verse"); @@ -1575,7 +1564,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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1613,7 +1602,7 @@ void _group_block_( debug(group) { // group writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build group array (or string) + an_object["nugget"] ~= line ~= "\n"; // build group array (or string) } } else if (type["tic_group"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1627,7 +1616,7 @@ void _group_block_( debug(group) { // group writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build group array (or string) + an_object["nugget"] ~= line ~= "\n"; // build group array (or string) } } } @@ -1654,7 +1643,7 @@ void _block_block_( debug(block) { // block writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build block array (or string) + an_object["nugget"] ~= line ~= "\n"; // build block array (or string) } } else if (type["tic_block"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1668,7 +1657,7 @@ void _block_block_( debug(block) { // block writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build block array (or string) + an_object["nugget"] ~= line ~= "\n"; // build block array (or string) } } } @@ -1695,7 +1684,7 @@ void _quote_block_( debug(quote) { // quote writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build quote array (or string) + an_object["nugget"] ~= line ~= "\n"; // build quote array (or string) } } else if (type["tic_quote"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1709,7 +1698,7 @@ void _quote_block_( debug(quote) { // quote writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build quote array (or string) + an_object["nugget"] ~= line ~= "\n"; // build quote array (or string) } } } @@ -1736,7 +1725,7 @@ void _table_block_( debug(table) { // table writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build table array (or string) + an_object["nugget"] ~= line ~= "\n"; // build table array (or string) } } else if (type["tic_table"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1750,7 +1739,7 @@ void _table_block_( debug(table) { // table writeln(line); } - an_object["obj"] ~= line ~= "\n"; // build table array (or string) + an_object["nugget"] ~= line ~= "\n"; // build table array (or string) } } } @@ -1804,7 +1793,7 @@ void _block_flag_line_empty_( 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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block_code( an_object["is"], @@ -1822,7 +1811,6 @@ void _block_flag_line_empty_( ("bookindex" in an_object) ? an_object["bookindex"] : ""; bookindex_unordered_hashes = bkidx_hash(an_object["bookindex"], obj_cite_number); - // obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); an_object["is"] = "verse"; // check also _node = node_construct.node_emitter( @@ -1832,7 +1820,6 @@ void _block_flag_line_empty_( counter, heading_pointer-1, an_object["is"] - // "verse" ); the_document_body_section ~= set_abstract_object.contents_block_obj_cite_number_string( @@ -1843,7 +1830,6 @@ void _block_flag_line_empty_( ); // bookindex object_reset(an_object); processing.remove("verse"); - // ++obj_cite_number; type["blocks"] = TriState.off; type["poem"] = TriState.off; } else if (type["table"] == TriState.closing) { @@ -1868,7 +1854,7 @@ void _block_flag_line_empty_( 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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1903,7 +1889,7 @@ void _block_flag_line_empty_( 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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1937,7 +1923,7 @@ void _block_flag_line_empty_( 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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1972,7 +1958,7 @@ void _block_flag_line_empty_( 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["obj"], _node); + obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2006,7 +1992,6 @@ auto _book_index_( "* [bookindex] %s\n", to!string(m.captures[1]), ); - // writeln(scr_txt_marker["blue"], to!string(m.captures[1]), "\n"); } an_object["bookindex"] = to!string(m.captures[1]); } else if (auto m = match(line, rgx.book_index_open)) { @@ -2018,7 +2003,6 @@ auto _book_index_( "* [bookindex] %s\n", book_idx_tmp, ); - // writeln(scr_txt_marker["blue"], book_idx_tmp, "\n"); } } else if (type["book_index"] == State.on ) { /+ book_index flag set +/ @@ -2030,7 +2014,6 @@ auto _book_index_( "* [bookindex] %s\n", book_idx_tmp, ); - // writeln(scr_txt_marker["blue"], book_idx_tmp, "\n"); } book_idx_tmp = ""; } else { @@ -2212,15 +2195,14 @@ auto _heading_matched_( type["heading_biblio"] = State.off; type["para"] = State.off; ++line_occur["heading"]; - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; an_object["lev"] ~= m.captures[1]; - // writeln("an object level: ", an_object); assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels switch (an_object["lev"]) { case "A": - an_object["obj"]=replaceFirst(an_object["obj"], + an_object["nugget"]=replaceFirst(an_object["nugget"], rgx.variable_doc_title, (dochead_meta_aa["title"]["full"] ~ ",")); - an_object["obj"]=replaceFirst(an_object["obj"], + an_object["nugget"]=replaceFirst(an_object["nugget"], rgx.variable_doc_author, dochead_meta_aa["creator"]["author"]); collapsed_lev["h0"] = 1; an_object["lev_collapsed_number"] = @@ -2332,8 +2314,6 @@ auto _heading_matched_( an_object["lev_markup_number"] = to!string(lv["lv"]); } debug(heading) { // heading - // writeln(m.captures[1], " ", m.captures[2], "\n"); // figure inclusion of post capture text - // writeln(m.hit, "\n"); writeln(strip(line)); } } @@ -2354,14 +2334,12 @@ auto _para_match_( ) { if (line_occur["para"] == State.off) { /+ para matches +/ - // paragraphs - // (fl ag_type["heading"] = true) && if (auto m = matchFirst(line, rgx.para_indent)) { debug(paraindent) { // para indent writeln(line); } type["para"] = State.on; - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; // is newline needed? indent["hang_position"] = to!string(m.captures[1]); indent["base_position"] = "0"; bullet = false; @@ -2370,7 +2348,7 @@ auto _para_match_( writeln(line); } type["para"] = State.on; - an_object["obj"] ~= line; + an_object["nugget"] ~= line; indent=[ "hang_position" : "0", "base_position" : "0", @@ -2381,7 +2359,7 @@ auto _para_match_( writeln(line); } type["para"] = State.on; - an_object["obj"] ~= line; + an_object["nugget"] ~= line; indent=[ "hang_position" : to!string(m.captures[1]), "base_position" : to!string(m.captures[2]), @@ -2392,16 +2370,15 @@ auto _para_match_( writeln(line); } type["para"] = State.on; - an_object["obj"] ~= line; + an_object["nugget"] ~= line; indent=[ "hang_position" : to!string(m.captures[1]), "base_position" : "0", ]; bullet = true; } else { - // !line.empty type["para"] = State.on; - an_object["obj"] ~= line; + an_object["nugget"] ~= line; indent=[ "hang_position" : "0", "base_position" : "0", @@ -2440,7 +2417,6 @@ struct OCNemitter { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d struct ObjInlineMarkupMunge { -// struct ObjInlineMarkupMunge : AssertObjInlineMarkup { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; string obj_txt_out, tail, note; @@ -2492,11 +2468,6 @@ struct ObjInlineMarkupMunge { (mkup.en_a_o ~ to!string(n_foot)) ); tail = m.post; - // if (!empty(m.post)) { - // tail = m.post; - // } else { - // tail = ""; - // } } } else { obj_txt_out = obj_txt_in; @@ -2550,22 +2521,6 @@ struct ObjInlineMarkupMunge { invariant() { } /+ revisit +/ - // string header_make(string obj_txt_in) - // in { } - // body { - // obj_txt["munge"]=obj_txt_in; - // return obj_txt["munge"]; - // } - // invariant() { - // } - // string header_meta(string obj_txt_in) - // in { } - // body { - // obj_txt["munge"]=obj_txt_in; - // return obj_txt["munge"]; - // } - // invariant() { - // } string code(string obj_txt_in) in { } body { @@ -2648,10 +2603,10 @@ struct ObjInlineMarkup { ) in { } body { - obj_txt["munge"]=obj_["obj"].dup; + obj_txt["munge"]=obj_["nugget"].dup; obj_txt["munge"]=(match(obj_["is"], ctRegex!(`verse|code`))) - ? obj_txt["munge"] - : strip(obj_txt["munge"]); + ? obj_txt["munge"] + : strip(obj_txt["munge"]); static __gshared string[] anchor_tags_ = []; switch (obj_["is"]) { case "heading": @@ -2728,7 +2683,7 @@ struct ObjInlineMarkup { ) in { } body { - char[] heading_toc_ = to!(char[])(obj_["obj"].dup.strip); + char[] heading_toc_ = to!(char[])(obj_["nugget"].dup.strip); heading_toc_ = _clean_heading_toc_(heading_toc_); auto attrib=""; string toc_txt_; @@ -2931,8 +2886,6 @@ private: heading_num_3 = 0; } else if (heading_num_top_level == (to!uint(obj_["lev_markup_number"]) - 3)) { heading_num_3 ++; - } else { - // } if (heading_num_3 > 0) { heading_number_auto_composite = @@ -3027,7 +2980,6 @@ private: txt_in = "1~copyright Copyright"; txt_out ="1~copyright Copyright"; assert(_make_segment_anchor_tags_if_none_provided(txt_in, txt_lev) == txt_out); - // assert(ObjInlineMarkup._make_segment_anchor_tags_if_none_provided(txt_in, txt_lev) == txt_out); txt_in = "1~ 6. Writing Copyright Licenses"; txt_out ="1~s6 6. Writing Copyright Licenses"; @@ -3099,7 +3051,7 @@ struct ObjAttributes { _obj_attrib["json"] ="{"; switch (obj_is_) { case "heading": - _obj_attrib["json"] ~= _heading(obj_raw); // + _obj_attrib["json"] ~= _heading(obj_raw); break; case "para": _obj_attrib["json"] ~= _para_and_blocks(obj_raw) @@ -3136,9 +3088,7 @@ struct ObjAttributes { _obj_attrib["json"]=_set_additional_values_parse_as_json(_obj_attrib["json"], obj_is_, _node); debug(structattrib) { if (oa_j["is"].str() == "heading") { - // writeln(__LINE__); writeln(_obj_attrib["json"]); - // writeln(_node); writeln( "is: ", oa_j["is"].str(), "; obj_cite_number: ", oa_j["obj_cite_number"].integer() @@ -3472,7 +3422,6 @@ struct BookIndexReportIndent { bookindex_unordered_hashes[mainkey][subkey] )); } - // bookindex_the[mkn][mainkey][skn][subkey] ~= (bookindex_unordered_hashes[mainkey][subkey]); ++skn; } ++mkn; @@ -3533,7 +3482,8 @@ struct BookIndexReportSection { string segment_object_belongs_to, ) { string type; - string lev, lev_markup_number, lev_collapsed_number; + string lev; + int lev_markup_number, lev_collapsed_number; string attrib; string[string] indent; auto set_abstract_object = ObjectAbstractSet(); @@ -3541,12 +3491,10 @@ struct BookIndexReportSection { bookindex_unordered_hashes.byKey.array.sort().release; string bi_tmp_seg, bi_tmp_scroll; ObjComposite[][string] bookindex_section; - // writeln(mainkeys.length); - // B~ Book Index attrib=""; lev="B"; - lev_markup_number="1"; - lev_collapsed_number="1"; + lev_markup_number=1; + lev_collapsed_number=1; bookindex_section["scroll"] ~= set_abstract_object.contents_heading( "Book Index", @@ -3569,11 +3517,10 @@ struct BookIndexReportSection { ); ++obj_cite_number; ++mkn; - // 1~ Index attrib=""; lev="1"; - lev_markup_number="4"; - lev_collapsed_number="2"; + lev_markup_number=4; + lev_collapsed_number=2; bookindex_section["scroll"] ~= set_abstract_object.contents_heading( "Index", @@ -3599,7 +3546,6 @@ struct BookIndexReportSection { foreach (mainkey; mainkeys) { bi_tmp_scroll = "!{" ~ mainkey ~ "}! "; bi_tmp_seg = "!{" ~ mainkey ~ "}! "; - // bi_tmp = "_0_1 !{" ~ mainkey ~ "}! "; foreach (ref_; bookindex_unordered_hashes[mainkey]["_a"]) { auto go = replaceAll(ref_, rgx.book_index_go, "$1"); bi_tmp_scroll ~= (" {" ~ ref_ ~ "}#" ~ go ~ ", "); @@ -3634,13 +3580,6 @@ struct BookIndexReportSection { "hang_position" : "0", "base_position" : "1", ]; - // bookindex_section ~= - // set_abstract_object.contents_para( - // obj, - // obj_cite_number, - // indent, - // false - // ); bookindex_section["scroll"] ~= set_abstract_object.contents_para( type, @@ -3715,7 +3654,6 @@ struct NotesSection { writeln( "{^{", m.captures[1], ".}^}../", segment_object_belongs_to, ".fn_suffix#noteref_\n ", m.captures[1], " ", m.captures[2]); // sometimes need segment name (segmented html & epub) - // writeln("{^{", m.captures[1], ".}^}#", contents_am[counter]["obj_cite_number"], " ", m.captures[2]); } // TODO NEXT you need anchor for segments at this point -> object_notes["seg"] ~= @@ -3765,12 +3703,10 @@ struct NotesSection { auto set_abstract_object = ObjectAbstractSet(); ObjComposite[][string] the_endnotes_section; auto endnotes_ = gathered_notes(); - // auto endnotes_ = (split(object_notes, rgx.break_string))[0..$-1]; string type; string lev, lev_markup_number, lev_collapsed_number; string attrib; string[string] indent; - // B~ Endnotes attrib=""; lev="B"; lev_markup_number="1"; @@ -3797,7 +3733,6 @@ struct NotesSection { ); ++obj_cite_number; ++mkn; - // 1~ Endnotes attrib=""; lev="1"; lev_markup_number="4"; @@ -3826,13 +3761,6 @@ struct NotesSection { ++mkn; foreach (endnote; endnotes_["seg"]) { attrib=""; - // endnotes ~= - // set_abstract_object.contents_para( - // obj, - // obj_cite_number, - // indent, - // false - // ); the_endnotes_section["seg"] ~= set_abstract_object.contents_endnote(endnote); } @@ -3881,7 +3809,6 @@ struct Bibliography { writeln("json: ", bib_arr_json.length); writeln("unsorted: ", biblio_unsorted.length); writeln("sorted: ", biblio_sorted__.length); - // writeln("0: ", biblio_sorted__[0]); int counter; int[7] x; while (counter < x.length) { @@ -3942,7 +3869,6 @@ struct Bibliography { foreach (j; biblio_sorted_) { if (!empty(j["fulltitle"].str)) { writeln(j["sortby_deemed_author_year_title"]); - // writeln(j["deemed_author"], " (", j["author"], ") ", j["fulltitle"]); } } } @@ -4002,11 +3928,6 @@ struct NodeStructureMetadata { assert(to!int(obj_cite_number_) >= 0); } body { - // scope(failure) { - // writeln(__FILE__, ":", __LINE__, " failed here:"); - // writeln(" is : ", is_); - // writeln(" node: ", _node); - // } assert(is_ != "heading"); // should not be necessary assert(to!int(obj_cite_number_) >= 0); // should not be necessary int obj_cite_number=to!int(obj_cite_number_); @@ -4071,20 +3992,13 @@ struct NodeStructureMetadata { match(lev_markup_number, rgx.levels_numbered), ("not a valid heading level: " ~ lev_markup_number ~ " at " ~ to!string(obj_cite_number_)) ); - // assert(to!int(obj_cite_number_) >= 0); if (match(lev_markup_number, rgx.levels_numbered)) { if (to!int(lev_markup_number) == 0) { assert(to!int(obj_cite_number_) == 1); - // writeln(lev_markup_number); } } } body { - // scope(failure) { - // writeln(__FILE__, ":", __LINE__, " failed here:"); - // writeln(" is : ", is_); - // writeln(" node: ", _node); - // } auto rgx = Rgx(); int obj_cite_number = to!int(obj_cite_number_); switch (lev_markup_number) { // switch (to!string(lv)) { @@ -4165,15 +4079,6 @@ struct NodeStructureMetadata { p_["obj_cite_number"] = lv6; break; default: - // if (lv7 > State.off) { - // p_["lev_markup_number"] = 7; p_["obj_cite_number"] = lv7; - // } else if (lv6 > State.off) { - // p_["lev_markup_number"] = 6; p_["obj_cite_number"] = lv6; - // } else if (lv5 > State.off) { - // p_["lev_markup_number"] = 5; p_["obj_cite_number"] = lv5; - // } else { - // p_["lev_markup_number"] = 4; p_["obj_cite_number"] = lv4; - // } break; } _node=("{ " ~ @@ -4229,9 +4134,6 @@ struct NodeStructureMetadata { } else if (j["lev_markup_number"].integer == DocStructMarkupHeading.h_text_4) { assert(j["parent_lev_markup_number"].integer == DocStructMarkupHeading.h_text_3); } else if (j["lev_markup_number"].integer == DocStructMarkupHeading.h_text_5) { - // writeln(j["parent_lev_markup_number"].integer); - // assert(j["parent_lev_markup_number"].integer >= 4); - // assert(j["parent_lev_markup_number"].integer <= 7); } } return _node; @@ -4339,7 +4241,7 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { assert(lv["h5"] == State.off); assert(lv["h6"] == State.off); assert(lv["h7"] == State.off); - } else { // (lv["h0"] > State.off) + } else { // (lv["h0"] > State.off) assert(lv["h0"] == State.off,"error should not enter level A a second time"); } break; @@ -4348,9 +4250,9 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { assert(lv["h0"] > State.off); assert(lv["h2"] == State.off); assert(lv["h3"] == State.off); - } else { // (lv["h1"] > State.off) + } else { // (lv["h1"] > State.off) assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); // + assert(lv["h1"] > State.off); } break; case "C": @@ -4358,10 +4260,10 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { assert(lv["h0"] > State.off); assert(lv["h1"] > State.off); assert(lv["h3"] == State.off); - } else { // (lv["h2"] > State.off) + } else { // (lv["h2"] > State.off) assert(lv["h0"] > State.off); assert(lv["h1"] > State.off); - assert(lv["h2"] > State.off); // + assert(lv["h2"] > State.off); } break; case "D": @@ -4369,7 +4271,7 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { assert(lv["h0"] > State.off); assert(lv["h1"] > State.off); assert(lv["h2"] > State.off); - } else { // (lv["h3"] > State.off) + } else { // (lv["h3"] > State.off) assert(lv["h0"] > State.off); assert(lv["h1"] > State.off); assert(lv["h2"] > State.off); @@ -4379,19 +4281,19 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { case "1": if (lv["h4"] == State.off) { assert(lv["h0"] > State.off); - } else { // (lv["h4"] > State.off) + } else { // (lv["h4"] > State.off) assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); // + assert(lv["h4"] > State.off); } break; case "2": if (lv["h5"] == State.off) { assert(lv["h0"] > State.off); assert(lv["h4"] > State.off); - } else { // (lv["h5"] > State.off) + } else { // (lv["h5"] > State.off) assert(lv["h0"] > State.off); assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); // + assert(lv["h5"] > State.off); } break; case "3": @@ -4399,11 +4301,11 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { assert(lv["h0"] > State.off); assert(lv["h4"] > State.off); assert(lv["h5"] > State.off); - } else { // (lv["h6"] > State.off) + } else { // (lv["h6"] > State.off) assert(lv["h0"] > State.off); assert(lv["h4"] > State.off); assert(lv["h5"] > State.off); - assert(lv["h6"] > State.off); // + assert(lv["h6"] > State.off); } break; case "4": @@ -4412,12 +4314,12 @@ auto assertions_doc_structure(string[string] an_object, int[string] lv) { assert(lv["h4"] > State.off); assert(lv["h5"] > State.off); assert(lv["h6"] > State.off); - } else { // (lv["h7"] > State.off) + } else { // (lv["h7"] > State.off) assert(lv["h0"] > State.off); assert(lv["h4"] > State.off); assert(lv["h5"] > State.off); assert(lv["h6"] > State.off); - assert(lv["h7"] > State.off); // + assert(lv["h7"] > State.off); } break; default: @@ -4516,7 +4418,6 @@ struct Node { #+name: ao_structs_init #+BEGIN_SRC d struct ObjComposite { - // size_t id; string use = ""; string of = ""; string is_a = ""; |