From 9cf470e69b2d579701ee607f796de612dc600565 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 20 Apr 2017 13:57:03 -0400 Subject: 0.14.0 reorganized files, and paths --- src/sdp/ao_abstract_doc_source.d | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'src/sdp/ao_abstract_doc_source.d') diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 24fcd48..f7eca53 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -363,8 +363,9 @@ template SiSUdocAbstraction() { ); } line = (line).replaceAll(rgx.true_dollar, "$$$$"); - // dollar represented as $$ needed to stop submatching on $ - // (substitutions using ${identifiers} must take into account (i.e. happen earlier)) + /+ dollar represented as $$ needed to stop submatching on $ + (substitutions using ${identifiers} must take into account (i.e. happen earlier)) + +/ debug(source) { // source lines writeln(line); } @@ -414,7 +415,6 @@ template SiSUdocAbstraction() { writeln(__LINE__); writeln(line); } - // _glossary_block_(line, type); type["glossary_section"] = State.on; type["biblio_section"] = State.off; type["blurb_section"] = State.off; @@ -618,7 +618,6 @@ template SiSUdocAbstraction() { "code block status: none or closed" ); if (type["blocks"] == TriState.closing) { - // blocks closed, unless followed by book index debug(check) { // block writeln(__LINE__); writeln(line); @@ -668,14 +667,13 @@ template SiSUdocAbstraction() { && ((type["para"] == State.off) && (type["heading"] == State.off))) { /+ heading make set +/ - _heading_make_set_(line, line_occur, heading_match_rgx, type); + line = _heading_make_set_(line, line_occur, heading_match_rgx, type); } /+ TODO node info: all headings identified at this point, - extract node info here?? - how long can it wait? - should be incorporated in composite objects - should happen before endnote links set (they need to be moved down?) - // node_construct.node_emitter_heading segment anchor tag +/ if (line.matchFirst(rgx.heading)) { /+ heading match +/ @@ -791,7 +789,6 @@ template SiSUdocAbstraction() { writeln(segment_anchor_tag_that_object_belongs_to); } the_document_body_section ~= comp_obj_heading; - // track previous heading and make assertions debug(objectrelated1) { // check writeln(line); } @@ -850,7 +847,6 @@ template SiSUdocAbstraction() { line == null, "line variable should be empty, should not occur" ); - // check what happens when paragraph separated by 2 newlines } } // close else for line empty } // close else for not the above @@ -959,7 +955,6 @@ template SiSUdocAbstraction() { comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; the_bibliography_section ~= comp_obj_heading_; - // --- comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; comp_obj_heading_.is_of = "para"; @@ -1454,7 +1449,6 @@ template SiSUdocAbstraction() { foreach (ref obj; the_bookindex_section["scroll"]) { if (obj.is_a == "heading") { debug(dom) { - // writeln(obj.text); } if (obj.heading_lev_markup == 4) { obj.segname_prev = html_segnames[obj.ptr_html_segnames - 1]; @@ -1540,7 +1534,6 @@ template SiSUdocAbstraction() { comp_obj_heading_.use = "empty"; comp_obj_heading_.is_of = "para"; comp_obj_heading_.is_a = "heading"; - // comp_obj_heading_.text = "(skip) this is the DOM tail"; comp_obj_heading_.ocn = 0; comp_obj_para.obj_cite_number = ""; comp_obj_heading_.segment_anchor_tag = ""; @@ -1892,6 +1885,7 @@ template SiSUdocAbstraction() { debug(quote) { // quote (curly) close writeln(line); } + an_object[an_object_key] = an_object[an_object_key].stripRight; type["blocks"] = TriState.closing; type["quote"] = TriState.closing; type["curly_quote"] = TriState.off; @@ -1906,6 +1900,7 @@ template SiSUdocAbstraction() { debug(quote) { // quote (tic) close writeln(line); } + an_object[an_object_key] = an_object[an_object_key].stripRight; type["blocks"] = TriState.closing; type["quote"] = TriState.closing; type["tic_quote"] = TriState.off; @@ -1933,6 +1928,7 @@ template SiSUdocAbstraction() { debug(group) { writeln(line); } + an_object[an_object_key] = an_object[an_object_key].stripRight; type["blocks"] = TriState.closing; type["group"] = TriState.closing; type["curly_group"] = TriState.off; @@ -1947,6 +1943,7 @@ template SiSUdocAbstraction() { debug(group) { writeln(line); } + an_object[an_object_key] = an_object[an_object_key].stripRight; type["blocks"] = TriState.closing; type["group"] = TriState.closing; type["tic_group"] = TriState.off; @@ -1974,6 +1971,7 @@ template SiSUdocAbstraction() { debug(block) { // block (curly) close writeln(line); } + an_object[an_object_key] = an_object[an_object_key].stripRight; type["blocks"] = TriState.closing; type["block"] = TriState.closing; type["curly_block"] = TriState.off; @@ -1988,6 +1986,7 @@ template SiSUdocAbstraction() { debug(block) { writeln(line); } + an_object[an_object_key] = an_object[an_object_key].stripRight; type["blocks"] = TriState.closing; type["block"] = TriState.closing; type["tic_block"] = TriState.off; @@ -2078,6 +2077,7 @@ template SiSUdocAbstraction() { ocn_emit(type["ocn_status"]); type["verse_new"] = State.off; } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) { + processing["verse"] = processing["verse"].stripRight; verse_line = TriState.off; type["verse_new"] = State.on; } @@ -2170,6 +2170,7 @@ template SiSUdocAbstraction() { ocn_emit(type["ocn_status"]); type["verse_new"] = State.off; } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) { + processing["verse"] = processing["verse"].stripRight; type["verse_new"] = State.on; verse_line = TriState.off; } @@ -2232,6 +2233,9 @@ template SiSUdocAbstraction() { debug(code) { // code (curly) close writeln(line); } + an_object[an_object_key] = an_object[an_object_key] + .replaceFirst(rgx.newline_eol_delimiter_only, "") + .stripRight; type["blocks"] = TriState.closing; type["code"] = TriState.closing; type["curly_code"] = TriState.off; @@ -2246,6 +2250,9 @@ template SiSUdocAbstraction() { debug(code) { // code (tic) close writeln(line); } + an_object[an_object_key] = an_object[an_object_key] + .replaceFirst(rgx.newline_eol_delimiter_only, "") + .stripRight; type["blocks"] = TriState.closing; type["code"] = TriState.closing; type["tic_code"] = TriState.off; @@ -2464,7 +2471,6 @@ template SiSUdocAbstraction() { header_tag_value=""; } } - // void _table_closed_make_special_notation_table_( char[] line, return ref string[string] an_object, @@ -2513,7 +2519,6 @@ template SiSUdocAbstraction() { string[string] obj_cite_number_poem, string[string][string] dochead_make_aa, ) { - // line.empty, post contents, empty variables --------------- assert( line.empty, "line should be empty" @@ -2966,6 +2971,7 @@ template SiSUdocAbstraction() { } } } + return line; } auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( return ref L line, @@ -3748,7 +3754,6 @@ template SiSUdocAbstraction() { switch (obj_["is"]) { case "heading": static __gshared string anchor_tag = ""; - // TODO WORK ON, you still need to ensure that level 1 anchor_tags are unique obj_txt["munge"]=_configured_auto_heading_numbering_and_segment_anchor_tags(obj_txt["munge"], obj_, dochead_make_aa); obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"]); if (auto m = obj_txt["munge"].match(rgx.heading_anchor_tag)) { @@ -4955,9 +4960,10 @@ template SiSUdocAbstraction() { static assert(is(typeof(bib_arr_json) == JSONValue[])); } foreach (bibent; biblio_unordered) { - // update bib to include deemed_author, needed for: - // sort_bibliography_array_by_deemed_author_year_title - // either: sort on multiple fields, or; create such sort field + /+ update bib to include deemed_author, needed for: + sort_bibliography_array_by_deemed_author_year_title + either: sort on multiple fields, or; create such sort field + +/ JSONValue j = parseJSON(bibent); if (!empty(j["fulltitle"].str)) { if (!empty(j["author_raw"].str)) { -- cgit v1.2.3