From 1e94e92fef284b4775539456919f20a4b8c082c9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 6 Nov 2016 20:18:32 -0500 Subject: a bit of naming and tidying --- org/ao_abstract_doc_source.org | 197 ++++++++++++++++++--------------------- org/ao_defaults.org | 2 +- src/sdp/ao_abstract_doc_source.d | 193 +++++++++++++++++--------------------- src/sdp/ao_defaults.d | 3 +- 4 files changed, 181 insertions(+), 214 deletions(-) diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 1e5ef1c..4b6adb1 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -44,10 +44,8 @@ mixin InternalMarkup; #+BEGIN_SRC d /+ initialize +/ auto rgx = Rgx(); -ObjComposite[] the_document_head_section; ObjComposite[][string] the_table_of_contents_section; -ObjComposite[] the_document_body_section; -ObjComposite[] the_bibliography_section; +ObjComposite[] the_document_head_section, the_document_body_section, the_bibliography_section; string[string] an_object, processing; string[] anchor_tags; string segment_object_belongs_to; @@ -239,16 +237,16 @@ continue; **** non code objects (other blocks or regular text) [+4] :non_code: -***** within block group [+1] :block:active: -****** within block group: biblio :biblio: +***** in section (biblio, glossary, blurb) (block group) [+1] :block:active: +****** DONE within block group: biblio :biblio: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d if ((matchFirst(line, rgx.heading_biblio) -|| (type["heading_biblio"] == State.on)) +|| (type["biblio_section"] == State.on)) && (!matchFirst(line, rgx.heading)) && (!matchFirst(line, rgx.comment))) { - /+ within block object: biblio +/ + /+ within section (block object): biblio +/ _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); debug(bibliobuild) { writeln("- ", biblio_entry_str_json); @@ -392,9 +390,9 @@ if ((matchFirst(line, rgx.book_index)) debug(comment) { writeln(line); } - an_object["nugget"] ~= line ~= "\n"; + an_object["body_nugget"] ~= line ~= "\n"; the_document_body_section ~= - set_abstract_object.contents_comment(strip(an_object["nugget"])); + set_abstract_object.contents_comment(strip(an_object["body_nugget"])); _common_reset_(line_occur, an_object, type); processing.remove("verse"); ++counter; @@ -447,7 +445,7 @@ if ((matchFirst(line, rgx.book_index)) debug(heading) { // heading writeln(line); } - an_object["nugget"] ~= line ~= "\n"; + an_object["body_nugget"] ~= line ~= "\n"; ++line_occur["heading"]; #+END_SRC @@ -460,7 +458,7 @@ if ((matchFirst(line, rgx.book_index)) debug(para) { writeln(line); } - an_object["nugget"] ~= line; + an_object["body_nugget"] ~= line; ++line_occur["para"]; } } @@ -508,10 +506,10 @@ if ((type["heading"] == State.on) && (line_occur["heading"] > State.off)) { /+ heading object (current line empty) +/ obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "heading"; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa); // tuple this with anchor tags? @@ -540,7 +538,7 @@ if ((type["heading"] == State.on) an_object["is"] ); // heading an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); ++heading_pointer; debug(segments) { writeln(an_object["lev_markup_number"]); @@ -574,10 +572,10 @@ if ((type["heading"] == State.on) } else if ((type["para"] == State.on) && (line_occur["para"] > State.off)) { /+ paragraph object (current line empty) +/ obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "para"; _node = node_construct.node_emitter( @@ -593,7 +591,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_para( an_object["is"], @@ -852,14 +850,14 @@ debug(bookindex) { // bookindex the_document_head_section ~= the_document_body_section[0]; the_document_body_section=the_document_body_section[1..$]; auto document_the = [ - "head": the_document_head_section, - "toc_seg": the_table_of_contents_section["seg"], - "toc_scroll": the_table_of_contents_section["scroll"], - "body": the_document_body_section, - "endnotes_seg": the_endnotes_section["seg"], - "endnotes_scroll": the_endnotes_section["scroll"], - // "glossary": the_glossary_section, // TODO - "bibliography": the_bibliography_section, + "head": the_document_head_section, + "toc_seg": the_table_of_contents_section["seg"], + "toc_scroll": the_table_of_contents_section["scroll"], + "body": the_document_body_section, + "endnotes_seg": the_endnotes_section["seg"], + "endnotes_scroll": the_endnotes_section["scroll"], + // "glossary": the_glossary_section, // TODO + "bibliography": the_bibliography_section, "bookindex_scroll": the_bookindex_section["scroll"], "bookindex_seg": the_bookindex_section["seg"], ]; @@ -895,11 +893,11 @@ functions used in document abstraction #+name: abs_functions_object_reset #+BEGIN_SRC d auto object_reset(ref string[string] an_object) { - an_object.remove("nugget"); + an_object.remove("body_nugget"); an_object.remove("substantive"); an_object.remove("is"); an_object.remove("attrib"); - an_object.remove("bookindex"); + an_object.remove("bookindex_nugget"); } #+END_SRC @@ -1162,7 +1160,7 @@ void _code_block_( debug(code) { // code (curly) line writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // code (curly) line + an_object["body_nugget"] ~= line ~= "\n"; // code (curly) line } } else if (type["tic_code"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1176,7 +1174,7 @@ void _code_block_( debug(code) { // code (tic) line writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // code (tic) line + an_object["body_nugget"] ~= line ~= "\n"; // code (tic) line } } } @@ -1278,7 +1276,7 @@ void _biblio_block_( ref string[] biblio_arr_json ) { if (matchFirst(line, rgx.heading_biblio)) { - type["heading_biblio"] = TriState.on; + type["biblio_section"] = TriState.on; } if (line.empty) { debug { @@ -1405,7 +1403,7 @@ void _poem_block_( ) { if (type["curly_poem"] == TriState.on) { if (matchFirst(line, rgx.block_curly_poem_close)) { - an_object["nugget"]="verse"; // check that this is as you please + an_object["body_nugget"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( "* [poem curly] %s", @@ -1413,7 +1411,7 @@ void _poem_block_( ); } if (processing.length > 0) { - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; } debug(poem) { // poem (curly) close writeln(__LINE__); @@ -1427,7 +1425,7 @@ void _poem_block_( debug(poem) { // poem (curly) close writeln( obj_cite_number, - an_object["nugget"] + an_object["body_nugget"] ); } an_object["is"] = "verse"; @@ -1436,7 +1434,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1465,12 +1463,12 @@ void _poem_block_( } if (type["verse_new"] == State.on) { verse_line=1; - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; debug(poem) { // poem verse writefln( "* %s curly\n%s", obj_cite_number, - an_object["nugget"] + an_object["body_nugget"] ); } processing.remove("verse"); @@ -1488,7 +1486,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1503,7 +1501,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["nugget"]="verse"; // check that this is as you please + an_object["body_nugget"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( "* [poem tic] %s", @@ -1511,7 +1509,7 @@ void _poem_block_( ); } if (processing.length > 0) { // needs looking at - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; } if (an_object.length > 0) { debug(poem) { // poem (tic) close @@ -1525,7 +1523,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1553,12 +1551,12 @@ void _poem_block_( } if (type["verse_new"] == State.on) { verse_line=1; - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; debug(poem) { // poem (tic) close writefln( "* %s tic\n%s", obj_cite_number, - an_object["nugget"] + an_object["body_nugget"] ); } processing.remove("verse"); @@ -1577,7 +1575,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1615,7 +1613,7 @@ void _group_block_( debug(group) { // group writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build group array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build group array (or string) } } else if (type["tic_group"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1629,7 +1627,7 @@ void _group_block_( debug(group) { // group writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build group array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build group array (or string) } } } @@ -1656,7 +1654,7 @@ void _block_block_( debug(block) { // block writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build block array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build block array (or string) } } else if (type["tic_block"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1670,7 +1668,7 @@ void _block_block_( debug(block) { // block writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build block array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build block array (or string) } } } @@ -1697,7 +1695,7 @@ void _quote_block_( debug(quote) { // quote writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build quote array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build quote array (or string) } } else if (type["tic_quote"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1711,7 +1709,7 @@ void _quote_block_( debug(quote) { // quote writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build quote array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build quote array (or string) } } } @@ -1738,7 +1736,7 @@ void _table_block_( debug(table) { // table writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build table array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build table array (or string) } } else if (type["tic_table"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1752,7 +1750,7 @@ void _table_block_( debug(table) { // table writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build table array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build table array (or string) } } } @@ -1787,10 +1785,10 @@ void _block_flag_line_empty_( if (type["code"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "code"; _node = node_construct.node_emitter( @@ -1806,7 +1804,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block_code( an_object["is"], @@ -1820,10 +1818,10 @@ void _block_flag_line_empty_( type["blocks"] = TriState.off; type["code"] = TriState.off; } else if (type["poem"] == TriState.closing) { - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "verse"; // check also _node = node_construct.node_emitter( @@ -1848,10 +1846,10 @@ void _block_flag_line_empty_( } else if (type["table"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "table"; _node = node_construct.node_emitter( @@ -1867,7 +1865,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1883,10 +1881,10 @@ void _block_flag_line_empty_( } else if (type["group"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "group"; _node = node_construct.node_emitter( @@ -1902,7 +1900,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1917,10 +1915,10 @@ void _block_flag_line_empty_( type["group"] = TriState.off; } else if (type["block"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "block"; _node = node_construct.node_emitter( @@ -1936,7 +1934,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1952,10 +1950,10 @@ void _block_flag_line_empty_( } else if (type["quote"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "quote"; _node = node_construct.node_emitter( @@ -1971,7 +1969,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -2006,7 +2004,7 @@ auto _book_index_( to!string(m.captures[1]), ); } - an_object["bookindex"] = to!string(m.captures[1]); + an_object["bookindex_nugget"] = to!string(m.captures[1]); } else if (auto m = match(line, rgx.book_index_open)) { /+ match open book_index +/ type["book_index"] = State.on; @@ -2021,7 +2019,7 @@ auto _book_index_( /+ book_index flag set +/ if (auto m = match(line, rgx.book_index_close)) { type["book_index"] = State.off; - an_object["bookindex"] = book_idx_tmp ~ to!string(m.captures[1]); + an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]); debug(bookindexmatch) { // book index writefln( "* [bookindex] %s\n", @@ -2205,17 +2203,17 @@ auto _heading_matched_( if (auto m = match(line, rgx.heading)) { /+ heading match +/ type["heading"] = State.on; - type["heading_biblio"] = State.off; + type["biblio_section"] = State.off; type["para"] = State.off; ++line_occur["heading"]; - an_object["nugget"] ~= line ~= "\n"; + an_object["body_nugget"] ~= line ~= "\n"; an_object["lev"] ~= m.captures[1]; assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels switch (an_object["lev"]) { case "A": - an_object["nugget"]=replaceFirst(an_object["nugget"], + an_object["body_nugget"]=replaceFirst(an_object["body_nugget"], rgx.variable_doc_title, (dochead_meta_aa["title"]["full"] ~ ",")); - an_object["nugget"]=replaceFirst(an_object["nugget"], + an_object["body_nugget"]=replaceFirst(an_object["body_nugget"], rgx.variable_doc_author, dochead_meta_aa["creator"]["author"]); collapsed_lev["h0"] = 1; an_object["lev_collapsed_number"] = @@ -2343,60 +2341,45 @@ auto _para_match_( ref string[string] indent, ref bool bullet, ref int[string] type, - ref int[string] line_occur + ref int[string] line_occur, ) { if (line_occur["para"] == State.off) { /+ para matches +/ + type["para"] = State.on; + an_object["body_nugget"] ~= line; + indent=[ + "hang_position" : "0", + "base_position" : "0", + ]; + bullet = false; if (auto m = matchFirst(line, rgx.para_indent)) { debug(paraindent) { // para indent writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line ~= "\n"; // is newline needed? indent["hang_position"] = to!string(m.captures[1]); indent["base_position"] = "0"; - bullet = false; } else if (matchFirst(line, rgx.para_bullet)) { debug(parabullet) { // para bullet writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line; - indent=[ - "hang_position" : "0", - "base_position" : "0", - ]; bullet = true; } else if (auto m = matchFirst(line, rgx.para_indent_hang)) { debug(paraindenthang) { // para indent hang writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line; indent=[ "hang_position" : to!string(m.captures[1]), "base_position" : to!string(m.captures[2]), ]; - bullet = false; } else if (auto m = matchFirst(line, rgx.para_bullet_indent)) { debug(parabulletindent) { // para bullet indent writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line; indent=[ "hang_position" : to!string(m.captures[1]), "base_position" : "0", ]; bullet = true; - } else { - type["para"] = State.on; - an_object["nugget"] ~= line; - indent=[ - "hang_position" : "0", - "base_position" : "0", - ]; - bullet = false; } ++line_occur["para"]; } @@ -2616,7 +2599,7 @@ struct ObjInlineMarkup { ) in { } body { - obj_txt["munge"]=obj_["nugget"].dup; + obj_txt["munge"]=obj_["body_nugget"].dup; obj_txt["munge"]=(match(obj_["is"], ctRegex!(`verse|code`))) ? obj_txt["munge"] : strip(obj_txt["munge"]); @@ -2696,7 +2679,7 @@ struct ObjInlineMarkup { ) in { } body { - char[] heading_toc_ = to!(char[])(obj_["nugget"].dup.strip); + char[] heading_toc_ = to!(char[])(obj_["body_nugget"].dup.strip); heading_toc_ = _clean_heading_toc_(heading_toc_); auto attrib=""; string toc_txt_; diff --git a/org/ao_defaults.org b/org/ao_defaults.org index b7a59a1..17d04b8 100644 --- a/org/ao_defaults.org +++ b/org/ao_defaults.org @@ -356,7 +356,7 @@ template SiSUrgxInitFlags() { "header_make" : 0, "header_meta" : 0, "heading" : 0, - "heading_biblio" : 0, + "biblio_section" : 0, "para" : 0, "blocks" : 0, // 0..2 generic "code" : 0, // 0..2 diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 769d93c..8d2ff70 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -17,10 +17,8 @@ template SiSUdocAbstraction() { /+ ↓ abstraction struct init +/ /+ initialize +/ auto rgx = Rgx(); - ObjComposite[] the_document_head_section; ObjComposite[][string] the_table_of_contents_section; - ObjComposite[] the_document_body_section; - ObjComposite[] the_bibliography_section; + ObjComposite[] the_document_head_section, the_document_body_section, the_bibliography_section; string[string] an_object, processing; string[] anchor_tags; string segment_object_belongs_to; @@ -193,10 +191,10 @@ template SiSUdocAbstraction() { /+ object other than "code block" object (includes regular text paragraph, headings & blocks other than code) +/ if ((matchFirst(line, rgx.heading_biblio) - || (type["heading_biblio"] == State.on)) + || (type["biblio_section"] == State.on)) && (!matchFirst(line, rgx.heading)) && (!matchFirst(line, rgx.comment))) { - /+ within block object: biblio +/ + /+ within section (block object): biblio +/ _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); debug(bibliobuild) { writeln("- ", biblio_entry_str_json); @@ -277,9 +275,9 @@ template SiSUdocAbstraction() { debug(comment) { writeln(line); } - an_object["nugget"] ~= line ~= "\n"; + an_object["body_nugget"] ~= line ~= "\n"; the_document_body_section ~= - set_abstract_object.contents_comment(strip(an_object["nugget"])); + set_abstract_object.contents_comment(strip(an_object["body_nugget"])); _common_reset_(line_occur, an_object, type); processing.remove("verse"); ++counter; @@ -320,14 +318,14 @@ template SiSUdocAbstraction() { debug(heading) { // heading writeln(line); } - an_object["nugget"] ~= line ~= "\n"; + an_object["body_nugget"] ~= line ~= "\n"; ++line_occur["heading"]; } else if (line_occur["para"] > State.off) { /+ paragraph +/ debug(para) { writeln(line); } - an_object["nugget"] ~= line; + an_object["body_nugget"] ~= line; ++line_occur["para"]; } } @@ -360,10 +358,10 @@ template SiSUdocAbstraction() { && (line_occur["heading"] > State.off)) { /+ heading object (current line empty) +/ obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "heading"; auto substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa); // tuple this with anchor tags? @@ -392,7 +390,7 @@ template SiSUdocAbstraction() { an_object["is"] ); // heading an_object["attrib"] = - obj_att.obj_attributes(an_object["is"], an_object["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); ++heading_pointer; debug(segments) { writeln(an_object["lev_markup_number"]); @@ -420,10 +418,10 @@ template SiSUdocAbstraction() { } else if ((type["para"] == State.on) && (line_occur["para"] > State.off)) { /+ paragraph object (current line empty) +/ obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "para"; _node = node_construct.node_emitter( @@ -439,7 +437,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_para( an_object["is"], @@ -609,14 +607,14 @@ template SiSUdocAbstraction() { the_document_head_section ~= the_document_body_section[0]; the_document_body_section=the_document_body_section[1..$]; auto document_the = [ - "head": the_document_head_section, - "toc_seg": the_table_of_contents_section["seg"], - "toc_scroll": the_table_of_contents_section["scroll"], - "body": the_document_body_section, - "endnotes_seg": the_endnotes_section["seg"], - "endnotes_scroll": the_endnotes_section["scroll"], - // "glossary": the_glossary_section, // TODO - "bibliography": the_bibliography_section, + "head": the_document_head_section, + "toc_seg": the_table_of_contents_section["seg"], + "toc_scroll": the_table_of_contents_section["scroll"], + "body": the_document_body_section, + "endnotes_seg": the_endnotes_section["seg"], + "endnotes_scroll": the_endnotes_section["scroll"], + // "glossary": the_glossary_section, // TODO + "bibliography": the_bibliography_section, "bookindex_scroll": the_bookindex_section["scroll"], "bookindex_seg": the_bookindex_section["seg"], ]; @@ -630,11 +628,11 @@ template SiSUdocAbstraction() { } /+ ← closed: abstract doc source +/ /+ ↓ abstraction functions +/ auto object_reset(ref string[string] an_object) { - an_object.remove("nugget"); + an_object.remove("body_nugget"); an_object.remove("substantive"); an_object.remove("is"); an_object.remove("attrib"); - an_object.remove("bookindex"); + an_object.remove("bookindex_nugget"); } auto _common_reset_( ref int[string] line_occur, @@ -852,7 +850,7 @@ template SiSUdocAbstraction() { debug(code) { // code (curly) line writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // code (curly) line + an_object["body_nugget"] ~= line ~= "\n"; // code (curly) line } } else if (type["tic_code"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -866,7 +864,7 @@ template SiSUdocAbstraction() { debug(code) { // code (tic) line writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // code (tic) line + an_object["body_nugget"] ~= line ~= "\n"; // code (tic) line } } } @@ -897,7 +895,7 @@ template SiSUdocAbstraction() { ref string[] biblio_arr_json ) { if (matchFirst(line, rgx.heading_biblio)) { - type["heading_biblio"] = TriState.on; + type["biblio_section"] = TriState.on; } if (line.empty) { debug { @@ -1016,7 +1014,7 @@ template SiSUdocAbstraction() { ) { if (type["curly_poem"] == TriState.on) { if (matchFirst(line, rgx.block_curly_poem_close)) { - an_object["nugget"]="verse"; // check that this is as you please + an_object["body_nugget"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( "* [poem curly] %s", @@ -1024,7 +1022,7 @@ template SiSUdocAbstraction() { ); } if (processing.length > 0) { - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; } debug(poem) { // poem (curly) close writeln(__LINE__); @@ -1038,7 +1036,7 @@ template SiSUdocAbstraction() { debug(poem) { // poem (curly) close writeln( obj_cite_number, - an_object["nugget"] + an_object["body_nugget"] ); } an_object["is"] = "verse"; @@ -1047,7 +1045,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1076,12 +1074,12 @@ template SiSUdocAbstraction() { } if (type["verse_new"] == State.on) { verse_line=1; - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; debug(poem) { // poem verse writefln( "* %s curly\n%s", obj_cite_number, - an_object["nugget"] + an_object["body_nugget"] ); } processing.remove("verse"); @@ -1099,7 +1097,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1114,7 +1112,7 @@ template SiSUdocAbstraction() { } } else if (type["tic_poem"] == TriState.on) { if (auto m = matchFirst(line, rgx.block_tic_close)) { // tic_poem_close - an_object["nugget"]="verse"; // check that this is as you please + an_object["body_nugget"]="verse"; // check that this is as you please debug(poem) { // poem (curly) close writefln( "* [poem tic] %s", @@ -1122,7 +1120,7 @@ template SiSUdocAbstraction() { ); } if (processing.length > 0) { // needs looking at - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; } if (an_object.length > 0) { debug(poem) { // poem (tic) close @@ -1136,7 +1134,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1164,12 +1162,12 @@ template SiSUdocAbstraction() { } if (type["verse_new"] == State.on) { verse_line=1; - an_object["nugget"] = processing["verse"]; + an_object["body_nugget"] = processing["verse"]; debug(poem) { // poem (tic) close writefln( "* %s tic\n%s", obj_cite_number, - an_object["nugget"] + an_object["body_nugget"] ); } processing.remove("verse"); @@ -1188,7 +1186,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1220,7 +1218,7 @@ template SiSUdocAbstraction() { debug(group) { // group writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build group array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build group array (or string) } } else if (type["tic_group"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1234,7 +1232,7 @@ template SiSUdocAbstraction() { debug(group) { // group writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build group array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build group array (or string) } } } @@ -1255,7 +1253,7 @@ template SiSUdocAbstraction() { debug(block) { // block writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build block array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build block array (or string) } } else if (type["tic_block"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1269,7 +1267,7 @@ template SiSUdocAbstraction() { debug(block) { // block writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build block array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build block array (or string) } } } @@ -1290,7 +1288,7 @@ template SiSUdocAbstraction() { debug(quote) { // quote writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build quote array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build quote array (or string) } } else if (type["tic_quote"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1304,7 +1302,7 @@ template SiSUdocAbstraction() { debug(quote) { // quote writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build quote array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build quote array (or string) } } } @@ -1325,7 +1323,7 @@ template SiSUdocAbstraction() { debug(table) { // table writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build table array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build table array (or string) } } else if (type["tic_table"] == TriState.on) { if (matchFirst(line, rgx.block_tic_close)) { @@ -1339,7 +1337,7 @@ template SiSUdocAbstraction() { debug(table) { // table writeln(line); } - an_object["nugget"] ~= line ~= "\n"; // build table array (or string) + an_object["body_nugget"] ~= line ~= "\n"; // build table array (or string) } } } @@ -1368,10 +1366,10 @@ template SiSUdocAbstraction() { if (type["code"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "code"; _node = node_construct.node_emitter( @@ -1387,7 +1385,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block_code( an_object["is"], @@ -1401,10 +1399,10 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.off; type["code"] = TriState.off; } else if (type["poem"] == TriState.closing) { - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "verse"; // check also _node = node_construct.node_emitter( @@ -1429,10 +1427,10 @@ template SiSUdocAbstraction() { } else if (type["table"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "table"; _node = node_construct.node_emitter( @@ -1448,7 +1446,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1464,10 +1462,10 @@ template SiSUdocAbstraction() { } else if (type["group"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "group"; _node = node_construct.node_emitter( @@ -1483,7 +1481,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1498,10 +1496,10 @@ template SiSUdocAbstraction() { type["group"] = TriState.off; } else if (type["block"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "block"; _node = node_construct.node_emitter( @@ -1517,7 +1515,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1533,10 +1531,10 @@ template SiSUdocAbstraction() { } else if (type["quote"] == TriState.closing) { obj_cite_number = obj_cite_number_emit(type["obj_cite_number_status"]); - an_object["bookindex"] = - ("bookindex" in an_object) ? an_object["bookindex"] : ""; + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bkidx_hash(an_object["bookindex"], obj_cite_number); + bkidx_hash(an_object["bookindex_nugget"], obj_cite_number); an_object["is"] = "quote"; _node = node_construct.node_emitter( @@ -1552,7 +1550,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["nugget"], _node); + obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node); the_document_body_section ~= set_abstract_object.contents_block( an_object["is"], @@ -1581,7 +1579,7 @@ template SiSUdocAbstraction() { to!string(m.captures[1]), ); } - an_object["bookindex"] = to!string(m.captures[1]); + an_object["bookindex_nugget"] = to!string(m.captures[1]); } else if (auto m = match(line, rgx.book_index_open)) { /+ match open book_index +/ type["book_index"] = State.on; @@ -1596,7 +1594,7 @@ template SiSUdocAbstraction() { /+ book_index flag set +/ if (auto m = match(line, rgx.book_index_close)) { type["book_index"] = State.off; - an_object["bookindex"] = book_idx_tmp ~ to!string(m.captures[1]); + an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]); debug(bookindexmatch) { // book index writefln( "* [bookindex] %s\n", @@ -1761,17 +1759,17 @@ template SiSUdocAbstraction() { if (auto m = match(line, rgx.heading)) { /+ heading match +/ type["heading"] = State.on; - type["heading_biblio"] = State.off; + type["biblio_section"] = State.off; type["para"] = State.off; ++line_occur["heading"]; - an_object["nugget"] ~= line ~= "\n"; + an_object["body_nugget"] ~= line ~= "\n"; an_object["lev"] ~= m.captures[1]; assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels switch (an_object["lev"]) { case "A": - an_object["nugget"]=replaceFirst(an_object["nugget"], + an_object["body_nugget"]=replaceFirst(an_object["body_nugget"], rgx.variable_doc_title, (dochead_meta_aa["title"]["full"] ~ ",")); - an_object["nugget"]=replaceFirst(an_object["nugget"], + an_object["body_nugget"]=replaceFirst(an_object["body_nugget"], rgx.variable_doc_author, dochead_meta_aa["creator"]["author"]); collapsed_lev["h0"] = 1; an_object["lev_collapsed_number"] = @@ -1893,60 +1891,45 @@ template SiSUdocAbstraction() { ref string[string] indent, ref bool bullet, ref int[string] type, - ref int[string] line_occur + ref int[string] line_occur, ) { if (line_occur["para"] == State.off) { /+ para matches +/ + type["para"] = State.on; + an_object["body_nugget"] ~= line; + indent=[ + "hang_position" : "0", + "base_position" : "0", + ]; + bullet = false; if (auto m = matchFirst(line, rgx.para_indent)) { debug(paraindent) { // para indent writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line ~= "\n"; // is newline needed? indent["hang_position"] = to!string(m.captures[1]); indent["base_position"] = "0"; - bullet = false; } else if (matchFirst(line, rgx.para_bullet)) { debug(parabullet) { // para bullet writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line; - indent=[ - "hang_position" : "0", - "base_position" : "0", - ]; bullet = true; } else if (auto m = matchFirst(line, rgx.para_indent_hang)) { debug(paraindenthang) { // para indent hang writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line; indent=[ "hang_position" : to!string(m.captures[1]), "base_position" : to!string(m.captures[2]), ]; - bullet = false; } else if (auto m = matchFirst(line, rgx.para_bullet_indent)) { debug(parabulletindent) { // para bullet indent writeln(line); } - type["para"] = State.on; - an_object["nugget"] ~= line; indent=[ "hang_position" : to!string(m.captures[1]), "base_position" : "0", ]; bullet = true; - } else { - type["para"] = State.on; - an_object["nugget"] ~= line; - indent=[ - "hang_position" : "0", - "base_position" : "0", - ]; - bullet = false; } ++line_occur["para"]; } @@ -2141,7 +2124,7 @@ template SiSUdocAbstraction() { ) in { } body { - obj_txt["munge"]=obj_["nugget"].dup; + obj_txt["munge"]=obj_["body_nugget"].dup; obj_txt["munge"]=(match(obj_["is"], ctRegex!(`verse|code`))) ? obj_txt["munge"] : strip(obj_txt["munge"]); @@ -2215,7 +2198,7 @@ template SiSUdocAbstraction() { ) in { } body { - char[] heading_toc_ = to!(char[])(obj_["nugget"].dup.strip); + char[] heading_toc_ = to!(char[])(obj_["body_nugget"].dup.strip); heading_toc_ = _clean_heading_toc_(heading_toc_); auto attrib=""; string toc_txt_; diff --git a/src/sdp/ao_defaults.d b/src/sdp/ao_defaults.d index 3cdd265..a53b827 100644 --- a/src/sdp/ao_defaults.d +++ b/src/sdp/ao_defaults.d @@ -319,7 +319,8 @@ template SiSUrgxInitFlags() { "header_make" : 0, "header_meta" : 0, "heading" : 0, - "heading_biblio" : 0, + "biblio_section" : 0, + // "glossary_section" : 0, // TODO "para" : 0, "blocks" : 0, // 0..2 generic "code" : 0, // 0..2 -- cgit v1.2.3