From f0c4dcbc6b00dd66b115bd27953b7e54710b6ae3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 18 Feb 2017 12:42:01 -0500 Subject: 0.13.3 tuples, sdp & doc_abstraction (flag marked up links & endnotes) --- org/sdp.org | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'org/sdp.org') diff --git a/org/sdp.org b/org/sdp.org index c745741..5dd7f45 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -23,7 +23,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 13, 2); +enum ver = Version(0, 13, 3); #+END_SRC * 1. sdp (sisu document parser) :sdp: @@ -194,6 +194,7 @@ mixin outputHub; string[] fns_src; string flag_action; string arg_unrecognized; +enum dAM { abstraction, matters } auto rgx = Rgx(); #+END_SRC @@ -377,8 +378,8 @@ auto t = SiSUabstraction!()(fn_src, _opt_action_bool, env); static assert(!isTypeTuple!(t)); static assert(t.length==2); -auto doc_abstraction = t[0]; -auto doc_matters = t[1]; +auto doc_abstraction = t[dAM.abstraction]; +auto doc_matters = t[dAM.matters]; #+END_SRC *** 2. _output processing_ (post abstraction processing) @@ -447,7 +448,9 @@ template SiSUabstraction() { <> <> <> - // <> + enum headBody { header, body_content, insert_filelist } + enum makeMeta { make, meta } + enum docAbst { doc_abstraction, section_keys, segnames, images } auto rgx = Rgx(); auto SiSUabstraction(Fn,O,E)(Fn fn_src, O opts, E env){ <> @@ -479,14 +482,14 @@ template SiSUabstraction() { #+BEGIN_SRC d /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ -auto _0_header_1_body_content_2_insert_filelist_tuple = +auto _header_body_inserts = 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); +static assert(!isTypeTuple!(_header_body_inserts)); +static assert(_header_body_inserts.length==3); debug(header_and_body) { writeln(header); - writeln(_0_header_1_body_content_2_insert_filelist_tuple.length); - writeln(_0_header_1_body_content_2_insert_filelist_tuple.length[1][0]); + writeln(_header_body_inserts.length); + writeln(_header_body_inserts.length[headBody.body_content][0]); } #+END_SRC @@ -506,10 +509,10 @@ debug(header_and_body) { #+NAME: sdp_each_file_do_split_sisu_markup_file_header_into_make_and_meta #+BEGIN_SRC d /+ ↓ split header into make and meta +/ -auto _0_make_1_dochead_meta_tuple = - SiSUheaderExtractHub!()(_0_header_1_body_content_2_insert_filelist_tuple[0], conf_doc_make_aa); -static assert(!isTypeTuple!(_0_make_1_dochead_meta_tuple)); -static assert(_0_make_1_dochead_meta_tuple.length==2); +auto _make_and_meta = + SiSUheaderExtractHub!()(_header_body_inserts[headBody.header], conf_doc_make_aa); +static assert(!isTypeTuple!(_make_and_meta)); +static assert(_make_and_meta.length==2); #+END_SRC ** 3. _document abstraction, tuple_ (pre-processing) :processing: @@ -530,17 +533,17 @@ static assert(_0_make_1_dochead_meta_tuple.length==2); #+BEGIN_SRC d /+ ↓ document abstraction: process document, return abstraction as tuple +/ auto da = SiSUdocAbstraction!()( - (_0_header_1_body_content_2_insert_filelist_tuple[1]), - (_0_make_1_dochead_meta_tuple[0]), - (_0_make_1_dochead_meta_tuple[1]), + (_header_body_inserts[headBody.body_content]), + (_make_and_meta[makeMeta.make]), + (_make_and_meta[makeMeta.meta]), opts ); static assert(!isTypeTuple!(da)); static assert(da.length==4); -auto doc_abstraction = da[0]; // head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~blurb; -string[][string] _document_section_keys_sequenced = da[1]; -string[] _doc_html_segnames = da[2]; -auto _images = da[3]; +auto doc_abstraction = da[docAbst.doc_abstraction]; // head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~blurb; +string[][string] _document_section_keys_sequenced = da[docAbst.section_keys]; +string[] _doc_html_segnames = da[docAbst.segnames]; +auto _images = da[docAbst.images]; #+END_SRC ** 4. _document matters_ (doc info gathered, various sources) @@ -564,11 +567,11 @@ struct DocumentMatters { return _k; } auto dochead_make() { - string[string][string] _k = _0_make_1_dochead_meta_tuple[0]; + string[string][string] _k = _make_and_meta[makeMeta.make]; return _k; } auto dochead_meta() { - string[string][string] _k = _0_make_1_dochead_meta_tuple[1]; + string[string][string] _k = _make_and_meta[makeMeta.meta]; return _k; } auto source_filename() { @@ -585,7 +588,7 @@ struct DocumentMatters { return _k; } auto file_insert_list() { - string[] _k = _0_header_1_body_content_2_insert_filelist_tuple[2]; + string[] _k = _header_body_inserts[headBody.insert_filelist]; return _k; } auto image_list() { -- cgit v1.2.3