diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-02-02 12:17:38 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | f5c32101f14aa21c056b57ddce14394b7f1e7c23 (patch) | |
tree | 962e244304dfe70e6789aceedb36ac37d74bcc51 /org | |
parent | screen output (diff) |
0.12.2 ao_summary_and_debugs.org (ao_output_debugs.org moved and reorganised)
Diffstat (limited to 'org')
-rw-r--r-- | org/ao_read_source_files.org | 8 | ||||
-rw-r--r-- | org/ao_summary_and_debugs.org (renamed from org/ao_output_debugs.org) | 215 | ||||
-rw-r--r-- | org/sdp.org | 27 |
3 files changed, 157 insertions, 93 deletions
diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org index 24b95e4..c325517 100644 --- a/org/ao_read_source_files.org +++ b/org/ao_read_source_files.org @@ -168,19 +168,19 @@ final auto ConfigHub(C,E)(C conf_sdl, E env) { - open markup files<BR> - if master file scan for addional files to import/insert +/ -template SiSUmarkupRaw() { +template SiSUrawMarkupContent() { private import ao_rgx; <<imports_std>> mixin SiSUrgxInit; auto rgx = Rgx(); - auto rawsrc = MarkupRaw(); - auto SiSUmarkupRaw(Fn)(Fn fn_src) { + auto rawsrc = RawMarkupContent(); + auto SiSUrawMarkupContent(Fn)(Fn fn_src) { auto _0_header_1_body_content_2_insert_filelist_tuple = rawsrc.sourceContentSplitIntoHeaderAndBody(rawsrc.sourceContent(fn_src), fn_src); return _0_header_1_body_content_2_insert_filelist_tuple; } - struct MarkupRaw { + struct RawMarkupContent { final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); auto source_txt_str = diff --git a/org/ao_output_debugs.org b/org/ao_summary_and_debugs.org index 7a7a8c7..c921700 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_summary_and_debugs.org @@ -13,12 +13,136 @@ #+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n) [[./sdp.org][sdp]] [[./][org/]] -* 1. output debugs :debug:output: -[[./sdp.org][sdp]] [[./][org/]] +* 1. abstraction summary [#A] +** 0. code structure: :ao_doc_debugs: + +#+BEGIN_SRC d :tangle ../src/sdp/abstraction_summary.d +template SiSUabstractionSummary() { + auto SiSUabstractionSummary(S,T)( + auto ref const S contents, + auto ref T doc_matters, + ) { + <<abstraction_summary_imports>> + mixin InternalMarkup; + <<abstraction_summary_initialize>> + if (doc_matters.opt_action_bool["verbose"]) { + <<ao_abstraction_summary>> + } + } +} +#+END_SRC + +** imports + +#+name: abstraction_summary_imports +#+BEGIN_SRC d +import + ao_defaults, + ao_rgx; +import + std.algorithm, + std.array, + std.container, + std.exception, + std.getopt, + std.stdio, + std.file, + std.path, + std.range, + std.regex, + std.string, + std.traits, + std.typecons, + std.uni, + std.utf, + std.conv : to; +#+END_SRC + +** initialize :report: + +#+name: abstraction_summary_initialize +#+BEGIN_SRC d +auto markup = InlineMarkup(); +#+END_SRC + +** (last ocn) + +#+name: ao_abstraction_summary +#+BEGIN_SRC d +string[string] check = [ + "last_obj_cite_number" : "NA [debug \"checkdoc\" not run]", +]; +foreach (k; doc_matters.keys_seq_seg) { + foreach (obj; contents[k]) { + if (obj.use != "empty") { + if (!empty(obj.obj_cite_number)) { + check["last_obj_cite_number"] = obj.obj_cite_number; + } + } + } +} +#+END_SRC + +** summary + +#+name: ao_abstraction_summary +#+BEGIN_SRC d +// auto char_repeat_number = doc_matters.source_filename.length; +// char_repeat_number = (char_repeat_number > 33) +auto min_repeat_number = 66; +auto char_repeat_number = (doc_matters.dochead_meta["title"]["full"].length + + doc_matters.dochead_meta["creator"]["author"].length + 4); +char_repeat_number = (char_repeat_number > min_repeat_number) +? char_repeat_number +: min_repeat_number; +// writeln(char_repeat_number); +writefln( + "%s\n\"%s\", %s\n%s\n%s\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n(%s: %s)\n%s", + markup.repeat_character_by_number_provided("-", char_repeat_number), + doc_matters.dochead_meta["title"]["full"], + doc_matters.dochead_meta["creator"]["author"], + doc_matters.source_filename, + markup.repeat_character_by_number_provided("-", char_repeat_number), + "length toc array: ", + to!int(contents["toc_seg"].length), + "length contents array: ", + to!int(contents["body"].length), + "last obj_cite_number: ", + to!int(check["last_obj_cite_number"]), + "length endnotes: ", + (contents["endnotes"].length > 1) + ? (to!int(contents["endnotes"].length)) + : 0, + "length glossary: ", + (contents["glossary"].length > 1) + ? (to!int(contents["glossary"].length)) + : 0, + "length biblio: ", + (contents["bibliography"].length > 1) + ? (to!int(contents["bibliography"].length)) + : 0, + "length bookindex: ", + (contents["bookindex_seg"].length > 1) + ? (to!int(contents["bookindex_seg"].length)) + : 0, + "length blurb: ", + (contents["blurb"].length > 1) + ? (to!int(contents["blurb"].length)) + : 0, + __FILE__, + __LINE__, + markup.repeat_character_by_number_provided("-", min_repeat_number), +); +#+END_SRC + +markup.repeat_character_by_number_provided("-", 10) +markup.repeat_character_by_number_provided("-", (doc_matters.dochead_meta["title"]["full"].length)) +markup.repeat_character_by_number_provided("-", (doc_matters.source_filename.length)) + +* 2. abstraction debugs :debug:output: ** 0. code structure: :ao_output_debugs: -#+name: tangle_ao_output_debugs -#+BEGIN_SRC d :tangle ../src/sdp/ao_output_debugs.d +#+BEGIN_SRC d :tangle ../src/sdp/ao_doc_debugs.d /++ output debugs +/ @@ -28,25 +152,20 @@ template SiSUdebugs() { auto ref const S contents, auto ref T doc_matters, ) { - mixin SiSUrgxInit; - mixin InternalMarkup; - <<initialize>> - <<ao_output_debugs>> - debug(checkdoc) { - if ((doc_matters.opt_action_bool["debug"])) { - <<ao_output_debugs_summary>> - } + mixin SiSUrgxInit; + mixin InternalMarkup; + <<initialize>> + <<ao_output_debugs>> + debug(checkdoc) { + if ((doc_matters.opt_action_bool["debug"])) { + <<ao_output_debugs_summary>> <<ao_output_debugs_checkdoc>> } - if ((doc_matters.opt_action_bool["verbose"])) { - <<ao_output_debugs_summary_doc>> - } } } } #+END_SRC - ** imports #+name: debug_imports @@ -735,73 +854,9 @@ debug(summary) { string[string] check = [ "last_obj_cite_number" : "NA [debug \"checkdoc\" not run]", ]; -#+END_SRC - -*** (last ocn) :checkdoc: - -#+name: ao_output_debugs_summary_doc -#+BEGIN_SRC d -if ((doc_matters.opt_action_bool["verbose"])) { - foreach (k; doc_matters.keys_seq_seg) { - foreach (obj; contents[k]) { - if (obj.use != "empty") { - if (!empty(obj.obj_cite_number)) { - check["last_obj_cite_number"] = obj.obj_cite_number; - } - } - } - } } #+END_SRC -*** [#A] output summary - -#+name: ao_output_debugs_summary_doc -#+BEGIN_SRC d -auto min_repeat_number = 66; -auto char_repeat_number = (doc_matters.dochead_meta["title"]["full"].length + doc_matters.dochead_meta["creator"]["author"].length + 4); -char_repeat_number = (char_repeat_number > min_repeat_number) -? char_repeat_number -: min_repeat_number; -writefln( - "%s\n\"%s\", %s\n%s\n%s\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n(%s: %s)\n%s", - markup.repeat_character_by_number_provided("-", char_repeat_number), - doc_matters.dochead_meta["title"]["full"], - doc_matters.dochead_meta["creator"]["author"], - doc_matters.source_filename, - markup.repeat_character_by_number_provided("-", char_repeat_number), - "length toc array: ", - to!int(contents["toc_seg"].length), - "length contents array: ", - to!int(contents["body"].length), - "last obj_cite_number: ", - to!int(check["last_obj_cite_number"]), - "length endnotes: ", - (contents["endnotes"].length > 1) - ? (to!int(contents["endnotes"].length)) - : 0, - "length glossary: ", - (contents["glossary"].length > 1) - ? (to!int(contents["glossary"].length)) - : 0, - "length biblio: ", - (contents["bibliography"].length > 1) - ? (to!int(contents["bibliography"].length)) - : 0, - "length bookindex: ", - (contents["bookindex_seg"].length > 1) - ? (to!int(contents["bookindex_seg"].length)) - : 0, - "length blurb: ", - (contents["blurb"].length > 1) - ? (to!int(contents["blurb"].length)) - : 0, - __FILE__, - __LINE__, - markup.repeat_character_by_number_provided("-", min_repeat_number), -); -#+END_SRC - *** compare number of obj_cite_number for known sisu markup output (checkdoc) #+name: ao_output_debugs_summary diff --git a/org/sdp.org b/org/sdp.org index 9cd8265..cafb5d9 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -23,10 +23,10 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 12, 1); +enum ver = Version(0, 12, 2); #+END_SRC -* 1. sdp.d (sisu document parser) :sdp: +* 1. sdp (sisu document parser) :sdp: - deal with imports - get options @@ -34,10 +34,10 @@ enum ver = Version(0, 12, 1); - read config instructions - process files as instructed by options - read in file - - proess file + - process file - output -** 0. sdp src/sdp.d :sdp: +** 0. sdp src/sdp.d :template: #+BEGIN_SRC d :tangle ../src/sdp.d :shebang #!/usr/bin/env rdmd /+ @@ -88,12 +88,13 @@ unittest { #+BEGIN_SRC d /+ sdp: sisu document parser, see http://sisudoc.org +/ import + abstraction_summary, ao_abstract_doc_source, ao_conf_make_meta, ao_conf_make_meta_native, ao_conf_make_meta_sdlang, ao_defaults, - ao_output_debugs, + ao_doc_debugs, ao_read_config_files, ao_read_source_files, ao_rgx, @@ -377,6 +378,15 @@ auto doc_matters = t[1]; #+END_SRC *** 2. _output processing_ (post abstraction processing) +**** 0. abstraction summary :abstraction:summary: + +#+NAME: sdp_each_file_do_debugs_checkdoc +#+BEGIN_SRC d +/+ ↓ debugs +/ +if (doc_matters.opt_action_bool["verbose"]) { + SiSUabstractionSummary!()(doc_abstraction, doc_matters); +} +#+END_SRC **** 1. _debug_ (document parts, checkdoc) :debug:checkdoc: - [[./ao_output_debugs.org][ao_output_debugs]] @@ -425,7 +435,7 @@ break; // terminate, stop #+END_SRC * 2. _document abstraction_ -** 0. abstraction template +** 0. abstraction template :template: #+BEGIN_SRC d :tangle ../src/sdp/abstraction.d template SiSUabstraction() { @@ -450,14 +460,13 @@ template SiSUabstraction() { ** 1. (a) _read in raw file_ & (b) split content into: _doc header & doc content_ - [[./ao_read_source_files.org][ao_read_source_files]] -- [[./ao_read_source_files.org][ao_read_source_files]] #+NAME: sdp_each_file_do_read_and_split_sisu_markup_file_content_into_header_and_body #+BEGIN_SRC d /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ auto _0_header_1_body_content_2_insert_filelist_tuple = - SiSUmarkupRaw!()(fn_src); + SiSUrawMarkupContent!()(fn_src); static assert(!isTypeTuple!(_0_header_1_body_content_2_insert_filelist_tuple)); static assert(_0_header_1_body_content_2_insert_filelist_tuple.length==3); debug(header_and_body) { @@ -479,7 +488,7 @@ static assert(!isTypeTuple!(_0_make_1_dochead_meta_tuple)); static assert(_0_make_1_dochead_meta_tuple.length==2); #+END_SRC -** 3. pre-processing: _document abstraction, tuple_ :processing: +** 3. _document abstraction, tuple_ (pre-processing) :processing: - [[./ao_abstract_doc_source.org][ao_abstract_doc_source]] #+NAME: sdp_each_file_do_document_abstraction |