From 614e44ad155e693f82a8228897bba2f4869167dd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Feb 2022 14:23:35 -0500 Subject: rethink verbose & debug flags, introduce show --- src/doc_reform/meta/metadoc.d | 33 ++++++++++++++-------------- src/doc_reform/meta/metadoc_curate_authors.d | 6 ++--- src/doc_reform/meta/metadoc_curate_topics.d | 16 +++++++------- 3 files changed, 26 insertions(+), 29 deletions(-) (limited to 'src/doc_reform/meta') diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index d8b252e..b912c24 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -36,18 +36,17 @@ template spineAbstraction() { /+ ↓ read file (filename with path) +/ /+ ↓ file tuple of header and content +/ if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("step1 commence → (get document header & body & insert file list & if needed image list)" - ); + writeln("step1 commence → (get document header & body & insert file list & if needed image list) [", _manifest.src.filename, "]"); } auto _header_body_insertfilelist_imagelist = spineRawMarkupContent!()(_opt_action, _manifest.src.path_and_fn); static assert(_header_body_insertfilelist_imagelist.length==4); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- step1 complete"); + writeln("- step1 complete for [", _manifest.src.filename, "]"); } debug(header_and_body) { writeln(header); @@ -56,9 +55,9 @@ template spineAbstraction() { } /+ ↓ split header into make and meta +/ if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("step2 commence → (read document header (yaml) return struct)"); + writeln("step2 commence → (read document header (yaml) return struct) [", _manifest.src.filename, "]"); } import doc_reform.meta.conf_make_meta_yaml; _make_and_meta_struct = @@ -70,15 +69,15 @@ template spineAbstraction() { _cfg, ); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- step2 complete"); + writeln("- step2 complete for [", _manifest.src.filename, "]"); } /+ ↓ document abstraction: process document, return abstraction as tuple +/ if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("step3 commence → (document abstraction (da); da keys; segnames; doc_matters)"); + writeln("step3 commence → (document abstraction (da); da keys; segnames; doc_matters) [", _manifest.src.filename, "]"); } auto da = docAbstraction!()( _header_body_insertfilelist_imagelist[headBody.body_content], @@ -91,14 +90,14 @@ template spineAbstraction() { auto doc_abstraction = da[docAbst.doc_abstract_obj]; /+ head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~ blurb; +/ auto _doc_has_struct = da[docAbst.doc_has]; if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- step3 complete"); + writeln("- step3 complete for [", _manifest.src.filename, "]"); } if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("step4 commence → (doc_matters)"); + writeln("step4 commence → (doc_matters) [", _manifest.src.filename, "]"); } struct DocumentMatters { @safe auto generator_program() { @@ -241,9 +240,9 @@ template spineAbstraction() { } auto doc_matters = DocumentMatters(); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- step4 complete"); + writeln("- step4 complete for [", _manifest.src.filename, "]"); } auto t = tuple(doc_abstraction, doc_matters); return t; diff --git a/src/doc_reform/meta/metadoc_curate_authors.d b/src/doc_reform/meta/metadoc_curate_authors.d index f3c1138..16669b2 100644 --- a/src/doc_reform/meta/metadoc_curate_authors.d +++ b/src/doc_reform/meta/metadoc_curate_authors.d @@ -454,7 +454,7 @@ string theme_light_1 = format(q"┃ doc_curate.title, doc_curate.path_html_metadata, doc_curate.language, - (_opt_action.very_verbose) ? "\n " ~ doc_curate.path_abs_html_scroll : "", + (_opt_action.show_curate_authors) ? "\n " ~ doc_curate.path_abs_html_scroll : "", ); } foreach (k; _au.keys.sort) { @@ -489,9 +489,7 @@ string theme_light_1 = format(q"┃ } catch (ErrnoException ex) { // Handle error } - if (_opt_action.verbose - || _opt_action.very_verbose - ) { + if (_opt_action.show_curate_authors) { foreach(_adt; _author_date_title.sort) { writeln(_adt); } diff --git a/src/doc_reform/meta/metadoc_curate_topics.d b/src/doc_reform/meta/metadoc_curate_topics.d index a8b0db0..07e1a56 100644 --- a/src/doc_reform/meta/metadoc_curate_topics.d +++ b/src/doc_reform/meta/metadoc_curate_topics.d @@ -466,7 +466,7 @@ string theme_light_1 = format(q"┃ if (k0 != "_a") { topics ~= format(q"┃

%s

┃", k0.translate([' ' : "_"]), k0,) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln("", k0); } if ("_a" in hvst.subject_trees[k0]) { @@ -495,7 +495,7 @@ string theme_light_1 = format(q"┃ t_a_.path_html_metadata, t_a_.language, ) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln("- ", t_a_.title, " - ", t_a_.author); } } @@ -508,7 +508,7 @@ string theme_light_1 = format(q"┃ topics ~= format(q"┃

%s

┃", k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k1,) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln(" ", k1); } if ("_a" in hvst.subject_trees[k0][k1]) { @@ -537,7 +537,7 @@ string theme_light_1 = format(q"┃ t_a_.path_html_metadata, t_a_.language, ) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln(" - ", t_a_.title, " - ", t_a_.author); } } @@ -551,7 +551,7 @@ string theme_light_1 = format(q"┃ topics ~= format(q"┃

%s

┃", k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k2.translate([' ' : "_"]), k2,) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln(" ", k2); } if ("_a" in hvst.subject_trees[k0][k1][k2]) { @@ -580,7 +580,7 @@ string theme_light_1 = format(q"┃ t_a_.path_html_metadata, t_a_.language, ) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln(" - ", t_a_.title, " - ", t_a_.author); } } @@ -594,7 +594,7 @@ string theme_light_1 = format(q"┃ topics ~= format(q"┃

%s

┃", k0.translate([' ' : "_"]), k1.translate([' ' : "_"]), k2.translate([' ' : "_"]), k3.translate([' ' : "_"]), k3,) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln(" ", k3); } { @@ -623,7 +623,7 @@ string theme_light_1 = format(q"┃ t_a_.path_html_metadata, t_a_.language, ) ~ "\n"; - if (_opt_action.very_verbose) { + if (_opt_action.show_curate_topics) { writeln(" - ", t_a_.title, " - ", t_a_.author); } } -- cgit v1.2.3