From a32c38eda635daa4f7bf00e971e8105bd7d25c57 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Nov 2016 15:14:52 -0500 Subject: document sections --- org/ao_abstract_doc_source.org | 6 +- org/ao_output_debugs.org | 327 +++++++++++++++++++++++++++++++++++++++-- org/sdp.org | 29 ++-- 3 files changed, 325 insertions(+), 37 deletions(-) (limited to 'org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 6b1906d..0de77a2 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -1009,7 +1009,7 @@ foreach (entry; biblio_ordered) { out_, // nugget/object "", // attrib 0, // obj_cite_number - ([ "hang_position" : "0", "base_position" : "1", ]), // indent + ([ "hang_position" : "0", "base_position" : "1", ]), // indent false ); } @@ -4788,8 +4788,8 @@ auto contents_para( object_set.is_a = "para"; object_set.object = object.strip; object_set.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); - object_set.para_attrib.indent_start = 0; // indent["hang_position"]; - object_set.para_attrib.indent_rest = 0; // indent["base_position"]; + object_set.para_attrib.indent_start = to!int(indent["hang_position"]); + object_set.para_attrib.indent_rest = to!int(indent["base_position"]); object_set.para_attrib.bullet = false; // bullet; // object_set.node_structure.node = _node; return object_set; diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org index b13bdce..0cab796 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_output_debugs.org @@ -15,7 +15,52 @@ * output debugs :debug:output: [[./sdp.org][sdp]] [[./][org/]] -** book index (sort &) report :report: +** initialize :report: + +#+name: initialize +#+BEGIN_SRC d +string key; +string indent_amount_; +auto indented_(int indent) { + switch (indent) { + case 0: + indent_amount_=""; + break; + case 1: + indent_amount_=" "; + break; + case 2: + indent_amount_=" "; + break; + case 3: + indent_amount_=" "; + break; + case 4: + indent_amount_=" "; + break; + case 5: + indent_amount_=" "; + break; + case 6: + indent_amount_=" "; + break; + case 7: + indent_amount_=" "; + break; + case 8: + indent_amount_=" "; + break; + case 9: + indent_amount_=" "; + break; + default: + break; + } + return indent_amount_; +} +#+END_SRC + +** book index (sort &) report :report: #+name: book_index_sorted_report #+BEGIN_SRC d @@ -97,6 +142,262 @@ debug(dumpdoc) { } #+END_SRC +** shared output section arrange +*** out toc + +#+name: ao_output_debugs +#+BEGIN_SRC d +void out_toc(S)( + auto ref const S contents, + string key, +) { + if (contents[key].length > 1) { + string indent_amount; + foreach (obj; contents[key]) { + indent_amount=indented_(obj.para_attrib.indent_start); + writefln( + "%s%s", + indent_amount, + obj.object + ); + } + } +} +#+END_SRC + +*** out endnotes :endnotes: + +#+name: ao_output_debugs +#+BEGIN_SRC d +void out_endnotes(S)( + auto ref const S contents, + string key, +) { + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s]\n%s", + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +*** out bookindex :bookindex: + +#+name: ao_output_debugs +#+BEGIN_SRC d +void out_bookindex(S)( + auto ref const S contents, + string key, +) { + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s][%s]\n%s", + obj.obj_cite_number, + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +** sections +*** heading_section :heading: + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_head) { + key="head"; + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s][%s]\n%s", + obj.obj_cite_number, + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +*** toc_section (seg & scroll) +**** toc + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_toc) { + key="toc_seg"; + out_toc(contents, key); +} +#+END_SRC + +**** toc seg + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_toc_seg) { + key="toc_seg"; + out_toc(contents, key); +} +#+END_SRC + +**** toc scroll + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_toc_scroll) { + key="toc_scroll"; + out_toc(contents, key); +} +#+END_SRC + +*** body_section :body: + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_body) { + key="body"; + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s][%s]\n%s", + obj.obj_cite_number, + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +*** endnotes_section (seg & scroll) :endnotes: + +**** endnotes + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_endnotes) { + key="endnotes_seg"; + out_endnotes(contents, key); +} +#+END_SRC + +**** endnotes seg + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_endnotes_seg) { + key="endnotes_seg"; + out_endnotes(contents, key); +} +#+END_SRC + +**** endnotes scroll + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_endnotes_scroll) { + key="endnotes_scroll"; + out_endnotes(contents, key); +} +#+END_SRC + +*** glossary_section :glossary: + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_glossary) { + key="glossary"; + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s][%s]\n%s", + obj.obj_cite_number, + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +*** bibliography_section (seg & scroll) :bibliography: + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_bibliography) { + key="bibliography"; + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s][%s]\n%s", + obj.obj_cite_number, + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +*** bookindex_section (seg & scroll) :bookindex: + +**** bookindex + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_bookindex) { + key="bookindex_seg"; + out_bookindex(contents, key); +} +#+END_SRC + +**** bookindex seg + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_bookindex_seg) { + key="bookindex_seg"; + out_bookindex(contents, key); +} +#+END_SRC + +**** bookindex scroll + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(section_bookindex_scroll) { + key="bookindex_scroll"; + out_bookindex(contents, key); +} +#+END_SRC + +*** section_blurb :blurb: + +#+name: ao_output_debugs +#+BEGIN_SRC d +debug(blurb_section) { + key="blurb"; + if (contents[key].length > 1) { + foreach (obj; contents[key]) { + writefln( + "[%s][%s]\n%s", + obj.obj_cite_number, + obj.is_a, + obj.object + ); + } + } +} +#+END_SRC + +* end ** (objects) :objects: #+name: ao_output_debugs @@ -325,8 +626,8 @@ debug(anchor) { __FILE__, __LINE__, ); - foreach (key; document_section_keys_sequenced["seg"]) { - foreach (obj; contents[key]) { + foreach (k; document_section_keys_sequenced["seg"]) { + foreach (obj; contents[k]) { if (obj.is_a == "heading") { writefln( "%s~ [%s] %s %s", @@ -348,8 +649,8 @@ debug(anchor) { #+BEGIN_SRC d debug(heading) { // heading string spc; - foreach (key; document_section_keys_sequenced["seg"]) { - foreach (o; contents[key]) { + foreach (k; document_section_keys_sequenced["seg"]) { + foreach (o; contents[k]) { if (o.is_a == "heading") { switch (o.heading_attrib.lev_markup_number) { case 0: @@ -391,13 +692,6 @@ debug(heading) { // heading o.heading_attrib.lev_collapsed_number ); } - writefln( - "%s* %s\n (markup level: %s; collapsed level: %s)", - spc, - strip(o.object), - o.heading_attrib.lev_markup_number, - o.heading_attrib.lev_collapsed_number - ); } } } @@ -414,8 +708,8 @@ debug(headings) { __FILE__, __LINE__, ); - foreach (key; document_section_keys_sequenced["seg"]) { - foreach (obj; contents[key]) { + foreach (k; document_section_keys_sequenced["seg"]) { + foreach (obj; contents[k]) { if (obj.is_a == "heading") { writefln( "%s~ [%s] %s", @@ -443,8 +737,8 @@ debug(summary) { #+name: ao_output_debugs_summary #+BEGIN_SRC d debug(checkdoc) { - foreach (key; document_section_keys_sequenced["seg"]) { - foreach (obj; contents[key]) { + foreach (k; document_section_keys_sequenced["seg"]) { + foreach (obj; contents[k]) { if (obj.use == "content") { if (!empty(obj.obj_cite_number)) { check["last_obj_cite_number"] = obj.obj_cite_number; @@ -638,6 +932,7 @@ template SiSUoutputDebugs() { ) { mixin RgxInit; auto rgx = Rgx(); + <> <> <> <> diff --git a/org/sdp.org b/org/sdp.org index c1157eb..d69262b 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -365,6 +365,7 @@ auto doc_ao_bookindex_unordered_hashes = t[1]; // redundant? auto doc_ao_biblio = t[2]; // redundant? #+END_SRC +**** document section keys view #+NAME: sdp_each_file_do_document_abstraction #+BEGIN_SRC d @@ -380,45 +381,37 @@ string[][string] document_section_keys_sequenced = [ "body", ] ]; -/+ seg +/ if (doc_ao_contents["endnotes_seg"].length > 1) { document_section_keys_sequenced["seg"] = document_section_keys_sequenced["seg"] ~= "endnotes_seg"; } -if (doc_ao_contents["glossary"].length > 1) { - document_section_keys_sequenced["seg"] = - document_section_keys_sequenced["seg"] ~= "glossary"; -} -if (doc_ao_contents["bibliography"].length > 1) { - document_section_keys_sequenced["seg"] = - document_section_keys_sequenced["seg"] ~= "bibliography"; -} -if (doc_ao_contents["bookindex_seg"].length > 1) { - document_section_keys_sequenced["seg"] = - document_section_keys_sequenced["seg"] ~= "bookindex_seg"; -} -if (doc_ao_contents["blurb"].length > 1) { - document_section_keys_sequenced["seg"] = - document_section_keys_sequenced["seg"] ~= "blurb"; -} -/+ scroll +/ if (doc_ao_contents["endnotes_scroll"].length > 1) { document_section_keys_sequenced["scroll"] = document_section_keys_sequenced["scroll"] ~= "endnotes_scroll"; } if (doc_ao_contents["glossary"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "glossary"; document_section_keys_sequenced["scroll"] = document_section_keys_sequenced["scroll"] ~= "glossary"; } if (doc_ao_contents["bibliography"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "bibliography"; document_section_keys_sequenced["scroll"] = document_section_keys_sequenced["scroll"] ~= "bibliography"; } +if (doc_ao_contents["bookindex_seg"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "bookindex_seg"; +} if (doc_ao_contents["bookindex_scroll"].length > 1) { document_section_keys_sequenced["scroll"] = document_section_keys_sequenced["scroll"] ~= "bookindex_scroll"; } if (doc_ao_contents["blurb"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "blurb"; document_section_keys_sequenced["scroll"] = document_section_keys_sequenced["scroll"] ~= "blurb"; } -- cgit v1.2.3