From ba1712e77b31704fd9ba16d14e15518e7a7dd104 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 1 Oct 2016 14:12:13 -0400 Subject: 0.7.0 using dub remote dependencies (local src related to sdlang removed) --- org/ao_abstract_doc_source.org | 189 ++++++++++++++++++++++++++++++----------- 1 file changed, 141 insertions(+), 48 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 958d2d1..5c78771 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -14,10 +14,10 @@ [[./sdp.org][sdp]] [[./][org/]] -* document abstraction :abstract:process: +* Document Abstraction :abstract:process: Process markup document, create document abstraction. -** 1. pre loop processing :pre: +** _1. pre loop processing_ :pre: *** imports :imports: [[./ao_defaults.org][ao_defaults]] @@ -36,10 +36,6 @@ import #+BEGIN_SRC d mixin ObjectSetter; mixin InternalMarkup; -// // mixin SiSUrgxInitFlags; -// // mixin AssertionsOnBlocks; -// mixin SiSUbiblio; // issue -// mixin SiSUheader; #+END_SRC *** initialize :initialize: @@ -133,9 +129,10 @@ string node_jstr_heading( is_ ); } -// mixin SiSUdocAbstractionFunctions; #+END_SRC +*** scope + #+name: abs_init_rest #+BEGIN_SRC d scope(success) { @@ -148,12 +145,17 @@ scope(exit) { destroy(processing); destroy(biblio_arr_json); } +#+END_SRC + +*** init rest + +#+name: abs_init_rest +#+BEGIN_SRC d line_occur = [ "heading" : 0, "para" : 0, ]; auto type = flags_type_init; -mixin ScreenTxtColors; void tell_lo(int obj_cite_number, in char[] line) { writefln( "* %s %s", @@ -209,7 +211,7 @@ auto heading_match_rgx = [ ]; #+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 @@ -227,10 +229,9 @@ scope(failure) { } line = replaceAll(line, rgx.true_dollar, "$$$$"); // dollar represented as $$ needed to stop submatching on $ - // (substitutions using ${identifiers} must take into account (e.g. happen earlier)) + // (substitutions using ${identifiers} must take into account (i.e. happen earlier)) debug(source) { // source lines writeln(line); - // writeln(scr_txt_marker["green"], line); } debug(srclines) { if (!line.empty) { // source lines, not empty @@ -252,8 +253,8 @@ if (!line.empty) { #+END_SRC *** [#A] separate regular markup text from code blocks [+5] - **** code blocks :block:code: + #+name: abs_in_loop_body_00_code_block #+BEGIN_SRC d if (type["code"] == TriState.on) { @@ -686,8 +687,7 @@ if (contents_the_objects.length > 0) { } #+END_SRC -** 3. post loop processing :post: - +** _3. post loop processing_ :post: *** misc #+name: abs_post @@ -801,7 +801,7 @@ auto t = tuple( return t; #+END_SRC -* functions :abstract:function: +* Functions :abstract:function: functions used in document abstraction ** set & resets :reset: @@ -2315,16 +2315,13 @@ auto para_match( #+name: ao_emitters #+BEGIN_SRC d struct OCNemitter { -// class OCNemitter : AssertOCN { int obj_cite_number, obj_cite_number_; int obj_cite_number_emitter(int obj_cite_number_status_flag) in { assert(obj_cite_number_status_flag <= 2); } body { - if (obj_cite_number_status_flag == 0) { - obj_cite_number=++obj_cite_number_; - } else { - obj_cite_number=0; - } + obj_cite_number=(obj_cite_number_status_flag == 0) + ? ++obj_cite_number_ + : 0; assert(obj_cite_number >= 0); return obj_cite_number; } @@ -2338,7 +2335,6 @@ struct OCNemitter { #+name: ao_emitters #+BEGIN_SRC d struct ObjAttributes { -// class ObjAttributes : AssertObjAttributes { string[string] obj_txt; string para_and_blocks(string obj_txt_in) in { } @@ -2687,6 +2683,7 @@ struct ObjInlineMarkupMunge { #+END_SRC **** object inline markup :markup:inline: +***** open #+name: ao_emitters #+BEGIN_SRC d @@ -2694,6 +2691,12 @@ struct ObjInlineMarkup { // struct ObjInlineMarkup : AssertObjInlineMarkup { auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; +#+END_SRC + +***** object inline markup and anchor tags :markup:inline: + +#+name: ao_emitters +#+BEGIN_SRC d auto obj_inline_markup_and_anchor_tags(string[string] obj_, string[string][string] dochead_make_aa) in { } body { @@ -2882,18 +2885,15 @@ struct ObjInlineMarkup { #+END_SRC **** object attrib :attributes: - +***** attributes structure open, public #+name: ao_emitters #+BEGIN_SRC d struct ObjAttrib { -// struct ObjAttrib : AssertObjAttrib { -// auto sink = appender!(char[])(); auto attrib = ObjAttributes(); string[string] obj_attrib; string obj_attributes(string obj_is_, string obj_raw, string node) in { } body { - // string s = "{ \"language\": \"D\", \"rating\": 3.14, \"code\": \"42\" }"; scope(exit) { // destroy(obj_is_); destroy(obj_raw); @@ -2957,9 +2957,7 @@ struct ObjAttrib { obj_attrib["json"] = oa_j.toString(); debug(structattrib) { if (oa_j["is"].str() == "heading") { - // writeln(__LINE__); writeln(obj_attrib["json"]); - // writeln(node); writeln( "is: ", oa_j["is"].str(), "; obj_cite_number: ", oa_j["obj_cite_number"].integer() @@ -2971,6 +2969,11 @@ struct ObjAttrib { } invariant() { } +#+END_SRC + +***** close +#+name: ao_emitters +#+BEGIN_SRC d } #+END_SRC @@ -2980,7 +2983,6 @@ struct ObjAttrib { #+name: ao_emitters #+BEGIN_SRC d struct BookIndexNuggetHash { -// class BookIndexNuggetHash : AssertBookIndexNuggetHash { string main_term, sub_term, sub_term_bits; int obj_cite_number_offset, obj_cite_number_endpoint; string[] obj_cite_numbers; @@ -3088,11 +3090,17 @@ struct BookIndexReportIndent { **** book index (sort &) report section :report:section: +***** book index struct open #+name: ao_emitters #+BEGIN_SRC d struct BookIndexReportSection { int mkn, skn; auto rgx = Rgx(); +#+END_SRC + +***** bookindex write section +#+name: ao_emitters +#+BEGIN_SRC d auto bookindex_write_section( string[][string][string] bookindex_unordered_hashes ) { @@ -3121,8 +3129,7 @@ struct BookIndexReportSection { } #+END_SRC -**** book index (sort &) build section :report:section: - +***** book index (sort &) build section :report:section: #+name: ao_emitters #+BEGIN_SRC d auto bookindex_build_section( @@ -3223,8 +3230,7 @@ struct BookIndexReportSection { } #+END_SRC -**** book index (sort &) build section :report:section: - +***** book index struct close #+name: ao_emitters #+BEGIN_SRC d auto bookindex_build_section_( @@ -3273,6 +3279,11 @@ struct NotesSection { string object_notes; long previous_count; int mkn; +#+END_SRC + +**** gather notes for endnote section struct open +#+name: ao_emitters +#+BEGIN_SRC d auto rgx = Rgx(); private auto gather_notes_for_endnote_section( ObjComposite[] contents_am, @@ -3307,6 +3318,11 @@ struct NotesSection { } return object_notes; } +#+END_SRC + +**** gathered notes +#+name: ao_emitters +#+BEGIN_SRC d private auto gathered_notes() in { } @@ -3317,6 +3333,11 @@ struct NotesSection { } return endnotes_; } +#+END_SRC + +**** endnote objects +#+name: ao_emitters +#+BEGIN_SRC d private auto endnote_objects(int obj_cite_number) in { } @@ -3364,7 +3385,6 @@ struct NotesSection { ++obj_cite_number; ++mkn; foreach (endnote; endnotes_) { - attrib=""; attrib=""; // endnotes ~= // set_abstract_object.contents_para( @@ -3382,14 +3402,25 @@ struct NotesSection { auto t = tuple(endnotes_section, obj_cite_number); return t; } +#+END_SRC + +**** gather notes for endnote section struct close +#+name: ao_emitters +#+BEGIN_SRC d } #+END_SRC *** bibliography :bibliography: +**** biblio struct open #+name: ao_emitters #+BEGIN_SRC d struct Bibliography { +#+END_SRC + +**** biblio +#+name: ao_emitters +#+BEGIN_SRC d public JSONValue[] bibliography(ref string[] biblio_unsorted_incomplete, ref JSONValue[] bib_arr_json) in { } body { @@ -3413,6 +3444,11 @@ struct Bibliography { } return biblio_sorted__; } +#+END_SRC + +**** biblio unsorted complete +#+name: ao_emitters +#+BEGIN_SRC d final private JSONValue[] biblio_unsorted_complete( string[] biblio_unordered, ref JSONValue[] bib_arr_json @@ -3442,6 +3478,11 @@ struct Bibliography { bib_arr_json.dup; return biblio_unsorted_array_of_json_objects; } +#+END_SRC + +**** biblio sort +#+name: ao_emitters +#+BEGIN_SRC d final private JSONValue[] biblio_sort(JSONValue[] biblio_unordered) { JSONValue[] biblio_sorted_; biblio_sorted_ = @@ -3458,6 +3499,11 @@ struct Bibliography { } return biblio_sorted_; } +#+END_SRC + +**** biblio debug +#+name: ao_emitters +#+BEGIN_SRC d void biblio_debug(JSONValue[] biblio_sorted) { debug(biblio0) { foreach (j; biblio_sorted) { @@ -3467,20 +3513,29 @@ struct Bibliography { } } } +#+END_SRC + +**** biblio struct close +#+name: ao_emitters +#+BEGIN_SRC d } #+END_SRC *** node structure metadata :structure:metadata:node: -**** metadata (check) +**** metadata node struct open #+name: ao_emitters #+BEGIN_SRC d struct NodeStructureMetadata { -// class NodeStructureMetadata : AssertNodeJSON { int lv, lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7; int obj_cite_number; int[string] p_; // p_ parent_ string node; +#+END_SRC + +**** metadata node emitter +#+name: ao_emitters +#+BEGIN_SRC d string node_emitter( string lev_markup_number, int obj_cite_number_, @@ -3542,7 +3597,7 @@ struct NodeStructureMetadata { } #+END_SRC -**** metadata (check) +**** metadata emitter heading #+name: ao_emitters #+BEGIN_SRC d @@ -3730,6 +3785,11 @@ struct NodeStructureMetadata { } invariant() { } +#+END_SRC + +**** metadata node struct close +#+name: ao_emitters +#+BEGIN_SRC d } #+END_SRC @@ -3940,35 +4000,61 @@ auto assertions_flag_types_block_status_none_or_closed(int[string] type) { } #+END_SRC -* object setter :abstract:object: +* Object Setter :abstract:object: set abstracted objects for downstream processing -** structs :struct: +** initialize structs :struct: -#+name: ao_structs +*** heading attribute +#+name: ao_structs_init #+BEGIN_SRC d struct HeadingAttrib { string lev = "9"; int lev_markup_number = 9; int lev_collapsed_number = 9; } +#+END_SRC + +*** paragraph attribute +#+name: ao_structs_init +#+BEGIN_SRC d struct ParaAttrib { int indent_start = 0; int indent_rest = 0; bool bullet = false; } +#+END_SRC + +*** block attribute +#+name: ao_structs_init +#+BEGIN_SRC d struct BlockAttrib { string syntax = ""; } +#+END_SRC + +*** comment attribute +#+name: ao_structs_init +#+BEGIN_SRC d struct Comment { // no .attrib and no .obj_cite_number } +#+END_SRC + +*** node +#+name: ao_structs_init +#+BEGIN_SRC d struct Node { int ocn = 0; int parent_lev = 0; int parent_ocn = 0; string node = ""; } +#+END_SRC + +*** composite object +#+name: ao_structs_init +#+BEGIN_SRC d struct ObjComposite { // size_t id; string use = ""; @@ -3982,6 +4068,11 @@ struct ObjComposite { BlockAttrib block_attrib; Node node_structure; } +#+END_SRC + +*** object composite array +#+name: ao_structs_init +#+BEGIN_SRC d struct ObjCompositeArr { ObjComposite[] oca; } @@ -4143,12 +4234,13 @@ auto contents_block_obj_cite_number_string( } #+END_SRC -* tangles (code structure) :tangle:io:file: -** abstract doc source: :ao_abstract_doc_source.d: +* 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 +/++ + document abstraction: + abstraction of sisu markup for downstream processing ao_abstract_doc_source.d +/ template SiSUdocAbstraction() { @@ -4200,16 +4292,17 @@ template SiSUdocAbstraction() { } /+ ← closed: template SiSUdocAbstraction +/ #+END_SRC -** ao_object_setter: :ao_object_setter.d: +** ao object setter: :ao_object_setter.d: #+BEGIN_SRC d :tangle ../src/sdp/ao_object_setter.d -/+ - object setter +/++ + object setter: + setting of sisu objects for downstream processing ao_object_setter.d +/ template ObjectSetter() { /+ structs +/ - <> + <> /+ structs setter +/ struct ObjectAbstractSet { import std.conv : to; -- cgit v1.2.3