diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-06-08 14:15:46 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-10-17 19:07:20 -0400 |
commit | 81a26c19c55a98918cf433da2f867db6b693b6df (patch) | |
tree | c0d998d51aa040b450215be5949b716cc49e560f /org/doc_reform.org | |
parent | 0.7.3 start to look at document harvest (initial stub) (diff) |
harvest, document reporting
Diffstat (limited to 'org/doc_reform.org')
-rw-r--r-- | org/doc_reform.org | 74 |
1 files changed, 55 insertions, 19 deletions
diff --git a/org/doc_reform.org b/org/doc_reform.org index 7bb8029..b13d086 100644 --- a/org/doc_reform.org +++ b/org/doc_reform.org @@ -117,33 +117,58 @@ void main(string[] args) { } } } - if (_opt_action.verbose - && harvests.length > 1 + if (_opt_action.very_verbose + && harvests.length > 0 ) { auto min_repeat_number = 42; - foreach(doc_harvest; harvests) { + string[] _document_topic_register; + string[] _topic_register; + string[] _sub_topic_register; + foreach(k, doc_harvest; harvests) { + _topic_register = []; + foreach(topic; doc_harvest.topic_register_arr.sort) { + _sub_topic_register = []; + string _spaces; + foreach (i, _top; topic.split(mkup.sep)) { + _sub_topic_register ~= format( + " %s- %s", + " ".repeat(i).join, + _top, + ); + } + _topic_register ~= _sub_topic_register.join("\n"); + } auto char_repeat_number = (doc_harvest.title.length + doc_harvest.author.length + 16); char_repeat_number = (char_repeat_number > min_repeat_number) ? char_repeat_number : min_repeat_number; - writefln( - "%s\n\"%s\", %s%s", - mkup.repeat_character_by_number_provided("-", char_repeat_number), + _document_topic_register ~= format( + "\"%s\", %s%s\n%s", doc_harvest.title, doc_harvest.author, (doc_harvest.date_published.length > 0) ? " (" ~ doc_harvest.date_published ~ ")" : "", + _topic_register.sort!("toUpper(a) < toUpper(b)", SwapStrategy.stable).release.join("\n"), ); - string[] _topic_arr; - foreach(topic; doc_harvest.topic_register_arr.sort) { - foreach (i, _top; topic.split(mkup.sep)) { - writeln(" ", (" ".repeat(i).join), "- ", _top); - } + foreach(_dtr; _document_topic_register.sort) { + writeln(_dtr); } } + } + if ((_opt_action.verbose + || _opt_action.very_verbose) + && harvests.length > 0 + ) { string[] _author_date_title; foreach(doc_harvest; harvests) { - _author_date_title ~= doc_harvest.author_date_title; + _author_date_title ~= format( + "%s %s \"%s\" [%s]", + doc_harvest.author_surname_fn, + (doc_harvest.date_published.length > 0) + ? "(" ~ doc_harvest.date_published ~ ")" : "", + doc_harvest.title, + doc_harvest.language, + ); } foreach(_adt; _author_date_title.sort) { writeln(_adt); @@ -304,7 +329,10 @@ mixin outputHub; struct Harvest { string title = ""; string author = ""; - string author_date_title = ""; + string author_surname_fn = ""; + string language = ""; + string language_original = ""; + string uid = ""; string date_published = ""; string[] topic_register_arr = [""]; string html_seg_toc = ""; @@ -870,11 +898,15 @@ foreach(arg; args[1..$]) { #+NAME: doc_reform_conf_files_in_toml #+BEGIN_SRC d -auto _config_document_struct = readConfigDoc!()(_manifest, _env); // document config file -auto _config_local_site_struct = readConfigSite!()(_manifest, _env); // local site config ConfCompositePlus _make_and_meta_struct; -_make_and_meta_struct = configParseTOMLreturnDocReformStruct!()(_make_and_meta_struct, _config_document_struct); -_make_and_meta_struct = configParseTOMLreturnDocReformStruct!()(_make_and_meta_struct, _config_local_site_struct); +{ /+ document config file +/ + auto _config_document_struct = readConfigDoc!()(_manifest, _env); + _make_and_meta_struct = _config_document_struct.configParseTOMLreturnDocReformStruct!()(_make_and_meta_struct, _manifest); +} +{ /+ local site config +/ + auto _config_local_site_struct = readConfigSite!()(_manifest, _env); + _make_and_meta_struct = _config_local_site_struct.configParseTOMLreturnDocReformStruct!()(_make_and_meta_struct, _manifest); +} #+END_SRC *** opt actions independent of processing files (no files no processing loop) @@ -1150,7 +1182,8 @@ if ((_opt_action.debug_do) _make_and_meta_struct = docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct!()( _make_and_meta_struct, - _header_body_insertfilelist_imagelist[headBody.header] + _header_body_insertfilelist_imagelist[headBody.header], + _manifest, ); if ((_opt_action.debug_do) || (_opt_action.very_verbose) @@ -1578,7 +1611,10 @@ writefln( #+BEGIN_SRC d harvest.title = doc_matters.conf_make_meta.meta.title_full; harvest.author = doc_matters.conf_make_meta.meta.creator_author; -harvest.author_date_title = doc_matters.conf_make_meta.meta.author_date_title; +harvest.author_surname_fn = doc_matters.conf_make_meta.meta.creator_author_surname_fn; +harvest.language_original = doc_matters.conf_make_meta.meta.original_language; +harvest.language = doc_matters.src.language; +harvest.uid = doc_matters.src.doc_uid; harvest.date_published = doc_matters.conf_make_meta.meta.date_published; harvest.topic_register_arr = doc_matters.conf_make_meta.meta.classify_topic_register_arr; return harvest; |