diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-03-14 12:25:23 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 1eba4830ee85784dfe44e56be9508151349b7e4e (patch) | |
tree | f66b538b5539eba10155e2a627f625f06a000a59 /org/ao_doc_abstraction.org | |
parent | work on outputs (diff) |
org files minor touches
Diffstat (limited to 'org/ao_doc_abstraction.org')
-rw-r--r-- | org/ao_doc_abstraction.org | 922 |
1 files changed, 534 insertions, 388 deletions
diff --git a/org/ao_doc_abstraction.org b/org/ao_doc_abstraction.org index 0074e1c..2188e94 100644 --- a/org/ao_doc_abstraction.org +++ b/org/ao_doc_abstraction.org @@ -13,6 +13,79 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] +* 0. the document notes +** document sections + +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| front matter | head | | | | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| toc | toc | | | generated: headings | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| body | body | | | default section | | | | +| | | | | - heading | | | | +| | | | | - para | | | | +| | | | | - code | | | | +| | | | | - poem | | | | +| | | | | - group | | | | +| | | | | - block | | | | +| | | | | - quote | | | | +| | | | | - table | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| back matter | endnote | | | generated: inline note markup | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| | glossary | | | identified section, limited markup | | | | +| | | | | - the heading | | | | +| | | | | - paragraph | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| | bibliography | | | generated from inline special markup | | | | +| | | | | appended to paragraphs contained in body section | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| +| | blurb | | | identified section, limited markup | | | | +| | | | | - the heading | | | | +| | | | | - paragraphs | | | | +|--------------+--------------+---+---+--------------------------------------------------+---+---+---| + +** objects + +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | | identified by | object notes | attributes | inline | embedded | special | +| | | | | | | appended | characters | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| para | heading | level markers | | | - italics | - endnotes | | +| | | at start of line | | | | - bibliography | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | paragraph | delimited by two new lines | default object | - indent | - bold | - endnotes | | +| | | | [discard leading & | - bullet | - italics | - bibliography | | +| | | | newline whitespace] | | - underscore | | | +| | | | | | - strikethrough | | | +| | | | | | - superscript | | | +| | | | | | - subscript | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| block | | open and close tags | | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| TODO | quote | | | - language? | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| TODO | group | | - inline markup applied | - language? | as paragraph | - endnotes | | +| | | | - [discard leading & | | | - bibliography | | +| | | | newline whitespace] | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| TODO | block | | - inline markup applied | | as paragraph | - endnotes | | +| | | | - whitespace indentation | | | - bibliography | | +| | | | & newlines | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | poem / verse | open and close tags | verse is the object | | | - endnotes | | +| | | | - inline markup applied | | | - bibliography | | +| | | (for poem) | - whitespace indentation | | | | | +| | | | & newlines | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | code | | - contents untouched | - syntax | | | | +| | | | - whitespace indentation | - numbered | | | | +| | | | & newlines | | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| +| | table | | | - column width | | | | +| | | | | - heading row | | | | +|-------+--------------+----------------------------+--------------------------+----------------+-----------------+----------------+------------| + * 1. Document Abstraction :abstract:process: Process markup document, create document abstraction. @@ -39,7 +112,7 @@ template SiSUdocAbstraction() { Opt opt_action_bool, ) { auto rgx = Rgx(); - debug(asserts){ + debug(asserts) { static assert(is(typeof(markup_sourcefile_content) == char[][])); static assert(is(typeof(dochead_make_aa) == string[string][string])); static assert(is(typeof(dochead_meta_aa) == string[string][string])); @@ -58,6 +131,7 @@ template SiSUdocAbstraction() { } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { /+ object other than "code block" object (includes regular text paragraph, headings & blocks other than code) +/ + /+ heading, glossary, blurb, poem, group, block, quote, table +/ <<abs_in_loop_body_non_code_obj>> } else { /+ not within a block group +/ @@ -91,9 +165,9 @@ template SiSUdocAbstraction() { <<abs_functions_block_code>> <<abs_functions_block_biblio>> // <<abs_functions_block_glossary>> - <<abs_functions_block_poem>> <<abs_functions_block_group>> <<abs_functions_block_block>> + <<abs_functions_block_poem>> <<abs_functions_block_quote>> <<abs_functions_block_table>> <<abs_functions_block_line_status_empty>> @@ -135,7 +209,7 @@ template SiSUdocAbstraction() { } /+ ← closed: template SiSUdocAbstraction +/ #+END_SRC -** 1. _pre loop processing_ :pre: +** 1. _pre loop processing_ :pre: *** imports :imports: [[./ao_defaults.org][ao_defaults]] @@ -516,7 +590,7 @@ string[][string] lev4_subtoc; string[] html_segnames=["toc"]; #+END_SRC -** 2. _loop: process document body_ [+6] :loop: +** 2. _loop: process document body_ [+6] :loop: *** loop scope :scope: #+name: abs_in_loop_body_00 @@ -558,7 +632,7 @@ if (!line.empty) { #+END_SRC *** [#A] separate _code blocks_ from _other markup text_ [+5] -**** code blocks :block:code: +**** _code blocks_ :block:code: #+name: abs_in_loop_body_00_code_block #+BEGIN_SRC d @@ -567,9 +641,9 @@ _code_block_(line, an_object, type); continue; #+END_SRC -**** non code objects (other blocks or regular text) [+4] :non_code: +**** _non code objects_ (other blocks or regular text) [+4] :non_code: ***** in section (biblio, glossary, blurb) +(block group)+ [+1] :block:active: -****** within section: biblio :biblio: +****** in section: biblio :biblio: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d @@ -592,7 +666,7 @@ if ((matchFirst(line, rgx.heading_biblio) continue; #+END_SRC -****** within section: glossary :glossary: +****** in section: glossary :glossary: if there is a glossary section you need to: - extract it @@ -674,7 +748,7 @@ if there is a glossary section you need to: continue; #+END_SRC -****** within section: blurb :blurb: +****** in section: blurb :blurb: if there is a blurb section you need to: - extract it @@ -772,17 +846,7 @@ if there is a blurb section you need to: #+END_SRC ***** in blocks [+1] :block:active: -****** within block: poem :poem: - -#+name: abs_in_loop_body_non_code_obj -#+BEGIN_SRC d -} else if (type["poem"] == TriState.on) { - /+ within block object: poem +/ - _poem_block_(line, an_object, type, cntr, obj_cite_number_poem, dochead_make_aa); - continue; -#+END_SRC - -****** within block: group :group: +****** in block: group :group: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d @@ -793,7 +857,7 @@ if there is a blurb section you need to: continue; #+END_SRC -****** within block: block :block: +****** in block: block :block: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d @@ -803,7 +867,17 @@ if there is a blurb section you need to: continue; #+END_SRC -****** within block: quote :quote: +****** in block: poem :poem: + +#+name: abs_in_loop_body_non_code_obj +#+BEGIN_SRC d +} else if (type["poem"] == TriState.on) { + /+ within block object: poem +/ + _poem_block_(line, an_object, type, cntr, obj_cite_number_poem, dochead_make_aa); + continue; +#+END_SRC + +****** in block: quote :quote: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d @@ -813,7 +887,7 @@ if there is a blurb section you need to: continue; #+END_SRC -****** within block: table :table: +****** in block: table :table: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d @@ -836,7 +910,7 @@ assert( assertions_flag_types_block_status_none_or_closed(type); #+END_SRC -****** block open +****** catch misc +block open+ #+name: abs_in_loop_body_open_block_obj #+BEGIN_SRC d @@ -1104,7 +1178,8 @@ if ((type["heading"] == State.on) #+name: abs_in_loop_body_not_block_obj_line_empty #+BEGIN_SRC d -} else if ((type["para"] == State.on) && (line_occur["para"] > State.off)) { +} else if ((type["para"] == State.on) +&& (line_occur["para"] > State.off)) { /+ paragraph object (current line empty) +/ obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = @@ -1164,10 +1239,9 @@ if ((type["heading"] == State.on) /+ unless (the_document_body_section.length == 0) ? +/ if (the_document_body_section.length > 0) { if (((the_document_body_section[$-1].is_a == "para") - || (the_document_body_section[$-1].is_a == "heading") - || (the_document_body_section[$-1].is_a == "group")) - && (the_document_body_section.length > previous_length) -) { + || (the_document_body_section[$-1].is_a == "heading") + || (the_document_body_section[$-1].is_a == "group")) + && (the_document_body_section.length > previous_length)) { if ((the_document_body_section[$-1].is_a == "heading") && (the_document_body_section[$-1].heading_lev_markup < 5)) { type["biblio_section"] = State.off; @@ -1191,6 +1265,8 @@ if (the_document_body_section.length > 0) { #+END_SRC ** 3. _post main-loop processing_ :post: +*** misc + /+ Backmatter: - endnotes @@ -1585,7 +1661,7 @@ the_document_head_section ~= the_document_body_section[0]; the_document_body_section=the_document_body_section[1..$]; #+END_SRC -*** TODO minor loops :post: +*** minor loops :post: **** 1. loop: backmatter loop up to lev4: html_segnames, set backmatter pointers could optimise by @@ -1978,8 +2054,8 @@ if (the_blurb_section.length > 1) { } #+END_SRC -** 4. _return document tuple_ :post: -*** _the document_ :document: +** 4. _return document tuple_ :post: +*** _the document_ :document: #+name: abs_post #+BEGIN_SRC d @@ -2097,7 +2173,7 @@ functions used in document abstraction #+name: abs_functions_object_reset #+BEGIN_SRC d auto object_reset(O)(ref O an_object) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(an_object) == string[string])); } an_object.remove("body_nugget"); @@ -2117,7 +2193,7 @@ auto _common_reset_(L,O,T)( return ref O an_object, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line_occur) == int[string])); static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(type) == int[string])); @@ -2138,7 +2214,7 @@ void _check_ocn_status_(L,T)( L line, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(type) == int[string])); } @@ -2187,7 +2263,7 @@ void _check_ocn_status_(L,T)( *** block :block: **** block start (open) block :start: -***** function open for block starts +***** { block starts function #+name: abs_functions_block #+BEGIN_SRC d @@ -2196,7 +2272,7 @@ void _start_block_(L,T,N)( return ref T type, N obj_cite_number_poem ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(type) == int[string])); static assert(is(typeof(obj_cite_number_poem) == string[string])); @@ -2274,8 +2350,8 @@ void _start_block_(L,T,N)( line ); } - type["blocks"] = TriState.on; - type["table"] = TriState.on; + type["blocks"] = TriState.on; + type["table"] = TriState.on; type["curly_table"] = TriState.on; #+END_SRC @@ -2348,13 +2424,13 @@ void _start_block_(L,T,N)( line ); } - type["blocks"] = TriState.on; - type["table"] = TriState.on; + type["blocks"] = TriState.on; + type["table"] = TriState.on; type["tic_table"] = TriState.on; } #+END_SRC -***** function close for block starts +***** } #+name: abs_functions_block #+BEGIN_SRC d @@ -2362,7 +2438,7 @@ void _start_block_(L,T,N)( #+END_SRC **** block continue (an open block) :continue: -***** code block (special status, deal with first) :code: +***** _code block_ (special status, deal with first) :code: #+name: abs_functions_block_code #+BEGIN_SRC d @@ -2371,7 +2447,7 @@ void _code_block_(L,O,T)( return ref O an_object, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(type) == int[string])); @@ -2415,7 +2491,7 @@ void _code_block_(L,O,T)( #+name: abs_functions_block_biblio #+BEGIN_SRC d final string biblio_tag_map(A)(A abr) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(abr) == string)); } auto btm = [ @@ -2443,7 +2519,7 @@ final string biblio_tag_map(A)(A abr) { #+name: none #+BEGIN_SRC d final string biblio_tag_map_(A)(A abr) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(abr) == string)); } string name; @@ -2626,7 +2702,101 @@ void _biblio_block_( } #+END_SRC -***** TODO poem block, verse objects :poem:verse: +***** group block :group: + +#+name: abs_functions_block_group +#+BEGIN_SRC d +void _group_block_(L,O,T)( + return ref L line, + return ref O an_object, + return ref T type +) { + debug(asserts) { + static assert(is(typeof(line) == char[])); + static assert(is(typeof(an_object) == string[string])); + static assert(is(typeof(type) == int[string])); + } + auto rgx = Rgx(); + if (type["curly_group"] == State.on) { + if (matchFirst(line, rgx.block_curly_group_close)) { + debug(group) { + writeln(line); + } + type["blocks"] = TriState.closing; + type["group"] = TriState.closing; + type["curly_group"] = TriState.off; + } else { + debug(group) { + writeln(line); + } + an_object[an_object_key] ~= line ~= "\n"; // build group array (or string) + } + } else if (type["tic_group"] == TriState.on) { + if (matchFirst(line, rgx.block_tic_close)) { + debug(group) { + writeln(line); + } + type["blocks"] = TriState.closing; + type["group"] = TriState.closing; + type["tic_group"] = TriState.off; + } else { + debug(group) { // group + writeln(line); + } + an_object[an_object_key] ~= line ~= "\n"; // build group array (or string) + } + } +} +#+END_SRC + +***** block block :block: + +#+name: abs_functions_block_block +#+BEGIN_SRC d +void _block_block_(L,O,T)( + return ref L line, + return ref O an_object, + return ref T type +) { + debug(asserts) { + static assert(is(typeof(line) == char[])); + static assert(is(typeof(an_object) == string[string])); + static assert(is(typeof(type) == int[string])); + } + auto rgx = Rgx(); + if (type["curly_block"] == TriState.on) { + if (matchFirst(line, rgx.block_curly_block_close)) { + debug(block) { // block (curly) close + writeln(line); + } + type["blocks"] = TriState.closing; + type["block"] = TriState.closing; + type["curly_block"] = TriState.off; + } else { + debug(block) { + writeln(line); + } + an_object[an_object_key] ~= line ~= "\n"; // build block array (or string) + } + } else if (type["tic_block"] == TriState.on) { + if (matchFirst(line, rgx.block_tic_close)) { + debug(block) { + writeln(line); + } + type["blocks"] = TriState.closing; + type["block"] = TriState.closing; + type["tic_block"] = TriState.off; + } else { + debug(block) { + writeln(line); + } + an_object[an_object_key] ~= line ~= "\n"; // build block array (or string) + } + } +} +#+END_SRC + +***** poem block, verse objects :poem:verse: why extra object stuff only in poem/verse? @@ -2640,7 +2810,7 @@ void _poem_block_(L,O,T,C,N,Ma)( N obj_cite_number_poem, Ma dochead_make_aa, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(type) == int[string])); @@ -2848,100 +3018,6 @@ void _poem_block_(L,O,T,C,N,Ma)( } #+END_SRC -***** group block :group: - -#+name: abs_functions_block_group -#+BEGIN_SRC d -void _group_block_(L,O,T)( - return ref L line, - return ref O an_object, - return ref T type -) { - debug(asserts){ - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(type) == int[string])); - } - auto rgx = Rgx(); - if (type["curly_group"] == State.on) { - if (matchFirst(line, rgx.block_curly_group_close)) { - debug(group) { // group (curly) close - writeln(line); - } - type["blocks"] = TriState.closing; - type["group"] = TriState.closing; - type["curly_group"] = TriState.off; - } else { - debug(group) { // group - writeln(line); - } - an_object[an_object_key] ~= line ~= "\n"; // build group array (or string) - } - } else if (type["tic_group"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { - debug(group) { // group (tic) close - writeln(line); - } - type["blocks"] = TriState.closing; - type["group"] = TriState.closing; - type["tic_group"] = TriState.off; - } else { - debug(group) { // group - writeln(line); - } - an_object[an_object_key] ~= line ~= "\n"; // build group array (or string) - } - } -} -#+END_SRC - -***** block block :block: - -#+name: abs_functions_block_block -#+BEGIN_SRC d -void _block_block_(L,O,T)( - return ref L line, - return ref O an_object, - return ref T type -) { - debug(asserts){ - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(type) == int[string])); - } - auto rgx = Rgx(); - if (type["curly_block"] == TriState.on) { - if (matchFirst(line, rgx.block_curly_block_close)) { - debug(block) { // block (curly) close - writeln(line); - } - type["blocks"] = TriState.closing; - type["block"] = TriState.closing; - type["curly_block"] = TriState.off; - } else { - debug(block) { // block - writeln(line); - } - an_object[an_object_key] ~= line ~= "\n"; // build block array (or string) - } - } else if (type["tic_block"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { - debug(block) { // block (tic) close - writeln(line); - } - type["blocks"] = TriState.closing; - type["block"] = TriState.closing; - type["tic_block"] = TriState.off; - } else { - debug(block) { // block - writeln(line); - } - an_object[an_object_key] ~= line ~= "\n"; // build block array (or string) - } - } -} -#+END_SRC - ***** quote block :quote: #+name: abs_functions_block_quote @@ -2951,7 +3027,7 @@ void _quote_block_(L,O,T)( return ref O an_object, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(type) == int[string])); @@ -2962,8 +3038,8 @@ void _quote_block_(L,O,T)( debug(quote) { // quote (curly) close writeln(line); } - type["blocks"] = TriState.closing; - type["quote"] = TriState.closing; + type["blocks"] = TriState.closing; + type["quote"] = TriState.closing; type["curly_quote"] = TriState.off; } else { debug(quote) { @@ -2976,8 +3052,8 @@ void _quote_block_(L,O,T)( debug(quote) { // quote (tic) close writeln(line); } - type["blocks"] = TriState.closing; - type["quote"] = TriState.closing; + type["blocks"] = TriState.closing; + type["quote"] = TriState.closing; type["tic_quote"] = TriState.off; } else { debug(quote) { @@ -2998,7 +3074,7 @@ void _table_block_(L,O,T)( return ref O an_object, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(type) == int[string])); @@ -3038,11 +3114,13 @@ void _table_block_(L,O,T)( **** block end (close an open block): line empty, block flag :close: +***** { line empty, make block + #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d void _block_flag_line_empty_(B)( - B bookindex_extract_hash, - char[] line, + B bookindex_extract_hash, + char[] line, return ref string[string] an_object, return ref ObjGenericComposite[] the_document_body_section, return ref string[][string][string] bookindex_unordered_hashes, @@ -3063,14 +3141,24 @@ void _block_flag_line_empty_(B)( "code block status: closed" ); assertions_flag_types_block_status_none_or_closed(type); - if (type["code"] == TriState.closing) { +#+END_SRC + +***** make: group block + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d + if (type["group"] == TriState.closing) { obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to); - an_object["is"] = "code"; + bookindex_extract_hash.bookindex_nugget_hash( + an_object["bookindex_nugget"], + obj_cite_number, + segment_anchor_tag_that_object_belongs_to + ); + an_object["is"] = "group"; auto comp_obj_location = node_construct.node_location_emitter( content_non_header, @@ -3084,57 +3172,39 @@ void _block_flag_line_empty_(B)( obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; - comp_obj_code = comp_obj_code.init; - comp_obj_code.use = "body"; - comp_obj_code.is_of = "block"; - comp_obj_code.is_a = "code"; - comp_obj_code.ocn = obj_cite_number; - comp_obj_code.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); - comp_obj_code.text = an_object["substantive"]; - comp_obj_code.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_code.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_code.inline_links = substantive_obj_misc_tuple[sObj.links]; - the_document_body_section ~= comp_obj_code; + comp_obj_block = comp_obj_block.init; + comp_obj_block.use = "body"; + comp_obj_block.is_of = "block"; + comp_obj_block.is_a = "group"; + comp_obj_block.ocn = obj_cite_number; + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.text = an_object["substantive"]; + comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; + the_document_body_section ~= comp_obj_block; + type["blocks"] = TriState.off; + type["group"] = TriState.off; object_reset(an_object); processing.remove("verse"); ++cntr; - type["blocks"] = TriState.off; - type["code"] = TriState.off; - } else if (type["poem"] == TriState.closing) { +#+END_SRC + +***** make: block + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d + } else if (type["block"] == TriState.closing) { + obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to); - an_object["is"] = "verse"; // check also - auto comp_obj_location = - node_construct.node_location_emitter( - content_non_header, - segment_anchor_tag_that_object_belongs_to, + bookindex_extract_hash.bookindex_nugget_hash( + an_object["bookindex_nugget"], obj_cite_number, - cntr, - heading_ptr-1, - an_object["is"] + segment_anchor_tag_that_object_belongs_to ); - comp_obj_poem_ocn = comp_obj_poem_ocn.init; - comp_obj_poem_ocn.use = "body"; - comp_obj_poem_ocn.is_of = "block"; - comp_obj_poem_ocn.is_a = "poem"; - comp_obj_poem_ocn.ocn = obj_cite_number; - comp_obj_poem_ocn.obj_cite_number = (obj_cite_number_poem["start"], obj_cite_number_poem["end"]); - comp_obj_poem_ocn.text = ""; // an_object["substantive"]; - the_document_body_section ~= comp_obj_poem_ocn; - object_reset(an_object); - processing.remove("verse"); - type["blocks"] = TriState.off; - type["poem"] = TriState.off; - } else if (type["table"] == TriState.closing) { - obj_cite_number = - ocn_emit(type["ocn_status"]); - an_object["bookindex_nugget"] = - ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; - bookindex_unordered_hashes = - bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to); - an_object["is"] = "table"; + an_object["is"] = "block"; auto comp_obj_location = node_construct.node_location_emitter( content_non_header, @@ -3143,7 +3213,7 @@ void _block_flag_line_empty_(B)( cntr, heading_ptr-1, an_object["is"] - ); + ); auto substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; @@ -3151,7 +3221,7 @@ void _block_flag_line_empty_(B)( comp_obj_block = comp_obj_block.init; comp_obj_block.use = "body"; comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "table"; + comp_obj_block.is_a = "block"; comp_obj_block.ocn = obj_cite_number; comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); comp_obj_block.text = an_object["substantive"]; @@ -3159,19 +3229,29 @@ void _block_flag_line_empty_(B)( comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; + type["blocks"] = TriState.off; + type["block"] = TriState.off; object_reset(an_object); processing.remove("verse"); ++cntr; - type["blocks"] = TriState.off; - type["table"] = TriState.off; - } else if (type["group"] == TriState.closing) { +#+END_SRC + +***** make: code block + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d + } else if (type["code"] == TriState.closing) { obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to); - an_object["is"] = "group"; + bookindex_extract_hash.bookindex_nugget_hash( + an_object["bookindex_nugget"], + obj_cite_number, + segment_anchor_tag_that_object_belongs_to + ); + an_object["is"] = "code"; auto comp_obj_location = node_construct.node_location_emitter( content_non_header, @@ -3185,29 +3265,38 @@ void _block_flag_line_empty_(B)( obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; - comp_obj_block = comp_obj_block.init; - comp_obj_block.use = "body"; - comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "group"; - comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); - comp_obj_block.text = an_object["substantive"]; - comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; - comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; - comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; - the_document_body_section ~= comp_obj_block; + comp_obj_code = comp_obj_code.init; + comp_obj_code.use = "body"; + comp_obj_code.is_of = "block"; + comp_obj_code.is_a = "code"; + comp_obj_code.ocn = obj_cite_number; + comp_obj_code.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_code.text = an_object["substantive"]; + comp_obj_code.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; + comp_obj_code.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; + comp_obj_code.inline_links = substantive_obj_misc_tuple[sObj.links]; + the_document_body_section ~= comp_obj_code; + type["blocks"] = TriState.off; + type["code"] = TriState.off; object_reset(an_object); processing.remove("verse"); ++cntr; - type["blocks"] = TriState.off; - type["group"] = TriState.off; - } else if (type["block"] == TriState.closing) { - obj_cite_number = ocn_emit(type["ocn_status"]); +#+END_SRC + +***** make: poem + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d + } else if (type["poem"] == TriState.closing) { an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to); - an_object["is"] = "block"; + bookindex_extract_hash.bookindex_nugget_hash( + an_object["bookindex_nugget"], + obj_cite_number, + segment_anchor_tag_that_object_belongs_to + ); + an_object["is"] = "verse"; // check also auto comp_obj_location = node_construct.node_location_emitter( content_non_header, @@ -3216,15 +3305,54 @@ void _block_flag_line_empty_(B)( cntr, heading_ptr-1, an_object["is"] - ); + ); + comp_obj_poem_ocn = comp_obj_poem_ocn.init; + comp_obj_poem_ocn.use = "body"; + comp_obj_poem_ocn.is_of = "block"; + comp_obj_poem_ocn.is_a = "poem"; + comp_obj_poem_ocn.ocn = obj_cite_number; + comp_obj_poem_ocn.obj_cite_number = (obj_cite_number_poem["start"], obj_cite_number_poem["end"]); + comp_obj_poem_ocn.text = ""; // an_object["substantive"]; + the_document_body_section ~= comp_obj_poem_ocn; + type["blocks"] = TriState.off; + type["poem"] = TriState.off; + object_reset(an_object); + processing.remove("verse"); +#+END_SRC + +***** make: quote block + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d + } else if (type["quote"] == TriState.closing) { + obj_cite_number = + ocn_emit(type["ocn_status"]); + an_object["bookindex_nugget"] = + ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; + bookindex_unordered_hashes = + bookindex_extract_hash.bookindex_nugget_hash( + an_object["bookindex_nugget"], + obj_cite_number, + segment_anchor_tag_that_object_belongs_to + ); + an_object["is"] = "quote"; + auto comp_obj_location = + node_construct.node_location_emitter( + content_non_header, + segment_anchor_tag_that_object_belongs_to, + obj_cite_number, + cntr, + heading_ptr-1, + an_object["is"] + ); auto substantive_obj_misc_tuple = - obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); - an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; + obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); // ... + an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; // ... anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; comp_obj_block.use = "body"; comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "block"; + comp_obj_block.is_a = "quote"; comp_obj_block.ocn = obj_cite_number; comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); comp_obj_block.text = an_object["substantive"]; @@ -3236,15 +3364,25 @@ void _block_flag_line_empty_(B)( processing.remove("verse"); ++cntr; type["blocks"] = TriState.off; - type["block"] = TriState.off; - } else if (type["quote"] == TriState.closing) { + type["quote"] = TriState.off; +#+END_SRC + +***** make: table + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d + } else if (type["table"] == TriState.closing) { obj_cite_number = ocn_emit(type["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = - bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to); - an_object["is"] = "quote"; + bookindex_extract_hash.bookindex_nugget_hash( + an_object["bookindex_nugget"], + obj_cite_number, + segment_anchor_tag_that_object_belongs_to + ); + an_object["is"] = "table"; auto comp_obj_location = node_construct.node_location_emitter( content_non_header, @@ -3255,13 +3393,13 @@ void _block_flag_line_empty_(B)( an_object["is"] ); auto substantive_obj_misc_tuple = - obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); // ... - an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; // ... + obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); + an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; comp_obj_block.use = "body"; comp_obj_block.is_of = "block"; - comp_obj_block.is_a = "quote"; + comp_obj_block.is_a = "table"; comp_obj_block.ocn = obj_cite_number; comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); comp_obj_block.text = an_object["substantive"]; @@ -3269,12 +3407,18 @@ void _block_flag_line_empty_(B)( comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; + type["blocks"] = TriState.off; + type["table"] = TriState.off; object_reset(an_object); processing.remove("verse"); ++cntr; - type["blocks"] = TriState.off; - type["quote"] = TriState.off; } +#+END_SRC + +***** } + +#+name: abs_functions_block_line_status_empty +#+BEGIN_SRC d } #+END_SRC @@ -3289,7 +3433,7 @@ auto _book_index_(L,I,O,T,B)( return ref T type, B opt_action_bool, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(book_idx_tmp) == string)); static assert(is(typeof(an_object) == string[string])); @@ -3355,7 +3499,7 @@ auto _heading_found_(L,X,H,R,T)( return ref R heading_match_rgx, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(dochead_make_identify_unmarked_headings) == string)); static assert(is(typeof(heading_match_str) == string[string])); @@ -3442,7 +3586,7 @@ auto _heading_found_(L,X,H,R,T)( } #+END_SRC -**** heading make set :heading: +**** heading make set :heading: #+name: abs_functions_heading #+BEGIN_SRC d @@ -3452,7 +3596,7 @@ auto _heading_make_set_(L,C,R,T)( return ref R heading_match_rgx, return ref T type ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(line_occur) == int[string])); static assert(is(typeof(heading_match_rgx) == Regex!(char)[string])); @@ -3524,7 +3668,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( return ref T type, return ref Me dochead_meta_aa, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(line_occur) == int[string])); static assert(is(typeof(an_object) == string[string])); @@ -3684,7 +3828,7 @@ void _para_match_(L,O,K,I,B,T,C)( return ref T type, return ref C line_occur, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(line) == char[])); static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(an_object_key) == string)); @@ -3738,7 +3882,7 @@ void _para_match_(L,O,K,I,B,T,C)( } #+END_SRC -**** TODO text font face +**** text font face #+name: abs_functions_para #+BEGIN_SRC d @@ -3785,7 +3929,7 @@ struct OCNemitter { ***** object inline markup munge :markup:inline: -****** 0. struct, inline markup munge +****** { struct, inline markup munge #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -3810,7 +3954,7 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d string url_links(Ot)(Ot obj_txt_in) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } /+ url matched +/ @@ -3870,7 +4014,7 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d auto footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in, bool reset_note_numbers) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } /+ endnotes (regular) +/ @@ -3933,7 +4077,7 @@ struct ObjInlineMarkupMunge { #+BEGIN_SRC d private auto object_notes_and_links_(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) in { - debug(asserts){ + debug(asserts) { assert(is(typeof(obj_txt_in) == string)); } } @@ -3989,27 +4133,24 @@ struct ObjInlineMarkupMunge { } #+END_SRC -****** para -- paragraph text without other identification until two new lines +****** heading +- identified text by heading level marker followed by text until two new lines - general markup - - paragraph attributes - - font faces (bold, italics, underscore etc.) - - footnotes/endnotes - - links #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto para(Ot)(Ot obj_txt_in) + auto munge_heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { obj_txt["munge"]=(obj_txt_in) - .replaceFirst(rgx.para_attribs, "") - .replaceFirst(rgx.obj_cite_number_off_all, ""); - auto t = object_notes_and_links_(obj_txt["munge"]); + .replaceFirst(rgx.heading, "") + .replaceFirst(rgx.obj_cite_number_off_all, "") + .strip; + auto t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); debug(munge) { writeln(__LINE__); writeln(obj_txt_in); @@ -4018,26 +4159,31 @@ struct ObjInlineMarkupMunge { } return t; } + invariant() { + } #+END_SRC -****** heading -- identified text by heading level marker followed by text until two new lines +****** para +- paragraph text without other identification until two new lines - general markup + - paragraph attributes + - font faces (bold, italics, underscore etc.) + - footnotes/endnotes + - links #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) + auto munge_para(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { obj_txt["munge"]=(obj_txt_in) - .replaceFirst(rgx.heading, "") - .replaceFirst(rgx.obj_cite_number_off_all, "") - .strip; - auto t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); + .replaceFirst(rgx.para_attribs, "") + .replaceFirst(rgx.obj_cite_number_off_all, ""); + auto t = object_notes_and_links_(obj_txt["munge"]); debug(munge) { writeln(__LINE__); writeln(obj_txt_in); @@ -4046,31 +4192,6 @@ struct ObjInlineMarkupMunge { } return t; } - invariant() { - } -#+END_SRC - -****** code -- newlines -- indentation -- possibly identify syntax for coloring -- no general markup - -#+name: ao_emitters_obj_inline_markup_munge -#+BEGIN_SRC d - string code(Ot)(Ot obj_txt_in) - in { - debug(asserts){ - assert(is(typeof(obj_txt_in) == string)); - } - } - body { - obj_txt_in = (obj_txt_in).replaceAll(rgx.two_spaces, mkup.nbsp ~ mkup.nbsp); - obj_txt["munge"] = obj_txt_in; - return obj_txt["munge"]; - } - invariant() { - } #+END_SRC ****** group @@ -4084,7 +4205,7 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto group(string obj_txt_in) + auto munge_group(string obj_txt_in) in { } body { obj_txt["munge"]=obj_txt_in; @@ -4106,9 +4227,9 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto block(Ot)(Ot obj_txt_in) + auto munge_block(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } @@ -4132,9 +4253,9 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto verse(Ot)(Ot obj_txt_in) + auto munge_verse(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } @@ -4147,18 +4268,25 @@ struct ObjInlineMarkupMunge { } #+END_SRC -****** quote +****** code +- newlines +- indentation +- possibly identify syntax for coloring (obj attribute) +- numbered code blocks (markup/obj attribute?) +- no general markup +- one special character represented by mkup.nbsp ░ #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string quote(Ot)(Ot obj_txt_in) + string munge_code(Ot)(Ot obj_txt_in) in { - debug(asserts){ - static assert(is(typeof(obj_txt_in) == string)); + debug(asserts) { + assert(is(typeof(obj_txt_in) == string)); } } body { - obj_txt["munge"]=obj_txt_in; + obj_txt_in = (obj_txt_in).replaceAll(rgx.two_spaces, mkup.nbsp ~ mkup.nbsp); + obj_txt["munge"] = obj_txt_in; return obj_txt["munge"]; } invariant() { @@ -4171,9 +4299,27 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string table(Ot)(Ot obj_txt_in) + string munge_table(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { + static assert(is(typeof(obj_txt_in) == string)); + } + } + body { + obj_txt["munge"]=obj_txt_in; + return obj_txt["munge"]; + } + invariant() { + } +#+END_SRC + +****** quote + +#+name: ao_emitters_obj_inline_markup_munge +#+BEGIN_SRC d + string munge_quote(Ot)(Ot obj_txt_in) + in { + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } @@ -4189,9 +4335,9 @@ struct ObjInlineMarkupMunge { #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string comment(Ot)(Ot obj_txt_in) + string munge_comment(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } @@ -4203,7 +4349,7 @@ struct ObjInlineMarkupMunge { } #+END_SRC -****** 0. close +****** } #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -4211,7 +4357,7 @@ struct ObjInlineMarkupMunge { #+END_SRC ***** toc, tags, object inline markup :markup:inline: -****** open +****** { #+name: ao_emitters_obj_inline_markup #+BEGIN_SRC d @@ -4231,15 +4377,15 @@ struct ObjInlineMarkup { Ma dochead_make_aa ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_) == string[string])); static assert(is(typeof(obj_key_) == string)); static assert(is(typeof(dochead_make_aa) == string[string][string])); } } body { - obj_txt["munge"]=obj_[obj_key_].dup; - obj_txt["munge"]=(match(obj_["is"], ctRegex!(`verse|code`))) + obj_txt["munge"] = obj_[obj_key_].dup; + obj_txt["munge"] = (match(obj_["is"], ctRegex!(`verse|code`))) ? obj_txt["munge"] : strip(obj_txt["munge"]); static __gshared string[] anchor_tags_ = []; @@ -4260,37 +4406,38 @@ struct ObjInlineMarkup { } else if (obj_["lev"] == "1") { writeln("heading anchor tag missing: ", obj_txt["munge"]); } - x =munge.heading(obj_txt["munge"], reset_note_numbers); + x =munge.munge_heading(obj_txt["munge"], reset_note_numbers); reset_note_numbers=false; goto default; case "para": - x = munge.para(obj_txt["munge"]); + x = munge.munge_para(obj_txt["munge"]); goto default; case "group": - x = munge.group(obj_txt["munge"]); + x = munge.munge_group(obj_txt["munge"]); goto default; case "block": - x = munge.block(obj_txt["munge"]); + x = munge.munge_block(obj_txt["munge"]); goto default; case "verse": - x = munge.verse(obj_txt["munge"]); + x = munge.munge_verse(obj_txt["munge"]); goto default; case "code": - obj_txt["munge"]=munge.code(obj_txt["munge"]); - break; - case "quote": - obj_txt["munge"]=munge.quote(obj_txt["munge"]); + obj_txt["munge"] = munge.munge_code(obj_txt["munge"]); break; case "table": - obj_txt["munge"]=munge.table(obj_txt["munge"]); + obj_txt["munge"] = munge.munge_table(obj_txt["munge"]); + break; + case "quote": + obj_txt["munge"] = munge.munge_quote(obj_txt["munge"]); break; case "comment": - obj_txt["munge"]=munge.comment(obj_txt["munge"]); + obj_txt["munge"] = munge.munge_comment(obj_txt["munge"]); break; case "doc_end_reset": munge.initialize_note_numbers(); break; default: + /+ para, heading, group, block, verse +/ obj_txt["munge"]=x[0]; obj_notes_and_links["notes_reg"] = x[1]; obj_notes_and_links["notes_star"] = x[2]; @@ -4311,14 +4458,14 @@ struct ObjInlineMarkup { } #+END_SRC -****** toc, table of contents build, gather headings :markup:inline: +****** toc (table of contents), build, gather headings :markup:inline: #+name: ao_emitters_obj_inline_markup_table_of_contents #+BEGIN_SRC d auto _clean_heading_toc_(Toc)( Toc heading_toc_, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(heading_toc_) == char[])); } auto m = matchFirst(cast(char[]) heading_toc_, rgx.heading); @@ -4336,7 +4483,7 @@ struct ObjInlineMarkup { Toc the_table_of_contents_section, ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_) == string[string])); static assert(is(typeof(dochead_make_aa) == string[string][string])); static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string)); @@ -4505,13 +4652,12 @@ private: O obj_, Ma dochead_make_aa ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(munge_) == string)); static assert(is(typeof(obj_) == string[string])); static assert(is(typeof(dochead_make_aa) == string[string][string])); } if (dochead_make_aa["make"]["num_top"].length > 0) { - // if (!(match(munge_, rgx.heading_anchor_tag))) { static __gshared int heading_num_top_level=9; static __gshared int heading_num_depth=2; static __gshared int heading_num_0 = 0; @@ -4650,7 +4796,7 @@ private: #+BEGIN_SRC d static string _make_segment_anchor_tags_if_none_provided(M,Lv)(M munge_, Lv lev_) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(munge_) == string)); static assert(is(typeof(lev_) == string)); } @@ -4727,7 +4873,7 @@ private: } #+END_SRC -****** close +****** } #+name: ao_emitters_obj_inline_markup_close #+BEGIN_SRC d @@ -4735,7 +4881,7 @@ private: #+END_SRC ***** object attrib :attributes: -****** attributes structure open, public +****** { attributes structure open, public #+name: ao_emitters_obj_attributes #+BEGIN_SRC d @@ -4743,7 +4889,7 @@ struct ObjAttributes { string[string] _obj_attrib; #+END_SRC -****** attributes structure open, public +****** emitter obj attributes, public #+name: ao_emitters_obj_attributes_public #+BEGIN_SRC d @@ -4753,7 +4899,7 @@ struct ObjAttributes { OH _comp_obj_heading, ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_is_) == string)); static assert(is(typeof(obj_raw) == string)); static assert(is(typeof(_comp_obj_heading) == ObjGenericComposite)); @@ -4827,13 +4973,13 @@ struct ObjAttributes { #+END_SRC ******* attrubutes -******** para and block +******** para & blocks #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d string _para_and_blocks(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } @@ -4863,160 +5009,160 @@ struct ObjAttributes { } #+END_SRC -******** para +******** heading #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _para(Ot)(Ot obj_txt_in) + string _heading(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"para\"," - ~ " \"is\": \"para\""; + ~ " \"is\": \"heading\""; return _obj_attributes; } invariant() { } #+END_SRC -******** heading +******** para #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _heading(Ot)(Ot obj_txt_in) + string _para(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"para\"," - ~ " \"is\": \"heading\""; + ~ " \"is\": \"para\""; return _obj_attributes; } invariant() { } #+END_SRC -******** code +******** group #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _code(Ot)(Ot obj_txt_in) + string _group(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," - ~ " \"is\": \"code\""; + ~ " \"is\": \"group\""; return _obj_attributes; } invariant() { } #+END_SRC -******** group +******** block #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _group(Ot)(Ot obj_txt_in) + string _block(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," - ~ " \"is\": \"group\""; + ~ " \"is\": \"block\""; return _obj_attributes; } invariant() { } #+END_SRC -******** block +******** verse #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _block(Ot)(Ot obj_txt_in) + string _verse(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," - ~ " \"is\": \"block\""; + ~ " \"is\": \"verse\""; return _obj_attributes; } invariant() { } #+END_SRC -******** verse +******** code #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _verse(Ot)(Ot obj_txt_in) + string _code(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," - ~ " \"is\": \"verse\""; + ~ " \"is\": \"code\""; return _obj_attributes; } invariant() { } #+END_SRC -******** quote +******** table #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _quote(Ot)(Ot obj_txt_in) + string _table(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," - ~ " \"is\": \"quote\""; + ~ " \"is\": \"table\""; return _obj_attributes; } invariant() { } #+END_SRC -******** table +******** quote #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string _table(Ot)(Ot obj_txt_in) + string _quote(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } body { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," - ~ " \"is\": \"table\""; + ~ " \"is\": \"quote\""; return _obj_attributes; } invariant() { @@ -5029,7 +5175,7 @@ struct ObjAttributes { #+BEGIN_SRC d string _comment(Ot)(Ot obj_txt_in) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } } @@ -5052,7 +5198,7 @@ struct ObjAttributes { Oi obj_is_, OH _comp_obj_heading, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(_obj_attrib) == string)); static assert(is(typeof(obj_is_) == string)); static assert(is(typeof(_comp_obj_heading) == ObjGenericComposite)); @@ -5077,7 +5223,7 @@ struct ObjAttributes { } #+END_SRC -****** close +****** } #+name: ao_emitters_obj_attributes_private_close #+BEGIN_SRC d @@ -5102,7 +5248,7 @@ struct BookIndexNuggetHash { S segment_anchor_tag, ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(bookindex_section) == string)); static assert(is(typeof(obj_cite_number) == int)); } @@ -5182,7 +5328,7 @@ struct BookIndexReportIndent { auto bookindex_report_indented(BI)( BI bookindex_unordered_hashes ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); } auto mainkeys= @@ -5209,7 +5355,7 @@ struct BookIndexReportIndent { #+END_SRC ***** book index (sort &) report section :report:section: -****** book index struct open +****** { book index struct open #+name: ao_emitters_book_index_report_section #+BEGIN_SRC d @@ -5226,7 +5372,7 @@ struct BookIndexReportSection { auto bookindex_write_section(BI)( BI bookindex_unordered_hashes ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); } auto mainkeys=bookindex_unordered_hashes.byKey.array.sort().release; @@ -5263,7 +5409,7 @@ struct BookIndexReportSection { N obj_cite_number, B opt_action_bool, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); static assert(is(typeof(obj_cite_number) == int)); static assert(is(typeof(opt_action_bool) == bool[string])); @@ -5416,7 +5562,7 @@ struct BookIndexReportSection { } #+END_SRC -****** book index struct close +****** } #+name: ao_emitters_book_index_report_section #+BEGIN_SRC d @@ -5434,7 +5580,7 @@ struct NotesSection { auto rgx = Rgx(); #+END_SRC -***** gather notes for endnote section struct open +***** { gather notes for endnote section struct open #+name: ao_emitters_endnotes #+BEGIN_SRC d @@ -5608,7 +5754,7 @@ struct NotesSection { } #+END_SRC -***** gather notes for endnote section struct close +***** } #+name: ao_emitters_endnotes #+BEGIN_SRC d @@ -5616,7 +5762,7 @@ struct NotesSection { #+END_SRC **** bibliography :bibliography: -***** biblio struct open +***** { biblio struct #+name: ao_emitters_bibliography #+BEGIN_SRC d @@ -5632,7 +5778,7 @@ struct Bibliography { return ref BJ bib_arr_json ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(biblio_unsorted_incomplete) == string[])); static assert(is(typeof(bib_arr_json) == JSONValue[])); } @@ -5669,7 +5815,7 @@ struct Bibliography { Bi biblio_unordered, return ref BJ bib_arr_json ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(biblio_unordered) == string[])); static assert(is(typeof(bib_arr_json) == JSONValue[])); } @@ -5706,7 +5852,7 @@ struct Bibliography { #+name: ao_emitters_bibliography #+BEGIN_SRC d final private JSONValue[] biblio_sort(BJ)(BJ biblio_unordered) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(biblio_unordered) == JSONValue[])); } JSONValue[] biblio_sorted_; @@ -5730,7 +5876,7 @@ struct Bibliography { #+name: ao_emitters_bibliography #+BEGIN_SRC d void biblio_debug(BJ)(BJ biblio_sorted) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(biblio_sorted) == JSONValue[])); } debug(biblio0) { @@ -5743,7 +5889,7 @@ struct Bibliography { } #+END_SRC -***** biblio struct close +***** } #+name: ao_emitters_bibliography #+BEGIN_SRC d @@ -5751,7 +5897,7 @@ struct Bibliography { #+END_SRC **** node structure metadata :structure:metadata:node: -***** metadata node struct open +***** { metadata node struct #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -5762,7 +5908,7 @@ struct NodeStructureMetadata { auto rgx = Rgx(); #+END_SRC -***** TODO node metadata emitter +***** node metadata emitter #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -5775,7 +5921,7 @@ struct NodeStructureMetadata { I is_ ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(lev_markup_number) == string)); static assert(is(typeof(segment_anchor_tag) == string)); static assert(is(typeof(obj_cite_number_) == int)); @@ -5826,7 +5972,7 @@ struct NodeStructureMetadata { } #+END_SRC -***** TODO node metadata emitter heading, (including most segnames & their pointers) +***** node metadata emitter heading, (including most segnames & their pointers) #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -5847,7 +5993,7 @@ struct NodeStructureMetadata { fL flag_links, ) in { - debug(asserts){ + debug(asserts) { static assert(is(typeof(_text) == string)); static assert(is(typeof(lev) == string)); static assert(is(typeof(lev_markup_number) == string)); @@ -6021,7 +6167,7 @@ struct NodeStructureMetadata { } #+END_SRC -***** metadata node struct close +***** } #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -6037,7 +6183,7 @@ auto assertions_doc_structure(O,Lv)( O an_object, Lv lv ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(an_object) == string[string])); static assert(is(typeof(lv) == int[string])); } @@ -6219,7 +6365,7 @@ auto assertions_doc_structure(O,Lv)( #+name: abs_functions_assertions #+BEGIN_SRC d auto assertions_flag_types_block_status_none_or_closed(T)(T type) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(type) == int[string])); } assert( @@ -6279,7 +6425,7 @@ struct HeadingAttrib { } #+END_SRC -*** TODO composite object +*** [#A] composite object #+name: ao_structs_init #+BEGIN_SRC d |