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 ++++++++++++++++++++------------------- org/ao_conf_make_meta.org | 199 ++++++++--------- org/ao_defaults.org | 53 +++-- org/ao_output_debugs.org | 65 +++--- org/ao_read_source_files.org | 273 ++++++++++++++--------- org/compile_time_info.org | 25 ++- org/output.org | 158 +++++++------ org/sdp.org | 129 +++++------ src/sdp/ao_abstract_doc_source.d | 6 + views/version.txt | 2 +- 10 files changed, 729 insertions(+), 650 deletions(-) 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) diff --git a/org/ao_conf_make_meta.org b/org/ao_conf_make_meta.org index d3413de..bf39340 100644 --- a/org/ao_conf_make_meta.org +++ b/org/ao_conf_make_meta.org @@ -13,7 +13,93 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 0. sdlang to AA +* 0. Code Outline / Structure (tangles) :tangle: +** 1. Header Hub :ao_markup_header_extract: + +#+BEGIN_SRC d :tangle ../src/sdp/ao_conf_make_meta.d +/++ + extract native/orig header return associative array
+ + the header is passed as text (lopped off top of a sisu markup file until the + required first heading ^A~), determine whether is a native header or sdlang one + with a regex check if whether it contains the "native header" required tag/field + @title: then process accordingly as a "native header" or "sdlang header" + converting the metadata and make instructions to a common json format used by + program internally. Moved to associative array. ++/ +template SiSUheaderExtractHub() { + private import + std.regex; + private import + ao_rgx; + struct HeaderDocMetadataAndMake { + mixin SiSUheaderExtractNative; + mixin SiSUheaderExtractSDLang; + auto rgx = Rgx(); + private auto headerContentAA(char[] header_src, string[string][string] conf_doc_make_aa) { + auto head_native = HeaderDocMetadataAndMakeNativeToAA(); + auto head_sdlang = HeaderExtractSDL(); + auto header_make_and_meta_tuple = (match(header_src, rgx.native_header_meta_title)) + ? (head_native.headerNativeToAA(header_src)) + : (head_sdlang.headerSDLangToAA(header_src, conf_doc_make_aa)); + static assert(!isTypeTuple!(header_make_and_meta_tuple)); + static assert(header_make_and_meta_tuple.length==2); + return header_make_and_meta_tuple; + } + } +} +#+END_SRC + +** 2a. Header Native :ao_markup_header_extract_native: + +#+BEGIN_SRC d :tangle ../src/sdp/ao_conf_make_meta_native.d +/++ + native headers using
@title:
:subtitle:
type tags
+ extract native/orig header return associative array ++/ +template SiSUheaderExtractNative() { + private import + std.exception, + std.regex, + std.utf, + std.conv : to; + private import + ao_rgx; + struct HeaderDocMetadataAndMakeNativeToAA { + mixin SiSUregisters; + mixin SiSUrgxInitFlags; + mixin RgxInit; + auto rgx = Rgx(); + enum State { off, on } + string hm, hs; + <> + } +} +#+END_SRC + +** 2b. Header SDLang :ao_markup_header_extract_sdlang: + +#+BEGIN_SRC d :tangle ../src/sdp/ao_conf_make_meta_sdlang.d +/++ + sdlang headers
+ extract sdlang header return sdlang ++/ +template SiSUheaderExtractSDLang() { + private import + std.regex; + private import + ao_rgx; + struct HeaderExtractSDL { + mixin SiSUregisters; + mixin RgxInit; + auto rgx = Rgx(); + <> + <> + } +} +#+END_SRC + +* A. sdlang to AA #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -36,7 +122,7 @@ private auto sdlangToAAmake(string[string][string] conf, Tag conf_sdlang) { } #+END_SRC -* A. conf settings sdlang +* B. conf settings sdlang #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -46,7 +132,7 @@ private auto configSettingsSDLangToAAmake(Tag conf_sdlang) { } #+END_SRC -* B. conf make sdlang +* C. conf make sdlang #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -191,9 +277,10 @@ private auto documentMakeSDLangToAAmake(Tag document_make_sdlang) { } #+END_SRC -* C.a. header native :header:native: +* D. header :header: +** a. header native :header:native: -** native header document metadata in associative array :aa: +*** native header document metadata in associative array :aa: #+name: ao_markup_header_extract_native #+BEGIN_SRC d @@ -385,7 +472,7 @@ body { } #+END_SRC -** native header extract to string object :string: +*** native header extract to string object :string: #+name: ao_markup_header_extract_native #+BEGIN_SRC d @@ -429,7 +516,7 @@ private auto native_header_extract( } #+END_SRC -** native header reset states :reset: +*** native header reset states :reset: #+name: ao_markup_header_extract_native #+BEGIN_SRC d @@ -447,7 +534,7 @@ auto header_reset_states_common( } #+END_SRC -** hub: native header start :hub: +*** hub: native header start :hub: #+name: ao_markup_header_extract_native #+BEGIN_SRC d @@ -502,8 +589,8 @@ private auto headerNativeToAA(in char[] src_header) { } #+END_SRC -* C.b. header sdlang :header:sdl: -** sdlang header parse and extract root Tag :sdlang:root:tag: +** b. header sdlang :header:sdl: +*** sdlang header parse and extract root Tag :sdlang:root:tag: #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -535,7 +622,7 @@ final private auto headerMakeSDLang(in string src_header) { } #+END_SRC -** sdlang header get :sdlang:get:src: +*** sdlang header get :sdlang:get:src: #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -564,7 +651,7 @@ private auto headerSDLangGet(in char[] src_header) { } #+END_SRC -** sdlang header to associative array make sdlTag in :sdlang:aa: +*** sdlang header to associative array make sdlTag in :sdlang:aa: #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -602,7 +689,7 @@ private auto headerSDLangToAAmake(Tag header_sdlang, string[string][string] doch } #+END_SRC -** hub: get sdlang header and convert to associative array :hub:sdlang:aa: +*** hub: get sdlang header and convert to associative array :hub:sdlang:aa: #+name: ao_conf_make_meta_sdl #+BEGIN_SRC d @@ -612,89 +699,3 @@ private auto headerSDLangToAA(char[] header_sdlang_src, string[string][string] c return header_aa_tuple; } #+END_SRC - -* tangles (code structure) :tangle: -** 1. Header Hub :ao_markup_header_extract: - -#+BEGIN_SRC d :tangle ../src/sdp/ao_conf_make_meta.d -/++ - extract native/orig header return associative array
- - the header is passed as text (lopped off top of a sisu markup file until the - required first heading ^A~), determine whether is a native header or sdlang one - with a regex check if whether it contains the "native header" required tag/field - @title: then process accordingly as a "native header" or "sdlang header" - converting the metadata and make instructions to a common json format used by - program internally. Moved to associative array. -+/ -template SiSUheaderExtractHub() { - private import - std.regex; - private import - ao_rgx; - struct HeaderDocMetadataAndMake { - mixin SiSUheaderExtractNative; - mixin SiSUheaderExtractSDLang; - auto rgx = Rgx(); - private auto headerContentAA(char[] header_src, string[string][string] conf_doc_make_aa) { - auto head_native = HeaderDocMetadataAndMakeNativeToAA(); - auto head_sdlang = HeaderExtractSDL(); - auto header_make_and_meta_tuple = (match(header_src, rgx.native_header_meta_title)) - ? (head_native.headerNativeToAA(header_src)) - : (head_sdlang.headerSDLangToAA(header_src, conf_doc_make_aa)); - static assert(!isTypeTuple!(header_make_and_meta_tuple)); - static assert(header_make_and_meta_tuple.length==2); - return header_make_and_meta_tuple; - } - } -} -#+END_SRC - -** 2a. Header Native :ao_markup_header_extract_native: - -#+BEGIN_SRC d :tangle ../src/sdp/ao_conf_make_meta_native.d -/++ - native headers using
@title:
:subtitle:
type tags
- extract native/orig header return associative array -+/ -template SiSUheaderExtractNative() { - private import - std.exception, - std.regex, - std.utf, - std.conv : to; - private import - ao_rgx; - struct HeaderDocMetadataAndMakeNativeToAA { - mixin SiSUregisters; - mixin SiSUrgxInitFlags; - mixin RgxInit; - auto rgx = Rgx(); - enum State { off, on } - string hm, hs; - <> - } -} -#+END_SRC - -** 2b. Header SDLang :ao_markup_header_extract_sdlang: - -#+BEGIN_SRC d :tangle ../src/sdp/ao_conf_make_meta_sdlang.d -/++ - sdlang headers
- extract sdlang header return sdlang -+/ -template SiSUheaderExtractSDLang() { - private import - std.regex; - private import - ao_rgx; - struct HeaderExtractSDL { - mixin SiSUregisters; - mixin RgxInit; - auto rgx = Rgx(); - <> - <> - } -} -#+END_SRC diff --git a/org/ao_defaults.org b/org/ao_defaults.org index 39cfff8..d991dec 100644 --- a/org/ao_defaults.org +++ b/org/ao_defaults.org @@ -13,8 +13,32 @@ #+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: +** 1. defaults: :ao_defaults.d: -* default templates :template:defaults: +#+name: tangle_ao_defaults +#+BEGIN_SRC d :tangle ../src/sdp/ao_defaults.d +/++ + default settings ++/ +<> +#+END_SRC + +** 2. rgx: :ao_rgx.d: + +#+name: tangle_ao_rgx +#+BEGIN_SRC d :tangle ../src/sdp/ao_rgx.d +/++ + regex: regular expressions used in sisu document parser ++/ +template RgxInit() { + struct Rgx { + <> + } +} +#+END_SRC + +* 1. default templates :template:defaults: [[./sdp.org][sdp]] [[./][org/]] ** template: settings metadata associative array indexes :settings: @@ -483,7 +507,7 @@ template InternalMarkup() { } #+END_SRC -* regex ctRegex :regex: +* 2. regex ctRegex :regex: [[./sdp.org][sdp]] [[./][org/]] http://dlang.org/phobos/std_regex.html - Plain string, in which case it's compiled to bytecode before matching. @@ -872,28 +896,3 @@ string[string] scr_txt_marker = [ "black" : "\033[30m*\033[0m " ]; #+END_SRC - -* tangles (code structure) :tangle: -** defaults: :ao_defaults.d: - -#+name: tangle_ao_defaults -#+BEGIN_SRC d :tangle ../src/sdp/ao_defaults.d -/++ - default settings -+/ -<> -#+END_SRC - -** rgx: :ao_rgx.d: - -#+name: tangle_ao_rgx -#+BEGIN_SRC d :tangle ../src/sdp/ao_rgx.d -/++ - regex: regular expressions used in sisu document parser -+/ -template RgxInit() { - struct Rgx { - <> - } -} -#+END_SRC diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org index c576264..bea972e 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_output_debugs.org @@ -12,7 +12,39 @@ #+FILETAGS: :sdp:rel:ao: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) -* output debugs :debug:output: +[[./sdp.org][sdp]] [[./][org/]] +* 0. Code Outline / Structure (tangles) :tangle: +** code structure: :ao_output_debugs.d: + +#+name: tangle_ao_output_debugs +#+BEGIN_SRC d :tangle ../src/sdp/ao_output_debugs.d +/++ + output debugs ++/ +template SiSUoutputDebugs() { + struct SDPoutputDebugs { + auto abstract_doc_source_debugs(S)( + auto ref const S contents, + string[][string] document_section_keys_sequenced, + string[] html_segnames, + string[string][string] dochead_make, + string[string][string] dochead_meta, + string fn_src, + bool[string] opt_action_bool + ) { + mixin RgxInit; + mixin InternalMarkup; + <> + <> + <> + <> + } + } + } +} +#+END_SRC + +* 1. output debugs :debug:output: [[./sdp.org][sdp]] [[./][org/]] ** initialize :report: @@ -824,34 +856,3 @@ debug(checkdoc) { } } #+END_SRC - -* tangles :tangle: -** code structure: :ao_output_debugs.d: - -#+name: tangle_ao_output_debugs -#+BEGIN_SRC d :tangle ../src/sdp/ao_output_debugs.d -/++ - output debugs -+/ -template SiSUoutputDebugs() { - struct SDPoutputDebugs { - auto abstract_doc_source_debugs(S)( - auto ref const S contents, - string[][string] document_section_keys_sequenced, - string[] html_segnames, - string[string][string] dochead_make, - string[string][string] dochead_meta, - string fn_src, - bool[string] opt_action_bool - ) { - mixin RgxInit; - mixin InternalMarkup; - <> - <> - <> - <> - } - } - } -} -#+END_SRC diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org index 77c3266..3a72106 100644 --- a/org/ao_read_source_files.org +++ b/org/ao_read_source_files.org @@ -13,9 +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/]] -* get config file :config: -** [#A] read config file, source string :string: -*** config file (conf.sdl & sisu_document_make) :file:config: +* 0. Code Outline / Structure (tangles) :tangle: +** 1. config files (conf.sdl & sisu_document_make) :ao_config_files: +*** config files, read in + +#+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d +/++ + read configuration files
+ - read config files
+ ao_config_files.d ++/ +template SiSUconfigIn() { + private import + std.exception, + std.stdio, + std.utf, + std.conv : to; + private + struct ConfigIn { + private import std.file; + <> + } +} +#+END_SRC + +*** config files get sdlang root tag + +#+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d +/+ + ++/ +template SiSUconfigSDLang() { + struct ConfigSDLangRootTag { + <> + } +} +#+END_SRC + +*** config files hub + +#+BEGIN_SRC d :tangle ../src/sdp/ao_read_config_files.d +/+ + ++/ +template SiSUconfigSDLangHub() { + mixin SiSUconfigIn; + mixin SiSUconfigSDLang; + struct ConfigHub { + <> + } +} +#+END_SRC + +** 2. ao_markup_source_raw.d: :ao_markup_source_raw: + +#+BEGIN_SRC d :tangle ../src/sdp/ao_read_source_files.d +/++ + module ao_read_source_files;
+ - open markup files
+ - if master file scan for addional files to import/insert ++/ +template SiSUmarkupRaw() { + private import + std.exception, + std.regex, + std.stdio, + std.utf, + std.conv : to; + private import + ao_rgx; // ao_defaults.d + mixin RgxInit; + auto rgx = Rgx(); + struct MarkupRaw { + final sourceContent(in string fn_src) { + auto raw = MarkupRawUnit(); + auto source_txt_str = + raw.markupSourceReadIn(fn_src); + return source_txt_str; + } + final auto sourceContentSplitIntoHeaderAndBody(in string source_txt_str, in string fn_src="") { + auto raw = MarkupRawUnit(); + auto t = + raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); + auto header_raw = t[0]; + auto sourcefile_body_content = t[1]; + if (match(fn_src, rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise + auto ins = Inserts(); + sourcefile_body_content = + ins.scan_master_src_for_insert_files_and_import_content(sourcefile_body_content, fn_src); + } + t = tuple( + header_raw, + sourcefile_body_content + ); + static assert(t.length==2); + return t; + } + } + private + struct MarkupRawUnit { + private import std.file; + <> + <> + <> + <> + <> + <> + } + struct Inserts { + private import ao_defaults; // ao_defaults.d + auto scan_subdoc_source( + char[][] markup_sourcefile_insert_content, + string fn_src + ) { + mixin SiSUrgxInitFlags; + <> + foreach (line; markup_sourcefile_insert_content) { + <> + } // end src subdoc (inserts) loop + <> + } + auto scan_master_src_for_insert_files_and_import_content( + char[][] sourcefile_body_content, + string fn_src + ) { + mixin SiSUrgxInitFlags; + <> + foreach (line; sourcefile_body_content) { + <> + } // end src doc loop + <> + } + } +} +#+END_SRC + +INSERTS? +[[./ao_scan_inserts.org][ao_scan_inserts]] +WORK AREA + +* 1. get config file :config: +** read config file, source string (conf.sdl & sisu_document_make) :file:config: #+name: ao_config_file_in #+BEGIN_SRC d @@ -51,7 +189,7 @@ final private string readInConfigFile(string conf_sdl) { } #+END_SRC -*** config file get sdl root tag :file:conf:sdlang: +** config file get sdl root tag :file:conf:sdlang: #+name: ao_config_file_sdlang #+BEGIN_SRC d @@ -75,7 +213,7 @@ private auto configSDLangRootTag(string configuration, string conf_sdl_filename) } #+END_SRC -*** config file (conf.sdl & sisu_document_make) :file:config:hub: +** config file (conf.sdl & sisu_document_make) :file:config:hub: #+name: ao_config_file_sdlang_hub #+BEGIN_SRC d @@ -88,8 +226,9 @@ final private auto configSDLang(string conf_sdl) { } #+END_SRC -* get markup source, read file :source:markup: -** [#A] read file, source string :string: +* 2. get markup source, read file +** get markup source, read file :source:markup: +*** [#A] read file, source string :string: #+name: ao_markup_source_raw_read_file_source_string #+BEGIN_SRC d @@ -117,13 +256,13 @@ final private string readInMarkupSource(in string fn_src) { } #+END_SRC -*** notes +**** notes source_txt_str = readText(fn_src); // ok catch (ErrnoException ex) { } -** [#A] document header & content, array.length == 2 :array: +*** [#A] document header & content, array.length == 2 :array: here you split document header and body, an array.length == 2 split is on first match of level A~ (which is required) @@ -144,7 +283,7 @@ final private char[][] header0Content1(in string src_text) { } #+END_SRC -** source line array :array: +*** source line array :array: #+name: ao_markup_source_raw_source_line_array #+BEGIN_SRC d @@ -155,11 +294,11 @@ final private char[][] markupSourceLineArray(in char[] src_text) { } #+END_SRC -** source content raw line array :array: +*** source content raw line array :array: - used for regular .sst files; master .ssm files and; .ssi inserts - regex is passed for relevant enforce match -*** read in file +**** read in file #+name: ao_markup_source_raw_read_in_file #+BEGIN_SRC d @@ -174,7 +313,7 @@ auto markupSourceReadIn(in string fn_src) { } #+END_SRC -*** tuple header and body content +**** tuple header and body content #+name: ao_markup_source_raw_tuple_of_header_and_body #+BEGIN_SRC d @@ -191,7 +330,7 @@ auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { } #+END_SRC -*** get insert source line array +**** get insert source line array #+name: ao_markup_source_raw_get_insert_source_line_array #+BEGIN_SRC d @@ -206,11 +345,11 @@ final char[][] getInsertMarkupSourceContentRawLineArray(in string fn_src, Regex! } #+END_SRC -* get markup source, master file & inserts :masterfile:inserts: +** get markup source, master file & inserts :masterfile:inserts: [[./sdp.org][sdp]] [[./][org/]] -** scan inserts (sub-document) source :scan_insert_src: -*** scan subdoc source +*** scan inserts (sub-document) source :scan_insert_src: +**** scan subdoc source #+name: ao_inserts_scan #+BEGIN_SRC d @@ -220,7 +359,7 @@ auto fn_pth_full = match(fn_src, rgx.src_pth); auto markup_src_file_path = fn_pth_full.captures[1]; #+END_SRC -*** loop insert (sub-document) +**** loop insert (sub-document) #+name: ao_inserts_scan_loop #+BEGIN_SRC d @@ -296,15 +435,15 @@ if (type1["curly_code"] == 1) { } #+END_SRC -*** post loop +**** post loop #+name: ao_inserts_scan_post #+BEGIN_SRC d return contents_insert; #+END_SRC -** scan document source :scan_src: -*** scan doc source +*** scan document source :scan_src: +**** scan doc source #+name: ao_master_doc_scan_for_insert_filenames #+BEGIN_SRC d @@ -314,7 +453,7 @@ auto fn_pth_full = match(fn_src, rgx.src_pth); auto markup_src_file_path = fn_pth_full.captures[1]; #+END_SRC -*** loop master scan for inserts (insert documents) +**** loop master scan for inserts (insert documents) #+name: ao_master_doc_scan_for_insert_filenames_loop #+BEGIN_SRC d @@ -375,7 +514,7 @@ if (type["curly_code"] == 1) { } #+END_SRC -*** post loop +**** post loop #+name: ao_master_doc_scan_for_insert_filenames_post #+BEGIN_SRC d @@ -386,94 +525,6 @@ debug(insert) { // insert file return contents; #+END_SRC -* tangles (code structure) :tangle: -** ao_markup_source_raw.d: :ao_markup_source_raw: - -#+BEGIN_SRC d :tangle ../src/sdp/ao_read_source_files.d -/++ - module ao_read_source_files;
- - open markup files
- - if master file scan for addional files to import/insert -+/ -template SiSUmarkupRaw() { - private import - std.exception, - std.regex, - std.stdio, - std.utf, - std.conv : to; - private import - ao_rgx; // ao_defaults.d - mixin RgxInit; - auto rgx = Rgx(); - struct MarkupRaw { - final sourceContent(in string fn_src) { - auto raw = MarkupRawUnit(); - auto source_txt_str = - raw.markupSourceReadIn(fn_src); - return source_txt_str; - } - final auto sourceContentSplitIntoHeaderAndBody(in string source_txt_str, in string fn_src="") { - auto raw = MarkupRawUnit(); - auto t = - raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); - auto header_raw = t[0]; - auto sourcefile_body_content = t[1]; - if (match(fn_src, rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise - auto ins = Inserts(); - sourcefile_body_content = - ins.scan_master_src_for_insert_files_and_import_content(sourcefile_body_content, fn_src); - } - t = tuple( - header_raw, - sourcefile_body_content - ); - static assert(t.length==2); - return t; - } - } - private - struct MarkupRawUnit { - private import std.file; - <> - <> - <> - <> - <> - <> - } - struct Inserts { - private import ao_defaults; // ao_defaults.d - auto scan_subdoc_source( - char[][] markup_sourcefile_insert_content, - string fn_src - ) { - mixin SiSUrgxInitFlags; - <> - foreach (line; markup_sourcefile_insert_content) { - <> - } // end src subdoc (inserts) loop - <> - } - auto scan_master_src_for_insert_files_and_import_content( - char[][] sourcefile_body_content, - string fn_src - ) { - mixin SiSUrgxInitFlags; - <> - foreach (line; sourcefile_body_content) { - <> - } // end src doc loop - <> - } - } -} -#+END_SRC - -INSERTS? -[[./ao_scan_inserts.org][ao_scan_inserts]] -WORK AREA - ** config files (conf.sdl & sisu_document_make) :ao_config_files: *** config files, read in diff --git a/org/compile_time_info.org b/org/compile_time_info.org index 2dc5eba..ee143eb 100644 --- a/org/compile_time_info.org +++ b/org/compile_time_info.org @@ -12,6 +12,19 @@ #+FILETAGS: :sdp:niu:compile:info: #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) +[[./sdp.org][sdp]] [[./][org/]] +* Code Outline / Structure (tangles) :tangle: +** compile_time_info: :compile_time_info.d: + +#+begin_src d :tangle ../src/sdp/compile_time_info.d +/++ + compile_time_info ++/ +template CompileTimeInfo() { + <> +} +#+end_src + * compilation info :compile: [[../maker.org][maker.org makefile]] [[./sdp.org][sdp hub]] [[./][org/]] @@ -90,15 +103,3 @@ version(D_LP64) { enum bits = "32 bit"; } #+END_SRC - -* tangles :tangle: -** compile_time_info: :compile_time_info.d: - -#+begin_src d :tangle ../src/sdp/compile_time_info.d -/++ - compile_time_info -+/ -template CompileTimeInfo() { - <> -} -#+end_src diff --git a/org/output.org b/org/output.org index 8331a59..924540c 100644 --- a/org/output.org +++ b/org/output.org @@ -13,10 +13,84 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* output :output: +* Code Outline / Structure (tangles) :tangle: +** output hub template file [#A] + +#+BEGIN_SRC d :tangle ../src/sdp/output_hub.d +/++ + output hub
+ check & generate output types requested ++/ +template SiSUoutputHub() { + struct SDPoutput { + void hub(S)( + auto ref const S contents, + string[][string] document_section_keys_sequenced, + string[] html_segnames, + string[string][string] dochead_make, + string[string][string] dochead_meta, + string fn_src, + bool[string] opt_action_bool + ) { + auto rgx = Rgx(); + if (opt_action_bool["source"]) { + writeln("sisupod source"); + } + if (opt_action_bool["sisupod"]) { + writeln("sisupod source"); + } + if (opt_action_bool["text"]) { + writeln("text processing"); + } + if (opt_action_bool["html"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.scroll( + contents, + document_section_keys_sequenced, + dochead_make, + dochead_meta, + fn_src, + opt_action_bool + ); + } + if (opt_action_bool["epub"]) { + writeln("epub processing"); + } + if (opt_action_bool["pdf"]) { + writeln("pdf processing"); + } + if (opt_action_bool["odt"]) { + writeln("odt processing"); + } + if (opt_action_bool["sqlite"]) { + writeln("sqlite processing"); + } + if (opt_action_bool["postgresql"]) { + writeln("pgsql processing"); + } + } + } +} +#+END_SRC + +** templates outpt types (file, db)s +*** html + +#+BEGIN_SRC d :tangle ../src/sdp/output_html.d +template SiSUoutputHTML() { + struct SDPoutputHTML { + <> + <> + } +} +#+END_SRC + +* output functions :output: ** text :text: ** html [#A] :html: -*** html +*** html text objects **** html functions ***** html @@ -1603,86 +1677,6 @@ auto css_write() { ** odt :odt: ** sqlite [#B] :sqlite: ** pgsql :pgsql: -* tangles :tangle: -** code structure: :output.d: - -**** hub - -#+BEGIN_SRC d :tangle ../src/sdp/output_hub.d -/++ - output hub
- check & generate output types requested -+/ -template SiSUoutputHub() { - struct SDPoutput { - void hub(S)( - auto ref const S contents, - string[][string] document_section_keys_sequenced, - string[] html_segnames, - string[string][string] dochead_make, - string[string][string] dochead_meta, - string fn_src, - bool[string] opt_action_bool - ) { - auto rgx = Rgx(); - if (opt_action_bool["source"]) { - writeln("sisupod source"); - } - if (opt_action_bool["sisupod"]) { - writeln("sisupod source"); - } - if (opt_action_bool["text"]) { - writeln("text processing"); - } - if (opt_action_bool["html"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.scroll( - contents, - document_section_keys_sequenced, - dochead_make, - dochead_meta, - fn_src, - opt_action_bool - ); - } - if (opt_action_bool["epub"]) { - writeln("epub processing"); - } - if (opt_action_bool["pdf"]) { - writeln("pdf processing"); - } - if (opt_action_bool["odt"]) { - writeln("odt processing"); - } - if (opt_action_bool["sqlite"]) { - writeln("sqlite processing"); - } - if (opt_action_bool["postgresql"]) { - writeln("pgsql processing"); - } - } - } -} -#+END_SRC - -**** html - -#+BEGIN_SRC d :tangle ../src/sdp/output_html.d -template SiSUoutputHTML() { - struct SDPoutputHTML { - <> - <> - } -} -#+END_SRC - -*** notes - -0.6.6 using nested structs hub and outputs within it e.g. html -0.6.5 dmd had problems compiling with hub and outputs such as html as separate structs see comment - * +other+ ** example head diff --git a/org/sdp.org b/org/sdp.org index fad6f12..e359c65 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -13,8 +13,8 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[../maker.org][maker.org makefile]] [[./][org/]] - -* TODO version.txt: set version (sisu document parser) :version: +* 0. Code Outline / Structure (tangles) :tangle: +** TODO version.txt: set version (sisu document parser) :version: #+NAME: version_txt #+BEGIN_SRC d :tangle ../views/version.txt @@ -24,10 +24,52 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 9, 4); +enum ver = Version(0, 9, 6); +#+END_SRC + +** TODO sdp src/sdp.d :sdp.d: + +#+BEGIN_SRC d :tangle ../src/sdp.d :shebang #!/usr/bin/env rdmd +/+ + sdp ++/ +<> +<> +<> +<> +<> +<> +/++ A SiSU document parser writen in D. +/ +void main(string[] args) { + <> + <> + <> + foreach(fn_src; fns_src) { + if (!empty(fn_src)) { + <> + <> + <> + <> + <> + <> + <> + <> + } else { + <> + } + } +} +unittest { + /++ + name "sdp" + description "A SiSU document parser writen in D." + homepage "http://sisudoc.org" + +/ +} #+END_SRC * sdp.d sisu document parser :sdp.d: + - deal with imports - get options - get command line instructions @@ -494,47 +536,8 @@ writeln("no recognized filename"); break; #+END_SRC -* tangles (code structure) :tangle: -** TODO sdp src/sdp.d :sdp.d: - -#+BEGIN_SRC d :tangle ../src/sdp.d :shebang #!/usr/bin/env rdmd -/+ - sdp -+/ -<> -<> -<> -<> -<> -<> -/++ A SiSU document parser writen in D. +/ -void main(string[] args) { - <> - <> - <> - foreach(fn_src; fns_src) { - if (!empty(fn_src)) { - <> - <> - <> - <> - <> - <> - <> - <> - } else { - <> - } - } -} -unittest { - /++ - name "sdp" - description "A SiSU document parser writen in D." - homepage "http://sisudoc.org" - +/ -} -#+END_SRC +* Notes +** directory structure, program file arrangement ├── src │   ├── sdp.d @@ -554,11 +557,11 @@ unittest { ├── views │   └── version.txt -* TODO work on -** program dir structure +** TODO work on +*** program dir structure figure out best program dir structure for dub and compilers, issue with rdmd -** sisu document structure +*** sisu document structure |---------------------+------------------------------------------+------------------------+------------------------+--------| | | | | links | | @@ -615,16 +618,16 @@ figure out best program dir structure for dub and compilers, issue with rdmd - seg ../[fn]/#[ocn] - metadata -** config :config: +*** config :config: using sdlang in sdp -*** sdp config and header? file format? sdl ? yml ? json ? :sdl:sdlang: +**** sdp config and header? file format? sdl ? yml ? json ? :sdl:sdlang: [[https://sdlang.org/][SDL: Simple Declarative Language]] [[http://sdl4r.rubyforge.org/syntaxhighlighter_brush.html][highlighter]] https://github.com/Abscissa/SDLang-D https://github.com/Abscissa/SDLang-D/blob/master/HOWTO.md -**** build/ compile +***** build/ compile The recommended way to use SDLang-D is via DUB. Just add a dependency to sdlang-d in your project's dub.json or dub.sdl file as shown here. Then simply @@ -647,7 +650,7 @@ git clone https://github.com/abscissa/libInputVisitor -I{path to SDLang-D}/src -I{path to libInputVisitor}/src #+END_SRC -**** Importing +***** Importing To use SDL, first import the module sdlang: @@ -661,15 +664,15 @@ If you're not using DUB, then you must also include the path the SDLang-D source rdmd --build-only -I{path to sdlang}/src -I{path to libInputVisitor}/src {other flags} yourProgram.d #+END_SRC -**** misc +***** misc http://forum.dlang.org/thread/hphtqkkmrfnlcipnxzai@forum.dlang.org http://forum.dlang.org/thread/gnfctbuhiemidetngrzi@forum.dlang.org?page=23#post-rlxlfveyyzgewhkxhhta:40forum.dlang.org -*** other links +**** other links http://semitwist.com/sdlang-d-docs/v0.9.3/sdlang.html http://semitwist.com/sdlang-d-docs/ -** markup -*** code +*** markup +**** code #+BEGIN_SRC txt :tangle no code.ruby{ @@ -693,7 +696,7 @@ code.d{ }code #+END_SRC -** src dir structure & files +*** src dir structure & files #+BEGIN_SRC txt :tangle no tree /home/ralph/sisu_www/current/src/democratizing_innovation.eric_von_hippel.sst @@ -715,13 +718,13 @@ democratizing_innovation.eric_von_hippel.sst #+END_SRC -** read markup files -*** regular .sst +*** read markup files +**** regular .sst relatively straight forward -*** master .ssm +**** master .ssm master files have been able to read in inser files .ssi and regular files .sst -**** reading in .ssi files is straightforward -**** reading in .sst files is more problematic +***** reading in .ssi files is straightforward +***** reading in .sst files is more problematic .sst files have their own root (structure) either - the root needs to be disabled - not used @@ -735,8 +738,8 @@ or file would have to read and available for use in its header A that is demoted to B -** processing files, currently using utf8 -** check +*** processing files, currently using utf8 +*** check #+BEGIN_SRC text ./.sisu ./_sisu ~/.sisu /etc/.sisu diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 5431b3d..944a720 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -2449,6 +2449,7 @@ template SiSUdocAbstraction() { invariant() { } } + /+ +/ struct ObjInlineMarkupMunge { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; @@ -3085,6 +3086,7 @@ template SiSUdocAbstraction() { assert(_make_segment_anchor_tags_if_none_provided(txt_in, txt_lev) == txt_out); } } + /+ +/ struct ObjAttributes { string[string] _obj_attrib; string obj_attributes( @@ -3297,6 +3299,7 @@ template SiSUdocAbstraction() { return _obj_attrib; } } + /+ +/ struct BookIndexNuggetHash { string main_term, sub_term, sub_term_bits; int obj_cite_number_offset, obj_cite_number_endpoint; @@ -3585,6 +3588,7 @@ template SiSUdocAbstraction() { return t; } } + /+ +/ struct NotesSection { string[string] object_notes; int previous_count; @@ -3768,6 +3772,7 @@ template SiSUdocAbstraction() { return t; } } + /+ +/ struct Bibliography { public JSONValue[] _bibliography_( ref string[] biblio_unsorted_incomplete, @@ -3848,6 +3853,7 @@ template SiSUdocAbstraction() { } } } + /+ +/ struct NodeStructureMetadata { int lv, lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7; int obj_cite_number; diff --git a/views/version.txt b/views/version.txt index 4f49ef6..9472cf9 100644 --- a/views/version.txt +++ b/views/version.txt @@ -4,4 +4,4 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 9, 4); +enum ver = Version(0, 9, 5); -- cgit v1.2.3