From a74c05a756f541c314792a9f852c98db1f2b1aed Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 7 Dec 2016 17:28:38 -0500 Subject: 0.9.5 org files reorganized, tangles (code structure) to top of file --- org/ao_abstract_doc_source.org | 469 +++++++++++++++++++++-------------------- 1 file changed, 246 insertions(+), 223 deletions(-) (limited to 'org/ao_abstract_doc_source.org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 724e44a..da435a1 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -13,8 +13,147 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] +* 0. Code Outline / Structure (tangles) :tangle:io:file: +** 1. ao abstract doc source: :ao_abstract_doc_source.d: -* Document Abstraction :abstract:process: +#+BEGIN_SRC d :tangle ../src/sdp/ao_abstract_doc_source.d +/++ + document abstraction: + abstraction of sisu markup for downstream processing + ao_abstract_doc_source.d ++/ +template SiSUdocAbstraction() { + private: + struct Abstraction { + /+ ↓ abstraction imports +/ + <> + /+ ↓ abstraction mixins +/ + <> + /+ ↓ abstraction struct init +/ + <> + /+ ↓ abstract marked up document +/ + auto abstract_doc_source( + char[][] markup_sourcefile_content, + string[string][string] dochead_make_aa, + string[string][string] dochead_meta_aa, + bool[string] opt_action_bool, + ) { + /+ ↓ abstraction init +/ + <> + /+ abstraction init ↑ +/ + /+ ↓ loop markup document/text line by line +/ + srcDocLoop: + foreach (line; markup_sourcefile_content) { + /+ ↓ markup document/text line by line +/ + <> + if (type["code"] == TriState.on) { + <> + } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { + /+ object other than "code block" object + (includes regular text paragraph, headings & blocks other than code) +/ + <> + } else { + /+ not within a block group +/ + <> + if (matchFirst(line, rgx.block_open)) { + <> + } else if (!line.empty) { + /+ line not empty +/ + /+ non blocks (headings, paragraphs) & closed blocks +/ + <> + } else if (type["blocks"] == TriState.closing) { + /+ line empty, with blocks flag +/ + <> + } else { + /+ line.empty, post contents, empty variables: +/ + <> + } // close else for line empty + } // close else for not the above + } // close after non code, other blocks or regular text + <> + } /+ ← closed: loop markup document/text line by line +/ + /+ ↓ post loop markup document/text +/ + <> + /+ post loop markup document/text ↑ +/ + } /+ ← closed: abstract doc source +/ + /+ ↓ abstraction functions +/ + <> + <> + <> + <> + <> + <> + <> + <> + <> + <> + <> + <> + <> + <> + <> + /+ abstraction functions ↑ +/ + /+ ↓ abstraction function emitters +/ + <> + /+ +/ + <> + <> + <> + <> + <> + <> + <> + /+ +/ + <> + <> + <> + <> + <> + <> + /+ +/ + <> + <> + <> + /+ +/ + <> + /+ +/ + <> + /+ +/ + <> + /+ abstraction functions emitters ↑ +/ + /+ ↓ abstraction functions assertions +/ + <> + /+ abstraction functions assertions ↑ +/ + } /+ ← closed: struct Abstraction +/ +} /+ ← closed: template SiSUdocAbstraction +/ +#+END_SRC + +** 2. ao object setter: :ao_object_setter.d: + +#+BEGIN_SRC d :tangle ../src/sdp/ao_object_setter.d +/++ + object setter: + setting of sisu objects for downstream processing + ao_object_setter.d ++/ +template ObjectSetter() { + /+ structs +/ + <> + /+ structs setter +/ + struct ObjectAbstractSet { + import std.conv : to; + <> + <> + <> + <> + <> + <> + <> + } +} +#+END_SRC + +* 1. Document Abstraction :abstract:process: Process markup document, create document abstraction. ** _1. pre loop processing_ :pre: @@ -1385,12 +1524,12 @@ auto t = tuple( return t; #+END_SRC -* Functions :abstract:function: +** 4. Functions :abstract:function: functions used in document abstraction -** set & resets :reset: -*** object reset: remove (clean) :object:remove: +*** set & resets :reset: +**** object reset: remove (clean) :object:remove: #+name: abs_functions_object_reset #+BEGIN_SRC d @@ -1403,7 +1542,7 @@ auto object_reset(ref string[string] an_object) { } #+END_SRC -*** set, initialize or re-initialize :set: +**** set, initialize or re-initialize :set: #+name: abs_functions_header_set_common #+BEGIN_SRC d @@ -1420,7 +1559,7 @@ auto _common_reset_( } #+END_SRC -** check obj_cite_number status in document :ocn: +*** check obj_cite_number status in document :ocn: #+name: abs_functions_ocn_status #+BEGIN_SRC d @@ -1470,9 +1609,9 @@ void _check_obj_cite_number_status_( } #+END_SRC -** block :block: -*** block start (open) block :start: -**** function open for block starts +*** block :block: +**** block start (open) block :start: +***** function open for block starts #+name: abs_functions_block #+BEGIN_SRC d @@ -1483,7 +1622,7 @@ void _start_block_( ) { #+END_SRC -**** block (various) curly open :curly: +***** block (various) curly open :curly: #+name: abs_functions_block #+BEGIN_SRC d @@ -1558,7 +1697,7 @@ void _start_block_( type["curly_table"] = TriState.on; #+END_SRC -**** block (various) tic open :tic: +***** block (various) tic open :tic: #+name: abs_functions_block #+BEGIN_SRC d @@ -1633,15 +1772,15 @@ void _start_block_( } #+END_SRC -**** function close for block starts +***** function close for block starts #+name: abs_functions_block #+BEGIN_SRC d } #+END_SRC -*** block continue (an open block) :continue: -**** code block (special status, deal with first) :code: +**** block continue (an open block) :continue: +***** code block (special status, deal with first) :code: #+name: abs_functions_block_code #+BEGIN_SRC d @@ -1682,9 +1821,9 @@ void _code_block_( } #+END_SRC -**** biblio block :biblio: +***** biblio block :biblio: -***** biblio tag map +****** biblio tag map #+name: abs_functions_block_biblio #+BEGIN_SRC d @@ -1709,7 +1848,7 @@ final string biblio_tag_map(string abr) { } #+END_SRC -****** +consider+ +******* +consider+ #+name: none #+BEGIN_SRC d @@ -1766,7 +1905,7 @@ final string biblio_tag_map_(string abr) { } #+END_SRC -***** biblio block +****** biblio block #+name: abs_functions_block_biblio #+BEGIN_SRC d @@ -1891,7 +2030,7 @@ void _biblio_block_( } #+END_SRC -**** TODO poem block, verse objects :poem:verse: +***** TODO poem block, verse objects :poem:verse: why extra object stuff only in poem/verse? @@ -2100,7 +2239,7 @@ void _poem_block_( } #+END_SRC -**** group block :group: +***** group block :group: #+name: abs_functions_block_group #+BEGIN_SRC d @@ -2141,7 +2280,7 @@ void _group_block_( } #+END_SRC -**** block block :block: +***** block block :block: #+name: abs_functions_block_block #+BEGIN_SRC d @@ -2182,7 +2321,7 @@ void _block_block_( } #+END_SRC -**** quote block :quote: +***** quote block :quote: #+name: abs_functions_block_quote #+BEGIN_SRC d @@ -2223,7 +2362,7 @@ void _quote_block_( } #+END_SRC -**** table block :table: +***** table block :table: #+name: abs_functions_block_table #+BEGIN_SRC d @@ -2264,7 +2403,7 @@ void _table_block_( } #+END_SRC -*** block end (close an open block): line empty, block flag :close: +**** block end (close an open block): line empty, block flag :close: #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d @@ -2508,7 +2647,7 @@ void _block_flag_line_empty_( } #+END_SRC -** book index :bookindex: +*** book index :bookindex: #+name: abs_functions_book_index #+BEGIN_SRC d @@ -2563,8 +2702,8 @@ auto _book_index_( } #+END_SRC -** heading or paragraph :heading:paragraph: -*** heading found :heading: +*** heading or paragraph :heading:paragraph: +**** heading found :heading: #+name: abs_functions_heading #+BEGIN_SRC d @@ -2654,7 +2793,7 @@ auto _heading_found_( } #+END_SRC -*** TODO heading make set :heading: +**** TODO heading make set :heading: #+name: abs_functions_heading #+BEGIN_SRC d @@ -2716,7 +2855,7 @@ auto _heading_make_set_( } #+END_SRC -*** heading match :heading: +**** heading match :heading: #+name: abs_functions_heading #+BEGIN_SRC d @@ -2865,7 +3004,7 @@ auto _heading_matched_( } #+END_SRC -*** para match :para: +**** para match :para: #+name: abs_functions_para #+BEGIN_SRC d @@ -2921,9 +3060,9 @@ auto _para_match_( } #+END_SRC -** function emitters :emitters: -*** object :object: -**** ocn :ocn: +*** function emitters :emitters: +**** object :object: +***** ocn :ocn: #+name: ao_emitters_ocn #+BEGIN_SRC d @@ -2943,7 +3082,7 @@ struct OCNemitter { } #+END_SRC -**** object inline markup munge :markup:inline: +***** object inline markup munge :markup:inline: #+name: ao_emitters_obj_inline_markup_munge #+BEGIN_SRC d @@ -3178,8 +3317,8 @@ struct ObjInlineMarkupMunge { } #+END_SRC -**** object inline markup :markup:inline: -***** open +***** object inline markup :markup:inline: +****** open #+name: ao_emitters_obj_inline_markup #+BEGIN_SRC d @@ -3188,7 +3327,7 @@ struct ObjInlineMarkup { string[string] obj_txt; #+END_SRC -***** object inline markup and anchor tags :markup:inline: +****** object inline markup and anchor tags :markup:inline: #+name: ao_emitters_obj_inline_markup_and_anchor_tags #+BEGIN_SRC d @@ -3259,7 +3398,7 @@ struct ObjInlineMarkup { } #+END_SRC -***** table of contents objects :markup:inline: +****** table of contents objects :markup:inline: #+name: ao_emitters_obj_inline_markup_table_of_contents #+BEGIN_SRC d @@ -3421,14 +3560,14 @@ struct ObjInlineMarkup { } #+END_SRC -***** private: +****** private: #+name: ao_emitters_obj_inline_markup_private #+BEGIN_SRC d private: #+END_SRC -****** make heading number and segment anchor tags if instructed :markup:inline:segment:anchor:tags: +******* make heading number and segment anchor tags if instructed :markup:inline:segment:anchor:tags: #+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d @@ -3550,13 +3689,13 @@ private: } #+END_SRC -******* unittests +******** unittests #+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d #+END_SRC -****** make segment anchor tags if not provided :markup:inline:segment:anchor:tags: +******* make segment anchor tags if not provided :markup:inline:segment:anchor:tags: #+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d @@ -3582,7 +3721,7 @@ private: } #+END_SRC -******* unittests +******** unittests #+name: ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d @@ -3632,15 +3771,15 @@ private: } #+END_SRC -***** close +****** close #+name: ao_emitters_obj_inline_markup_close #+BEGIN_SRC d } #+END_SRC -**** object attrib :attributes: -***** attributes structure open, public +***** object attrib :attributes: +****** attributes structure open, public #+name: ao_emitters_obj_attributes #+BEGIN_SRC d @@ -3648,7 +3787,7 @@ struct ObjAttributes { string[string] _obj_attrib; #+END_SRC -***** attributes structure open, public +****** attributes structure open, public #+name: ao_emitters_obj_attributes_public #+BEGIN_SRC d @@ -3720,7 +3859,7 @@ struct ObjAttributes { } #+END_SRC -***** private +****** private #+name: ao_emitters_obj_attributes_private #+BEGIN_SRC d @@ -3728,8 +3867,8 @@ struct ObjAttributes { string _obj_attributes; #+END_SRC -****** attrubutes -******* para and block +******* attrubutes +******** para and block #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3762,7 +3901,7 @@ struct ObjAttributes { } #+END_SRC -******* para +******** para #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3778,7 +3917,7 @@ struct ObjAttributes { } #+END_SRC -******* heading +******** heading #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3794,7 +3933,7 @@ struct ObjAttributes { } #+END_SRC -******* code +******** code #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3810,7 +3949,7 @@ struct ObjAttributes { } #+END_SRC -******* group +******** group #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3826,7 +3965,7 @@ struct ObjAttributes { } #+END_SRC -******* block +******** block #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3842,7 +3981,7 @@ struct ObjAttributes { } #+END_SRC -******* verse +******** verse #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3858,7 +3997,7 @@ struct ObjAttributes { } #+END_SRC -******* quote +******** quote #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3874,7 +4013,7 @@ struct ObjAttributes { } #+END_SRC -******* table +******** table #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3890,7 +4029,7 @@ struct ObjAttributes { } #+END_SRC -******* comment +******** comment #+name: ao_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d @@ -3906,7 +4045,7 @@ struct ObjAttributes { } #+END_SRC -****** set additional attribute values, parse as json +******* set additional attribute values, parse as json #+name: ao_emitters_obj_attributes_private_json #+BEGIN_SRC d @@ -3936,15 +4075,15 @@ struct ObjAttributes { } #+END_SRC -***** close +****** close #+name: ao_emitters_obj_attributes_private_close #+BEGIN_SRC d } #+END_SRC -*** book index :book:index: -**** book index nugget hash :hash:nugget: +**** book index :book:index: +***** book index nugget hash :hash:nugget: #+name: ao_emitters_book_index_nugget #+BEGIN_SRC d @@ -4023,7 +4162,7 @@ struct BookIndexNuggetHash { } #+END_SRC -**** book index (sort &) report indented :report:indented: +***** book index (sort &) report indented :report:indented: #+name: ao_emitters_book_index_report_indented #+BEGIN_SRC d @@ -4055,8 +4194,8 @@ struct BookIndexReportIndent { } #+END_SRC -**** book index (sort &) report section :report:section: -***** book index struct open +***** book index (sort &) report section :report:section: +****** book index struct open #+name: ao_emitters_book_index_report_section #+BEGIN_SRC d @@ -4066,7 +4205,7 @@ struct BookIndexReportSection { auto munge = ObjInlineMarkupMunge(); #+END_SRC -***** bookindex write section +****** bookindex write section #+name: ao_emitters_book_index_report_section #+BEGIN_SRC d @@ -4098,7 +4237,7 @@ struct BookIndexReportSection { } #+END_SRC -***** book index (sort &) build section :report:section: +****** book index (sort &) build section :report:section: #+name: ao_emitters_book_index_report_section #+BEGIN_SRC d @@ -4262,14 +4401,14 @@ struct BookIndexReportSection { } #+END_SRC -***** book index struct close +****** book index struct close #+name: ao_emitters_book_index_report_section #+BEGIN_SRC d } #+END_SRC -*** (end)notes section :endnotes:section: +**** (end)notes section :endnotes:section: #+name: ao_emitters_endnotes #+BEGIN_SRC d @@ -4280,7 +4419,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 @@ -4338,7 +4477,7 @@ struct NotesSection { } #+END_SRC -**** gathered notes +***** gathered notes #+name: ao_emitters_endnotes #+BEGIN_SRC d @@ -4360,7 +4499,7 @@ struct NotesSection { } #+END_SRC -**** endnote objects +***** endnote objects #+name: ao_emitters_endnotes #+BEGIN_SRC d @@ -4475,22 +4614,22 @@ struct NotesSection { } #+END_SRC -**** gather notes for endnote section struct close +***** gather notes for endnote section struct close #+name: ao_emitters_endnotes #+BEGIN_SRC d } #+END_SRC -*** bibliography :bibliography: -**** biblio struct open +**** bibliography :bibliography: +***** biblio struct open #+name: ao_emitters_bibliography #+BEGIN_SRC d struct Bibliography { #+END_SRC -**** biblio +***** biblio #+name: ao_emitters_bibliography #+BEGIN_SRC d @@ -4521,7 +4660,7 @@ struct Bibliography { } #+END_SRC -**** biblio unsorted complete +***** biblio unsorted complete #+name: ao_emitters_bibliography #+BEGIN_SRC d @@ -4556,7 +4695,7 @@ struct Bibliography { } #+END_SRC -**** biblio sort +***** biblio sort #+name: ao_emitters_bibliography #+BEGIN_SRC d @@ -4577,7 +4716,7 @@ struct Bibliography { } #+END_SRC -**** biblio debug +***** biblio debug #+name: ao_emitters_bibliography #+BEGIN_SRC d @@ -4592,15 +4731,15 @@ struct Bibliography { } #+END_SRC -**** biblio struct close +***** biblio struct close #+name: ao_emitters_bibliography #+BEGIN_SRC d } #+END_SRC -*** node structure metadata :structure:metadata:node: -**** metadata node struct open +**** node structure metadata :structure:metadata:node: +***** metadata node struct open #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -4610,7 +4749,7 @@ struct NodeStructureMetadata { int[string] p_; // p_ parent_ #+END_SRC -**** TODO node metadata emitter +***** TODO node metadata emitter #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -4681,7 +4820,7 @@ struct NodeStructureMetadata { } #+END_SRC -**** TODO node metadata emitter heading +***** TODO node metadata emitter heading #+name: ao_emitters_metadata #+BEGIN_SRC d @@ -4863,15 +5002,15 @@ struct NodeStructureMetadata { } #+END_SRC -**** metadata node struct close +***** metadata node struct close #+name: ao_emitters_metadata #+BEGIN_SRC d } #+END_SRC -** function assertions :assertions: -*** mixin template: assertions on markup document structure :doc_structure: +*** function assertions :assertions: +**** mixin template: assertions on markup document structure :doc_structure: #+name: abs_functions_assertions #+BEGIN_SRC d @@ -5052,7 +5191,7 @@ auto assertions_doc_structure( } #+END_SRC -*** mixin template: assertions on blocks :blocks: +**** mixin template: assertions on blocks :blocks: #+name: abs_functions_assertions #+BEGIN_SRC d @@ -5080,7 +5219,7 @@ auto assertions_flag_types_block_status_none_or_closed(int[string] type) { } #+END_SRC -* Object Setter :abstract:object: +* 2. Object Setter :abstract:object: set abstracted objects for downstream processing @@ -5357,142 +5496,26 @@ auto contents_block_obj_cite_number_string( } #+END_SRC -* Tangles (code structure) :tangle:io:file: -** ao abstract doc source: :ao_abstract_doc_source.d: - -#+BEGIN_SRC d :tangle ../src/sdp/ao_abstract_doc_source.d -/++ - document abstraction: - abstraction of sisu markup for downstream processing - ao_abstract_doc_source.d -+/ -template SiSUdocAbstraction() { - private: - struct Abstraction { - /+ ↓ abstraction imports +/ - <> - /+ ↓ abstraction mixins +/ - <> - /+ ↓ abstraction struct init +/ - <> - /+ ↓ abstract marked up document +/ - auto abstract_doc_source( - char[][] markup_sourcefile_content, - string[string][string] dochead_make_aa, - string[string][string] dochead_meta_aa, - bool[string] opt_action_bool, - ) { - /+ ↓ abstraction init +/ - <> - /+ abstraction init ↑ +/ - /+ ↓ loop markup document/text line by line +/ - srcDocLoop: - foreach (line; markup_sourcefile_content) { - /+ ↓ markup document/text line by line +/ - <> - if (type["code"] == TriState.on) { - <> - } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { - /+ object other than "code block" object - (includes regular text paragraph, headings & blocks other than code) +/ - <> - } else { - /+ not within a block group +/ - <> - if (matchFirst(line, rgx.block_open)) { - <> - } else if (!line.empty) { - /+ line not empty +/ - /+ non blocks (headings, paragraphs) & closed blocks +/ - <> - } else if (type["blocks"] == TriState.closing) { - /+ line empty, with blocks flag +/ - <> - } else { - /+ line empty +/ - /+ line.empty, post contents, empty variables: +/ - <> - } // close else for line empty - } // close else for not the above - } // close after non code, other blocks or regular text - <> - } /+ ← closed: loop markup document/text line by line +/ - /+ ↓ post loop markup document/text +/ - <> - /+ post loop markup document/text ↑ +/ - } /+ ← closed: abstract doc source +/ - /+ ↓ abstraction functions +/ - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - /+ abstraction functions ↑ +/ - /+ ↓ abstraction function emitters +/ - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - <> - /+ abstraction functions emitters ↑ +/ - /+ ↓ abstraction functions assertions +/ - <> - /+ abstraction functions assertions ↑ +/ - } /+ ← closed: struct Abstraction +/ -} /+ ← closed: template SiSUdocAbstraction +/ -#+END_SRC - -** ao object setter: :ao_object_setter.d: +* Notes +** abstract document structure -#+BEGIN_SRC d :tangle ../src/sdp/ao_object_setter.d -/++ - object setter: - setting of sisu objects for downstream processing - ao_object_setter.d -+/ -template ObjectSetter() { - /+ structs +/ - <> - /+ structs setter +/ - struct ObjectAbstractSet { - import std.conv : to; - <> - <> - <> - <> - <> - <> - <> - } -} +#+BEGIN_SRC d +auto document_abstract_objects = ( + "head": the_document_head_section, // split from rest of content + "toc_seg": the_table_of_contents_section["seg"], // table of contents for seg + "toc_scroll": the_table_of_contents_section["scroll"], // table of contents for scroll + "body": the_document_body_section, + "endnotes_seg": the_endnotes_section["seg"], + "endnotes_scroll": the_endnotes_section["scroll"], + "glossary": the_glossary_section, + "bibliography": the_bibliography_section, + "bookindex_scroll": the_bookindex_section["scroll"], + "bookindex_seg": the_bookindex_section["seg"], + "blurb": the_blurb_section, +); #+END_SRC -* TODO work on +** TODO work on - bespoke struct for sisu objects to replace JSON strings - book index *sort* fix (Aa-Zz instead of A-Za-z) -- cgit v1.2.3