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 /src/sdp | |
parent | 0.8.0 the document parts (& org babel tangle) (diff) |
cleaning (one hash key renamed)
Diffstat (limited to 'src/sdp')
-rw-r--r-- | src/sdp/ao_abstract_doc_source.d | 236 | ||||
-rw-r--r-- | src/sdp/ao_conf_make_meta_native.d | 29 | ||||
-rw-r--r-- | src/sdp/ao_conf_make_meta_sdlang.d | 13 | ||||
-rw-r--r-- | src/sdp/ao_defaults.d | 74 | ||||
-rw-r--r-- | src/sdp/ao_object_setter.d | 1 | ||||
-rw-r--r-- | src/sdp/ao_output_debugs.d | 18 | ||||
-rw-r--r-- | src/sdp/ao_read_config_files.d | 35 | ||||
-rw-r--r-- | src/sdp/ao_read_source_files.d | 18 | ||||
-rw-r--r-- | src/sdp/ao_rgx.d | 22 | ||||
-rw-r--r-- | src/sdp/output_html.d | 11 | ||||
-rw-r--r-- | src/sdp/output_hub.d | 2 |
11 files changed, 77 insertions, 382 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: diff --git a/src/sdp/ao_conf_make_meta_native.d b/src/sdp/ao_conf_make_meta_native.d index 0fdee40..afcd14e 100644 --- a/src/sdp/ao_conf_make_meta_native.d +++ b/src/sdp/ao_conf_make_meta_native.d @@ -187,15 +187,6 @@ template SiSUheaderExtractNative() { case "links": destroy(hm); destroy(hs); - // if (match(hs, rgx.native_subhead_links)) { - // if (dochead_meta[hm][hs]) { - // dochead_meta[hm][hs] = to!string(s.captures[2]); - // } - // } else { - // writeln("not a valid header type:", hm, ":", hs); - // destroy(hm); - // destroy(hs); - // } break; default: break; @@ -224,7 +215,7 @@ template SiSUheaderExtractNative() { type["header_make"] = State.on; type["header_meta"] = State.off; ++line_occur["header_make"]; - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; } else if (matchFirst(line, rgx.native_header)) { /+ matched header_metadata +/ /+ (generic header match and not previously caught by header_make) +/ debug(header1) { /+ writeln(line); +/ } @@ -232,20 +223,20 @@ template SiSUheaderExtractNative() { type["header_make"] = State.off; type["header_meta"] = State.on; ++line_occur["header_meta"]; - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; } else if (type["header_make"] == State.on && (line_occur["header_make"] > State.off)) { /+ header_make flag set +/ if (matchFirst(line, rgx.native_header_sub)) { /+ sub-header +/ debug(header1) { /+ writeln(line); +/ } ++line_occur["header_make"]; - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; } } else if (type["header_meta"] == State.on && (line_occur["header_meta"] > State.off)) { /+ header_metadata flag set +/ if (matchFirst(line, rgx.native_header_sub)) { /+ sub-header +/ debug(header1) { /+ writeln(line); +/ } ++line_occur["header_meta"]; - an_object["obj"] ~= line ~= "\n"; + an_object["nugget"] ~= line ~= "\n"; } } return an_object; @@ -255,13 +246,10 @@ template SiSUheaderExtractNative() { ref string[string] an_object, ref int[string] type ) { - // line_occur["header"] = State.off; line_occur["header_make"] = State.off; line_occur["header_meta"] = State.off; type["header"] = State.off; - // type["header_make"] = State.off; - // type["header_meta"] = State.off; - an_object.remove("obj"); + an_object.remove("nugget"); an_object.remove("is"); an_object.remove("attrib"); } @@ -283,11 +271,8 @@ template SiSUheaderExtractNative() { if (auto m = matchFirst(header_line, rgx.comment)) { /+ matched comment +/ debug(comment) { - // tell_l("blue", header_line); } header_reset_states_common(line_occur, an_object, type); - // type["header_make"] = State.off; - // type["header_meta"] = State.off; } else if ((matchFirst(header_line, rgx.native_header)) || (type["header_make"] == State.on && (line_occur["header_make"] > State.off)) @@ -296,7 +281,7 @@ template SiSUheaderExtractNative() { if (header_line.length == 0) { /+ header_make instructions (current line empty) +/ auto dochead_metadata_and_make = - set_header.header_metadata_and_make_aa(strip(an_object["obj"]), dochead_meta, dochead_make); + set_header.header_metadata_and_make_aa(strip(an_object["nugget"]), dochead_meta, dochead_make); static assert(!isTypeTuple!(dochead_metadata_and_make)); dochead_meta = dochead_metadata_and_make[0]; dochead_make = dochead_metadata_and_make[1]; @@ -309,8 +294,6 @@ template SiSUheaderExtractNative() { } else { an_object = native_header_extract(header_line, line_occur, an_object, type); } - } else { - // writeln(__LINE__); } } auto t = tuple( diff --git a/src/sdp/ao_conf_make_meta_sdlang.d b/src/sdp/ao_conf_make_meta_sdlang.d index a53cbd7..d917a34 100644 --- a/src/sdp/ao_conf_make_meta_sdlang.d +++ b/src/sdp/ao_conf_make_meta_sdlang.d @@ -167,20 +167,8 @@ template SiSUheaderExtractSDLang() { /+ TODO stuff to fix +/ - // hs = "link"; - // if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) - // && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - // debug(headersdlang) { - // writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); - // } - // dochead_meta[hm][hs] = - // to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); - // } } +/ - // debug(headersdlang) { - // writeln(dochead_make); - // } return dochead_make; } final private auto headerMakeSDLang(in string src_header) { @@ -217,7 +205,6 @@ template SiSUheaderExtractSDLang() { foreach(header_line; source_header_arr) { if (!match(header_line, rgx.comments)) { header_clean ~= header_line ~ "\n"; - // writeln(header_line); } } /+ get sdlang tags +/ diff --git a/src/sdp/ao_defaults.d b/src/sdp/ao_defaults.d index d9f0b18..3cdd265 100644 --- a/src/sdp/ao_defaults.d +++ b/src/sdp/ao_defaults.d @@ -382,77 +382,7 @@ template SiSUbiblio() { } template InternalMarkup() { struct InlineMarkup { - // endnote en_a_o: '~{'; en_a_c: '}~' - auto en_a_o = "【"; auto en_a_c = "】"; - // endnote en_b_o: '~['; en_b_c: ']~' - auto en_b_o = "〖"; auto en_b_c = "〗"; - // auto segname_prefix_auto_num_extract = "c"; - // auto segname_prefix_auto_num_provide = "s"; - // auto segname_prefix_auto_num_other = "x"; - // auto obj_cite_number_id_char = ""; //'o'; now as before; remove for html5 - // auto note = "note_"; - // auto note_ref = "noteref_"; - // auto note_astx = "note_astx_"; - // auto note_ref_astx = "noteref_astx_"; - // auto note_plus = "note_plus_"; - // auto note_ref_plus = "noteref_plus_"; - // auto meta_o = "〔@"; auto meta_c = "〕"; - // auto lv_o_0 = 0; - // auto lv_o_1 = 1; - // auto lv_o_2 = 2; - // auto lv_o_3 = 3; - // auto lv_o_4 = 4; - // auto lv_o_5 = 5; - // auto lv_o_6 = 6; - // auto lv_o_7 = 7; - // auto lv_o_8 = 8; - // auto lv_o_9 = 9; - // auto lv_o = "〔"; auto lv_c = "〕"; - // auto bl_o = "〔"; auto bl_c = "〕"; // block text mark - // auto gr_o = "〔"; auto gr_c = "〕"; // group text mark #REPLACE & RETIRE - // auto id_o = "〔"; auto id_c = "〕"; // object id mark - // auto tc_o = "『"; auto tc_c = "』"; // table row mark #Mx[:tc_c]="』\n" - // auto tc_p = "┆'" - // auto pa_o = "〔"; auto pa_c = "〕"; // affects paragraph mark - // auto mk_o = "〔"; auto mk_c = "〕"; // generic mark - // auto gl_o = "〔"; auto gl_c = "〕"; // glyph - // auto fa_o = "〔"; auto fa_o_c = "¤"; auto fa_c_o = "¤"; auto fa_c = "〕"; - // auto idx_o = "▩"; auto idx_c = "▩"; - // auto nbsp = "░"; // '▭ ' - // auto br_line = "╱"; // lB ▌ 9612 ┘ ¶ - // auto br_nl = "╲"; // lB ▌ 』 ┘ - // auto br_paragraph = "█"; // FB █ 9608 # PP ∥ 8741 #▐ #'┘' #'¶' #FB █ 9608 lB ▌ 9612 RB ▐ 9616 - // auto br_obj = "break_obj"; - // auto br_page_line = "▭"; - // auto br_page = "┼"; - // auto br_page_new = "╋"; - // auto lnk_o = "⌠"; lnk_c = "⌡"; // '⌈' '⌋' '⌠' '⌡' #Mx[:lnk_o= '◁'; Mx[:lnk_c= '▷' #‹ › - // auto url_o = "◘"; auto url_c = "◙"; - // auto rel_o = "⌈"; auto rel_c = "⌋"; - // auto tag_o = "⌊"; auto tag_c = "⌉"; - // auto sm_set_o = "◢"; auto sm_set_c = "◣"; - // auto sm_subset_o = "◢"; auto sm_subset_c = "◣"; - // auto vline = "┆"; // ¦ | - // auto src_bold_o = "!{"; auto src_bold_c = "}!"; - // auto src_italics_o = "/{"; auto src_italics_c = "}/"; - // auto src_underscore_o = "_{"; auto src_underscore_c = "}_"; - // auto src_cite_o = ""{"; auto src_cite_c = "}""; - // auto src_insert_o = "+{"; auto src_insert_c = "}+"; - // auto src_strike_o = "-{"; auto src_strike_c = "}-"; - // auto src_superscript_o = "^{"; auto src_superscript_c = "}^"; - // auto src_subscript_o = ";{"; auto src_subscript_c = "}'" - // auto src_hilite_o = "*{"; auto src_hilite_c = "}*"; - // auto src_monospace_o = "#{"; auto src_monospace_c = "}#"; - // auto srcrgx_bold_o = "\\!\\{"; auto srcrgx_bold_c = "\\}\\!"; - // auto srcrgx_italics_o = "\\/\\{"; auto srcrgx_italics_c = "\\}\\/"; - // auto srcrgx_underscore_o = "_\\{"; auto srcrgx_underscore_c = "\\}_"; - // auto srcrgx_cite_o = "\"\\{"; auto srcrgx_cite_c = "\\}\""; - // auto srcrgx_insert_o = "\\+\\{"; auto srcrgx_insert_c = "\\}\\+"; - // auto srcrgx_strike_o = "\\-\\{"; auto srcrgx_strike_c = "\\}\\-"; - // auto srcrgx_superscript_o = "\\^\\{"; auto srcrgx_superscript_c = "\\}\\^"; - // auto srcrgx_subscript_o = ",\\{"; auto srcrgx_subscript_c = "\\},"; - // auto srcrgx_hilite_o = "\\*\\{"; auto srcrgx_hilite_c = "\\}\\*"; - // auto srcrgx_monospace_o = "\\#\\{"; auto srcrgx_monospace_c = "\\}\\#"; - // ⊹ + auto en_a_o = "【"; auto en_a_c = "】"; // endnote en_a_o: '~{'; en_a_c: '}~' + auto en_b_o = "〖"; auto en_b_c = "〗"; // endnote en_b_o: '~['; en_b_c: ']~' } } diff --git a/src/sdp/ao_object_setter.d b/src/sdp/ao_object_setter.d index 4996452..f942fc3 100644 --- a/src/sdp/ao_object_setter.d +++ b/src/sdp/ao_object_setter.d @@ -28,7 +28,6 @@ template ObjectSetter() { string node = ""; } struct ObjComposite { - // size_t id; string use = ""; string of = ""; string is_a = ""; diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d index 7ff68ce..eefec9d 100644 --- a/src/sdp/ao_output_debugs.d +++ b/src/sdp/ao_output_debugs.d @@ -15,7 +15,6 @@ template SiSUoutputDebugs() { mixin RgxInit; auto rgx = Rgx(); struct BookIndexReport { - // class BookIndexReport : AssertBookIndexReport { int mkn, skn; auto bookindex_report_sorted( string[][string][string] bookindex_unordered_hashes @@ -33,12 +32,10 @@ template SiSUoutputDebugs() { to!string(bookindex_unordered_hashes[mainkey][subkey]) ); } - // bookindex_the[mkn][mainkey][skn][subkey] ~= (bookindex_unordered_hashes[mainkey][subkey]); ++skn; } ++mkn; } - // return bookindex_the; } } debug(parent) { @@ -281,7 +278,6 @@ template SiSUoutputDebugs() { obj.heading_attrib.lev, obj.obj_cite_number, obj.anchor_tags, - // "[", obj["is"], "] ", obj.object ); } @@ -293,49 +289,36 @@ template SiSUoutputDebugs() { if (o.is_a == "heading") { switch (o.heading_attrib.lev_markup_number) { case 0: - // case to!string(DocStructMarkupHeading.h_sect_A): spc=""; break; case 1: - // case to!string(DocStructMarkupHeading.h_sect_B): spc=" "; break; case 2: - // case to!string(DocStructMarkupHeading.h_sect_C): spc=" "; break; case 3: - // case to!string(DocStructMarkupHeading.h_sect_D): spc=" "; break; case 4: - // case to!string(DocStructMarkupHeading.h_text_1): spc=" "; break; case 5: - // case to!string(DocStructMarkupHeading.h_text_2): spc=" "; break; case 6: - // case to!string(DocStructMarkupHeading.h_text_3): spc=" "; break; case 7: - // case to!string(DocStructMarkupHeading.h_text_4): spc=" "; break; case 8: - // case to!string(DocStructMarkupHeading.h_text_5): spc=" "; break; default: spc=""; break; } - // writeln( - // spc, "* ", " ", - // o - // ); writefln( "%s* %s\n (markup level: %s; collapsed level: %s)", spc, @@ -363,7 +346,6 @@ template SiSUoutputDebugs() { "%s~ [%s] %s", obj.heading_attrib.lev, obj.obj_cite_number, - // "[", obj["is"], "] ", obj.object ); } diff --git a/src/sdp/ao_read_config_files.d b/src/sdp/ao_read_config_files.d index 013acdd..34b858b 100644 --- a/src/sdp/ao_read_config_files.d +++ b/src/sdp/ao_read_config_files.d @@ -6,22 +6,13 @@ template SiSUconfigIn() { private import std.exception, - // std.regex, std.stdio, std.utf, std.conv : to; - // private import - // ao_rgx; // ao_defaults.d - // mixin RgxInit; - // auto rgx = Rgx(); private struct ConfigIn { private import std.file; final private string readInConfigFile(string conf_sdl) { - // enforce( - // exists(fn_src)!=0, - // "file not found" - // ); string[] possible_config_path_locations = [ environment["PWD"] ~ "/.sisu", environment["PWD"] ~ "/_sisu", @@ -35,7 +26,6 @@ template SiSUconfigIn() { pth, conf_sdl, ); - // writeln(conf_file); try { if (exists(conf_file)) { debug(configfile) { @@ -46,25 +36,8 @@ template SiSUconfigIn() { } } catch (ErrnoException ex) { - //// Handle errors - // switch(ex.errno) { - // case EPERM: - // case EACCES: - // // Permission denied - // break; - // case ENOENT: - // // File does not exist - // break; - // default: - // // Handle other errors - // break; - // } } - // catch (UTFException ex) { - // // Handle validation errors - // } catch (FileException ex) { - // Handle errors } } return config_file_str; @@ -83,20 +56,12 @@ template SiSUconfigSDLang() { } catch(ParseException e) { stderr.writeln("SDLang problem with content for ", conf_sdl_filename); - // Error messages of the form: - // myFile.sdl(5:28): Error: Invalid integer suffix. stderr.writeln(e.msg); } debug(sdlang) { - // Value is a std.variant.Algebraic Value output_dir_structure_by = sdl_root_conf.tags["output_dir_structure_by"][0].values[0]; assert(output_dir_structure_by.type == typeid(string)); writeln(output_dir_structure_by); - // Tag person = sdl_root_conf.namespaces["myNamespace"].tags["person"][0]; - // writeln("Name: ", person.attributes["name"][0].value); - // - // int age = person.tags["age"][0].values[0].get!int(); - // writeln("Age: ", age); writeln("conf SDL:"); writeln(sdl_root_conf.toSDLDocument()); } diff --git a/src/sdp/ao_read_source_files.d b/src/sdp/ao_read_source_files.d index 793a45a..5ff0ec1 100644 --- a/src/sdp/ao_read_source_files.d +++ b/src/sdp/ao_read_source_files.d @@ -43,7 +43,6 @@ template SiSUmarkupRaw() { private struct MarkupRawUnit { private import std.file; - // enum State { off, on } final private string readInMarkupSource(in string fn_src) { enforce( exists(fn_src)!=0, @@ -56,19 +55,6 @@ template SiSUmarkupRaw() { } } catch (ErrnoException ex) { - //// Handle errors - // switch(ex.errno) { - // case EPERM: - // case EACCES: - // // Permission denied - // break; - // case ENOENT: - // // File does not exist - // break; - // default: - // // Handle other errors - // break; - // } } catch (UTFException ex) { // Handle validation errors @@ -168,14 +154,12 @@ template SiSUmarkupRaw() { ) { type1["header_make"] = 1; type1["header_meta"] = 0; - // cont_dynamic_array ~= "% " ~ line; } else if ( (type1["header_meta"] == 1) && matchFirst(line, rgx.native_header_sub) ) { type1["header_meta"] = 1; type1["header_make"] = 0; - // cont_dynamic_array ~= "% " ~ line; } else if (auto m = match(line, rgx.insert_src_fn_ssi_or_sst)) { type1["header_make"] = 0; type1["header_meta"] = 0; @@ -249,8 +233,6 @@ template SiSUmarkupRaw() { if (auto ma = match(line, rgx.src_fn_text)) { /+ .sst when inserted, not used: headers and heading level ^:?A~ so remove +/ writeln(__LINE__); writeln(ma); - // auto t = - // raw.markupSourceHeaderContentRawLineTupleArray(fn_src, rgx.src_pth); } auto markup_sourcefile_insert_content = raw.getInsertMarkupSourceContentRawLineArray(fn_src_insert, rgx.src_fn_find_inserts); diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d index 81a06b9..7d44b85 100644 --- a/src/sdp/ao_rgx.d +++ b/src/sdp/ao_rgx.d @@ -6,12 +6,10 @@ template RgxInit() { /+ misc +/ static flag_action = ctRegex!(`^(--[a-z][a-z0-9-]+)$`); static flag_action_str = ctRegex!(` (--[a-z][a-z0-9-]+)`); - // static arr_delimiter = ctRegex!(`\s*[;]\s*`); static within_quotes = ctRegex!(`"(.+?)"`); static make_heading_delimiter = ctRegex!(`[;][ ]*`); static arr_delimiter = ctRegex!(`[ ]*[;][ ]*`); static name_delimiter = ctRegex!(`^([^,]+)[ ]*,[ ]+(.+?)$`); - // static name_delimiter = ctRegex!(`^(.+?)[ ]*,[ ]*(.+?)$`); static book_index_go = ctRegex!("([0-9]+)(?:-[0-9]+)?"); static trailing_comma = ctRegex!(",[ ]*$"); static trailing_linebreak = ctRegex!(",[ ]{1,2}\\\\\\\\\n[ ]{4}$","m"); @@ -31,10 +29,7 @@ template RgxInit() { static src_fn_insert = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssi)$`); static src_fn_find_inserts = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`); static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`); - // static insert_ssi_or_sst_fn = ctRegex!(`^<<\s*[a-zA-Z0-9._-]+[.]ss[ti]`); - // static ssm_fn = ctRegex!(`^[a-zA-Z0-9._-]+[.]ssm$`); /+ insert markup file +/ - // static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*([a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`); /+ comments +/ static comment = ctRegex!(`^%+ `); static comments = ctRegex!(`^%+ |^%+$`); @@ -47,7 +42,6 @@ template RgxInit() { ctRegex!(`^@(?:creator|title|rights|date|original|classify|identifier|notes|publisher|links):(?:\s|$)`); static native_header_main = ctRegex!(`^@(?P<header>[a-z_]+):\s*(?P<content>.*)`, "m"); static native_header_sub = ctRegex!(`^[ ]*:(?P<subheader>[a-z_]+):\s+(?P<content>.+)`, "m"); - // static native_header_sub = ctRegex!(`^[ ]+:([a-z_]+):\s`); static native_header_meta_title = ctRegex!(`^@title:\s`, "m"); static variable_doc_title = ctRegex!(`@title`); static variable_doc_author = ctRegex!(`@author|@creator`); @@ -83,11 +77,9 @@ template RgxInit() { static para_attribs = ctRegex!(`^_(([0-9])(_([0-9]))?|_([1-9])?[*]) `); /+ blocked markup +/ static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); - // static block_open_less_code = ctRegex!("^(((poem|group|block|quote|table)[{].*?$)|`{3} (poem|group|block|quote|table))"); static block_poem_open = ctRegex!("^((poem[{].*?$)|`{3} poem)"); /+ blocked markup tics +/ static block_tic_open = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); - // static block_tic_open_less_code = ctRegex!("^`{3} (poem|group|block|quote|table)"); static block_tic_code_open = ctRegex!("^`{3} (code)([.][a-z][0-9a-z_]+)?"); static block_tic_poem_open = ctRegex!("^`{3} (poem)"); static block_tic_group_open = ctRegex!("^`{3} (group)"); @@ -97,7 +89,6 @@ template RgxInit() { static block_tic_close = ctRegex!("^(`{3})$","m"); /+ blocked markup curly +/ static block_curly_open = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`); - // static block_curly_open_less_code = ctRegex!(`^((poem|group|block|quote|table)[{].*?$)`); static block_curly_code_open = ctRegex!(`^(code([.][a-z][0-9a-z_]+)?[{].*?$)`); static block_curly_code_close = ctRegex!(`^([}]code)`); static block_curly_poem_open = ctRegex!(`^(poem[{].*?$)`); @@ -125,7 +116,6 @@ template RgxInit() { static inline_notes_al_gen = ctRegex!(`【.+?】`, "m"); static inline_notes_curly_gen = ctRegex!(`~\{.+?\}~`, "m"); static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\}~`, "mg"); - // static inline_notes_curly = ctRegex!(`~\{(?:[*+]\s+|\s*)(.+?)\}~`, "mg"); static inline_al_delimiter_open_regular = ctRegex!(`【`, "m"); static inline_al_delimiter_close_regular = ctRegex!(`】`, "m"); static inline_al_delimiter_open_and_close_regular = ctRegex!(`【|】`, "m"); @@ -137,19 +127,11 @@ template RgxInit() { static inline_curly_delimiter_close_regular = ctRegex!(`\s*\}~`, "m"); static inline_curly_delimiter_open_and_close_regular = ctRegex!(`~\{\s*|\s*\}~`, "m"); static inline_notes_delimiter_curly_regular = ctRegex!(`~\{[ ]*(.+?)\}~`, "m"); - // static inline_notes_curly_regular = ctRegex!(`(?:[~][{][ ]*)(.+?)(?:[}][~])`, "m"); - // static inline_notes_curly_regular = ctRegex!(`~\{\s*(.+?)\}~`, "m"); - // static inline_notes_curly = ctRegex!(`~\{(?:[*+]\s+|\s*)(.+?)\}~`, "mg"); static inline_notes_curly_sp = ctRegex!(`~\{[*+]+\s+(.+?)\}~`, "m"); static inline_notes_curly_sp_asterisk = ctRegex!(`~\{[*]+\s+(.+?)\}~`, "m"); static inline_notes_curly_sp_plus = ctRegex!(`~\{[+]+\s+(.+?)\}~`, "m"); - // static inline_text_and_note_curly = ctRegex!(`(.+?)~\{(?:[*+]\s+|\s*)(.+?)\}~`, "mg"); static inline_text_and_note_al = ctRegex!(`(?P<text>.+?)【(?:[*+ ]*)(?P<note>.+?)】`, "mg"); static inline_text_and_note_curly = ctRegex!(`(?P<text>.+?)(?:(?:[~])[{][*+ ]*)(?P<note>.+?)(?:[}][~])`, "mg"); - // static inline_text_and_note_curly = ctRegex!(`(?P<text>.+?)~\{(?:[*+]\s+|\s*)(?P<note>.+?)\}~`, "mg"); - // static inline_text_and_note_curly_sp = ctRegex!(`(.+?)~\{[*+]+\s+(.+?)\}~`, "mg"); - // static inline_text_and_note_curly_sp_asterisk = ctRegex!(`(.+?)~\{[*]+\s+(.+?)\}~`, "mg"); - // static inline_text_and_note_curly_sp_plus = ctRegex!(`(.+?)~\{[+]+\s+(.+?)\}~`, "mg"); static inline_note_curly_delimiters = ctRegex!(`(~\{[*+]?\s*)(.+?)(\}~)`, "mg"); static inline_notes_square = ctRegex!(`~\[\s*(.+?)\]~`, "mg"); static inline_text_and_note_square_sp = ctRegex!(`(.+?)~\[[*+]+\s+(.+?)\]~`, "mg"); @@ -168,25 +150,21 @@ template RgxInit() { static obj_cite_number_off_block = ctRegex!(`^--~#$`); static obj_cite_number_off_block_dh = ctRegex!(`^---#$`); static obj_cite_number_off_block_close = ctRegex!(`^--\+#$`); - // static auto_obj_cite_number_ignore = ctRegex!(`^[+~*$-]{3,}$`); // reminder static obj_cite_number_block_marks = ctRegex!(`^--[+~-]#$`); /+ ignore outside code blocks +/ static skip_from_regular_parse = ctRegex!(`^(--[+~-]#|-[\\]{2}-|=[.\\]{2}=)$`); // not structural info /+ line & page breaks +/ static break_line_within_object = ctRegex!(`[\\]{2}( |$)`); - // static break_line_break_within_object = ctRegex!(`( |^)[\\]{2}( |$)`); static break_page = ctRegex!(`^-[\\]{2}-$`); static break_page_new = ctRegex!(`^=[\\]{2}=$`); static break_page_line_across = ctRegex!(`^=[.]{2}=$`); static break_string = ctRegex!(`』`); - // ancestry, parent static parent = ctRegex!(`([0-7]):([0-9]+)`); /+ json +/ static tailing_comma = ctRegex!(`,$`, "m"); /+ biblio tags +/ static biblio_tags = ctRegex!(`^(is|au|author_raw|author|author_arr|editor_raw|ed|editor_arr|ti|title|subtitle|fulltitle|lng|language|trans|src|jo|journal|in|vol|volume|edn|edition|yr|year|pl|place|pb|pub|publisher|url|pg|pages|note|short_name|id):\s+(.+)`); static biblio_abbreviations = ctRegex!(`^(au|ed|ti|lng|jo|vol|edn|yr|pl|pb|pub|pg|pgs|sn)$`); - // static biblio_tags = ctRegex!(`^(is|author_raw|author|author_arr|editor_raw|editor_arr|title|subtitle|fulltitle|language|trans|src|journal|in|volume|edition|year|place|publisher|url|pages|note|short_name|id):\s+(.+)`); /+ bookindex split +/ static bi_main_terms_split = ctRegex!(`\s*;\s*`); static bi_main_term_plus_rest_split = ctRegex!(`\s*:\s*`); diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d index dc19e6c..d6a3b8c 100644 --- a/src/sdp/output_html.d +++ b/src/sdp/output_html.d @@ -112,27 +112,21 @@ template SiSUoutputHTML() { break; case "verse": body_ ~= html_para(obj); - // body_ ~= html_verse(obj); break; case "group": body_ ~= html_para(obj); - // body_ ~= html_group(obj); break; case "block": body_ ~= html_para(obj); - // body_ ~= html_block(obj); break; case "quote": body_ ~= html_para(obj); - // body_ ~= html_quote(obj); break; case "table": body_ ~= html_para(obj); - // body_ ~= html_table(obj); break; case "code": body_ ~= html_para(obj); - // body_ ~= html_code(obj); break; default: body_ ~= html_para(obj); @@ -147,8 +141,6 @@ template SiSUoutputHTML() { auto pth_html = "en/html"; auto pth_seg = pth_html ~ "/" ~ m["fn_base"]; auto pth_html_fn = pth_html ~ "/" ~ fn; - // auto pth_css= "_sisu/css"; - // auto pth_css_fn= pth_css ~ "/html.css"; try { mkdirRecurse(pth_seg); auto f = File(pth_html_fn, "w"); @@ -1456,9 +1448,6 @@ template SiSUoutputHTML() { mkdirRecurse(pth_css); auto f = File(pth_css_fn, "w"); f.writeln(html_css); - // foreach (o; doc) { - // f.writeln(o); - // } } catch (ErrnoException ex) { // Handle error diff --git a/src/sdp/output_hub.d b/src/sdp/output_hub.d index 336e7b3..db508ff 100644 --- a/src/sdp/output_hub.d +++ b/src/sdp/output_hub.d @@ -23,8 +23,6 @@ template SiSUoutputHub() { } if (opt_action_bool["text"]) { writeln("text processing"); - // auto text=SDPoutput_text(); - // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); } if (opt_action_bool["html"]) { mixin SiSUoutputHTML; |