diff options
Diffstat (limited to 'org/sdp.org')
-rw-r--r-- | org/sdp.org | 93 |
1 files changed, 31 insertions, 62 deletions
diff --git a/org/sdp.org b/org/sdp.org index 5855ee2..7c7a195 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -16,7 +16,6 @@ [[../maker.org][maker.org makefile]] [[./][org/]] * 0. version.txt (set version) :version: - ** set program version #+NAME: version_txt @@ -27,7 +26,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 18, 1); +enum ver = Version(0, 19, 0); #+END_SRC #+NAME: version_txt @@ -80,7 +79,6 @@ void main(string[] args) { <<sdp_mixin>> <<sdp_args>> <<sdp_env>> - <<sdp_conf_files>> <<sdp_do_selected>> if (fns_src.length > 0) { foreach(fn_src; fns_src) { @@ -112,7 +110,6 @@ unittest { #+NAME: imports_sdp #+BEGIN_SRC d -/+ sdp: sisu document parser, see http://sisudoc.org +/ import sdp.meta; import std.getopt, @@ -120,10 +117,10 @@ import import sdp.meta.metadoc_summary, sdp.meta.metadoc_from_src, - sdp.meta.composite_make, sdp.meta.conf_make_meta, // sdp.meta.conf_make_meta_native, sdp.meta.conf_make_meta_sdlang, + sdp.meta.conf_make_meta_composite, sdp.meta.defaults, sdp.meta.doc_debugs, sdp.meta.read_config_files, @@ -339,8 +336,7 @@ auto env = [ #+BEGIN_SRC d auto sdl_root_config_share = configRead!()("config_share", env); auto sdl_root_config_local = configRead!()("config_local", env); -auto conf_composite_static_aa = extractSDL().sdlangToAA(conf_aa_empty, sdl_root_config_share); -conf_composite_static_aa = extractSDL().sdlangToAA(conf_composite_static_aa, sdl_root_config_local); +auto conf_files_composite_make = confFilesSDLtoStruct!()(sdl_root_config_share, sdl_root_config_local); #+END_SRC ** 2a. actions independed of processing files @@ -388,8 +384,7 @@ enforce( #+NAME: sdp_abstraction #+BEGIN_SRC d -auto t = - SiSUabstraction!()(fn_src, opts, env); +auto t = SiSUabstraction!()(fn_src, opts, env); static assert(!isTypeTuple!(t)); static assert(t.length==2); auto doc_abstraction = t[dAM.abstraction]; @@ -465,7 +460,11 @@ template SiSUabstraction() { enum makeMeta { make, meta } enum docAbst { doc_abstraction, section_keys, segnames, segnames_0_4, images } static auto rgx = Rgx(); - auto SiSUabstraction(Fn,O,E)(Fn fn_src, O opts, E env){ + auto SiSUabstraction(Fn,O,E)( + Fn fn_src, + O opts, + E env, + ){ <<sdp_conf_files>> <<sdp_each_file_do_read_and_split_sisu_markup_file_content_into_header_and_body>> <<sdp_each_file_do_split_sisu_markup_file_header_into_make_and_meta>> @@ -522,36 +521,11 @@ 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 _make_and_meta_tup = - docHeaderMakeAndMetaTupExtractAndConvertToAA!()(conf_composite_static_aa, _header_body_inserts[headBody.header]); -static assert(!isTypeTuple!(_make_and_meta_tup)); -static assert(_make_and_meta_tup.length==2); -#+END_SRC - -** 3. composite make & settings? - -#+NAME: sdp_each_file_do_document_abstraction -#+BEGIN_SRC d -auto _make_config = compositeMkCnf!()( - conf_composite_static_aa, - _make_and_meta_tup[makeMeta.make], - // opts, -); +auto _make_and_meta_struct = + docHeaderMakeAndMetaTupExtractAndConvertToStruct!()(conf_files_composite_make, _header_body_inserts[headBody.header]); // breakage ... #+END_SRC -** ?. composite config & make (files & doc header) aa - -#+NAME: sdp_each_file_do_document_abstraction -#+BEGIN_SRC d -auto _make_and_conf_composite_static_plus_docheader_aa = compositeMkCnfAA!()( - conf_aa_empty, - conf_composite_static_aa, - _make_and_meta_tup[makeMeta.make], - opts, -); -#+END_SRC - -** 4. _document abstraction, tuple_ (pre-output-processing) :processing: +** 3. _document abstraction, tuple_ (pre-output-processing) :processing: - [[./meta_abstraction.org][meta_abstraction]] - prepare the document abstraction used in downstream processing @@ -570,8 +544,7 @@ auto _make_and_conf_composite_static_plus_docheader_aa = compositeMkCnfAA!()( /+ ↓ document abstraction: process document, return abstraction as tuple +/ auto da = SiSUdocAbstraction!()( _header_body_inserts[headBody.body_content], - _make_and_meta_tup[makeMeta.make], - _make_and_meta_tup[makeMeta.meta], + _make_and_meta_struct, opts ); static assert(!isTypeTuple!(da)); @@ -583,7 +556,7 @@ string[] _doc_epub_segnames_0_4 = da[docAbst.segnames_0_4]; auto _images = da[docAbst.images]; #+END_SRC -** 5. _document matters_ (doc info gathered, various sources) +** 4. _document matters_ (doc info gathered, various sources) - prepare document_matters, miscellany about processing and the document of use in downstream processing @@ -604,12 +577,8 @@ struct DocumentMatters { string[] _k = _doc_epub_segnames_0_4; return _k; } - auto dochead_meta() { - string[string][string] _k = _make_and_meta_tup[makeMeta.meta]; - return _k; - } - auto dochead_make() { - string[string][string] _k = _make_and_meta_tup[makeMeta.make]; + auto conf_make_meta() { + auto _k = _make_and_meta_struct; return _k; } auto source_filename() { @@ -733,16 +702,16 @@ foreach (k; doc_matters.keys_seq.seg) { #+name: meta_metadoc_summary #+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); +auto char_repeat_number = (doc_matters.conf_make_meta.meta.title_full.length + + doc_matters.conf_make_meta.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%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\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.conf_make_meta.meta.title_full, + doc_matters.conf_make_meta.meta.creator_author, doc_matters.source_filename, markup.repeat_character_by_number_provided("-", char_repeat_number), "length toc arr:", @@ -1028,17 +997,17 @@ provide the result as a single set of make instructions for each document parsed | | | - dir | | | | | | - concord_max | | | |---------------------+-----------------------+-------------------------+------------------------+-----------------------------| -| | | flag | | | -| | | - act0 | | | -| | | - act1 | | | -| | | - act2 | | | -| | | - act3 | | | -| | | - act4 | | | -| | | - act5 | | | -| | | - act6 | | | -| | | - act7 | | | -| | | - act8 | | | -| | | - act9 | | | +| | | flag (configure) | | (call) | +| | | - act0 | | act0 | +| | | - act1 | | act1 | +| | | - act2 | | act2 | +| | | - act3 | | act3 | +| | | - act4 | | act4 | +| | | - act5 | | act5 | +| | | - act6 | | act6 | +| | | - act7 | | act7 | +| | | - act8 | | act8 | +| | | - act9 | | act9 | |---------------------+-----------------------+-------------------------+------------------------+-----------------------------| | | | default | | | | | | - papersize | | | |