diff options
Diffstat (limited to 'src/sdp/ao_abstract_doc_source.d')
-rw-r--r-- | src/sdp/ao_abstract_doc_source.d | 236 |
1 files changed, 69 insertions, 167 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 683b748..2848eb9 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -277,9 +277,9 @@ template SiSUdocAbstraction() { 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; @@ -320,14 +320,14 @@ template SiSUdocAbstraction() { debug(heading) { // heading writeln(line); } - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; ++line_occur["heading"]; } else if (line_occur["para"] > State.off) { /+ paragraph +/ debug(para) { writeln(line); } - an_object["obj"] ~= line; + an_object["nugget"] ~= line; ++line_occur["para"]; } } @@ -392,7 +392,7 @@ template SiSUdocAbstraction() { 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"]); @@ -411,14 +411,10 @@ template SiSUdocAbstraction() { // 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; } else if ((type["para"] == State.on) && (line_occur["para"] > State.off)) { @@ -443,7 +439,7 @@ template SiSUdocAbstraction() { 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"], @@ -482,7 +478,7 @@ template SiSUdocAbstraction() { 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 ); } } @@ -621,7 +617,7 @@ template SiSUdocAbstraction() { } /+ ← closed: abstract doc source +/ /+ ↓ abstraction functions +/ 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"); @@ -665,7 +661,6 @@ template SiSUdocAbstraction() { } 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 { @@ -844,7 +839,7 @@ template SiSUdocAbstraction() { 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)) { @@ -858,7 +853,7 @@ template SiSUdocAbstraction() { debug(code) { // code (tic) line writeln(line); } - an_object["obj"] ~= line ~= "\n"; // code (tic) line + an_object["nugget"] ~= line ~= "\n"; // code (tic) line } } } @@ -912,8 +907,6 @@ template SiSUdocAbstraction() { 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; } @@ -954,7 +947,6 @@ template SiSUdocAbstraction() { } } 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) @@ -970,7 +962,6 @@ template SiSUdocAbstraction() { } } tmp = replace(tmp, rgx.trailing_comma, ""); - // tmp = replace(tmp, regex(r"(,[ ]*)$","g"), ""); j["editor"].str = tmp; goto default; case "fulltitle": // title & subtitle @@ -1012,7 +1003,7 @@ template SiSUdocAbstraction() { ) { 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", @@ -1020,7 +1011,7 @@ template SiSUdocAbstraction() { ); } if (processing.length > 0) { - an_object["obj"] = processing["verse"]; + an_object["nugget"] = processing["verse"]; } debug(poem) { // poem (curly) close writeln(__LINE__); @@ -1029,14 +1020,12 @@ template SiSUdocAbstraction() { 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"; @@ -1045,7 +1034,7 @@ template SiSUdocAbstraction() { 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"], @@ -1074,12 +1063,12 @@ template SiSUdocAbstraction() { } 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"); @@ -1097,7 +1086,7 @@ template SiSUdocAbstraction() { 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"], @@ -1112,7 +1101,7 @@ template SiSUdocAbstraction() { } } 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", @@ -1120,7 +1109,7 @@ template SiSUdocAbstraction() { ); } 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 @@ -1134,7 +1123,7 @@ template SiSUdocAbstraction() { 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"], @@ -1162,12 +1151,12 @@ template SiSUdocAbstraction() { } 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"); @@ -1186,7 +1175,7 @@ template SiSUdocAbstraction() { 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"], @@ -1218,7 +1207,7 @@ template SiSUdocAbstraction() { 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)) { @@ -1232,7 +1221,7 @@ template SiSUdocAbstraction() { 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) } } } @@ -1253,7 +1242,7 @@ template SiSUdocAbstraction() { 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)) { @@ -1267,7 +1256,7 @@ template SiSUdocAbstraction() { 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) } } } @@ -1288,7 +1277,7 @@ template SiSUdocAbstraction() { 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)) { @@ -1302,7 +1291,7 @@ template SiSUdocAbstraction() { 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) } } } @@ -1323,7 +1312,7 @@ template SiSUdocAbstraction() { 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)) { @@ -1337,7 +1326,7 @@ template SiSUdocAbstraction() { 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) } } } @@ -1385,7 +1374,7 @@ template SiSUdocAbstraction() { 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"], @@ -1403,7 +1392,6 @@ template SiSUdocAbstraction() { ("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( @@ -1413,7 +1401,6 @@ template SiSUdocAbstraction() { counter, heading_pointer-1, an_object["is"] - // "verse" ); the_document_body_section ~= set_abstract_object.contents_block_obj_cite_number_string( @@ -1424,7 +1411,6 @@ template SiSUdocAbstraction() { ); // 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) { @@ -1449,7 +1435,7 @@ template SiSUdocAbstraction() { 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"], @@ -1484,7 +1470,7 @@ template SiSUdocAbstraction() { 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"], @@ -1518,7 +1504,7 @@ template SiSUdocAbstraction() { 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"], @@ -1553,7 +1539,7 @@ template SiSUdocAbstraction() { 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"], @@ -1581,7 +1567,6 @@ template SiSUdocAbstraction() { "* [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)) { @@ -1593,7 +1578,6 @@ template SiSUdocAbstraction() { "* [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 +/ @@ -1605,7 +1589,6 @@ template SiSUdocAbstraction() { "* [bookindex] %s\n", book_idx_tmp, ); - // writeln(scr_txt_marker["blue"], book_idx_tmp, "\n"); } book_idx_tmp = ""; } else { @@ -1768,15 +1751,14 @@ template SiSUdocAbstraction() { 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"] = @@ -1888,8 +1870,6 @@ template SiSUdocAbstraction() { 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)); } } @@ -1904,14 +1884,12 @@ template SiSUdocAbstraction() { ) { 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; @@ -1920,7 +1898,7 @@ template SiSUdocAbstraction() { writeln(line); } type["para"] = State.on; - an_object["obj"] ~= line; + an_object["nugget"] ~= line; indent=[ "hang_position" : "0", "base_position" : "0", @@ -1931,7 +1909,7 @@ template SiSUdocAbstraction() { 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]), @@ -1942,16 +1920,15 @@ template SiSUdocAbstraction() { 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", @@ -1978,7 +1955,6 @@ template SiSUdocAbstraction() { } } 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; @@ -2030,11 +2006,6 @@ template SiSUdocAbstraction() { (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; @@ -2088,22 +2059,6 @@ template SiSUdocAbstraction() { 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 { @@ -2173,10 +2128,10 @@ template SiSUdocAbstraction() { ) 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": @@ -2247,7 +2202,7 @@ template SiSUdocAbstraction() { ) 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_; @@ -2438,8 +2393,6 @@ template SiSUdocAbstraction() { 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 = @@ -2517,7 +2470,6 @@ template SiSUdocAbstraction() { 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"; @@ -2570,7 +2522,7 @@ template SiSUdocAbstraction() { _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) @@ -2607,9 +2559,7 @@ template SiSUdocAbstraction() { _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() @@ -2851,7 +2801,6 @@ template SiSUdocAbstraction() { bookindex_unordered_hashes[mainkey][subkey] )); } - // bookindex_the[mkn][mainkey][skn][subkey] ~= (bookindex_unordered_hashes[mainkey][subkey]); ++skn; } ++mkn; @@ -2893,7 +2842,8 @@ template SiSUdocAbstraction() { 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(); @@ -2901,12 +2851,10 @@ template SiSUdocAbstraction() { 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", @@ -2929,11 +2877,10 @@ template SiSUdocAbstraction() { ); ++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", @@ -2959,7 +2906,6 @@ template SiSUdocAbstraction() { 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 ~ ", "); @@ -2994,13 +2940,6 @@ template SiSUdocAbstraction() { "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, @@ -3057,7 +2996,6 @@ template SiSUdocAbstraction() { 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"] ~= @@ -3095,12 +3033,10 @@ template SiSUdocAbstraction() { 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"; @@ -3127,7 +3063,6 @@ template SiSUdocAbstraction() { ); ++obj_cite_number; ++mkn; - // 1~ Endnotes attrib=""; lev="1"; lev_markup_number="4"; @@ -3156,13 +3091,6 @@ template SiSUdocAbstraction() { ++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); } @@ -3192,7 +3120,6 @@ template SiSUdocAbstraction() { 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) { @@ -3241,7 +3168,6 @@ template SiSUdocAbstraction() { foreach (j; biblio_sorted_) { if (!empty(j["fulltitle"].str)) { writeln(j["sortby_deemed_author_year_title"]); - // writeln(j["deemed_author"], " (", j["author"], ") ", j["fulltitle"]); } } } @@ -3276,11 +3202,6 @@ template SiSUdocAbstraction() { 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_); @@ -3339,20 +3260,13 @@ template SiSUdocAbstraction() { 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)) { @@ -3433,15 +3347,6 @@ template SiSUdocAbstraction() { 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=("{ " ~ @@ -3497,9 +3402,6 @@ template SiSUdocAbstraction() { } 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; @@ -3596,7 +3498,7 @@ template SiSUdocAbstraction() { 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; @@ -3605,9 +3507,9 @@ template SiSUdocAbstraction() { 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": @@ -3615,10 +3517,10 @@ template SiSUdocAbstraction() { 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": @@ -3626,7 +3528,7 @@ template SiSUdocAbstraction() { 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); @@ -3636,19 +3538,19 @@ template SiSUdocAbstraction() { 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": @@ -3656,11 +3558,11 @@ template SiSUdocAbstraction() { 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": @@ -3669,12 +3571,12 @@ template SiSUdocAbstraction() { 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: |