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/io_out/epub3.d | 30 ++--- src/doc_reform/io_out/html.d | 54 +++------ src/doc_reform/io_out/source_pod.d | 3 +- src/doc_reform/io_out/sqlite.d | 62 ++++------ 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 +-- src/doc_reform/spine.d | 165 ++++++++++++++++++--------- 8 files changed, 192 insertions(+), 177 deletions(-) (limited to 'src') diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 39fcafe..eb5e46a 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -365,8 +365,7 @@ template outputEPub3() { break; case 8: .. case 9: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup); writeln(__FILE__, ":", __LINE__, ": ", obj.text); } @@ -374,8 +373,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup); } } @@ -396,8 +394,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -406,8 +403,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -425,8 +421,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -466,8 +461,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -476,8 +470,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -520,8 +513,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -530,8 +522,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -542,8 +533,7 @@ template outputEPub3() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_epub - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_epub) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); } } diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index 0227de0..2e6d0ad 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -90,8 +90,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -100,8 +99,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -120,8 +118,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -152,8 +149,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -162,8 +158,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -198,8 +193,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -208,8 +202,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -220,8 +213,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); @@ -331,8 +323,7 @@ template outputHTML() { break; case 8: .. case 9: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup); writeln(__FILE__, ":", __LINE__, ": ", obj.text); } @@ -340,8 +331,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup); } } @@ -361,8 +351,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -371,8 +360,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -390,8 +378,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -430,8 +417,7 @@ template outputHTML() { doc_html[segment_filename] ~= t[0].to!string; doc_html_endnotes[segment_filename] ~= t[1]; } else { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -440,8 +426,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -484,8 +469,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -494,8 +478,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -506,8 +489,7 @@ template outputHTML() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_html - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_html) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); } } diff --git a/src/doc_reform/io_out/source_pod.d b/src/doc_reform/io_out/source_pod.d index 3b21000..4b59116 100644 --- a/src/doc_reform/io_out/source_pod.d +++ b/src/doc_reform/io_out/source_pod.d @@ -127,7 +127,8 @@ template spinePod() { pths_pod.doc_lng(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.mkdirRecurse; } } - debug(pod) { + if (doc_matters.opt.action.debug_do_pod + && doc_matters.opt.action.verbose) { writeln(__LINE__, ": ", doc_matters.src.filename, " -> ", pths_pod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index 3acd39e..7e4d605 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -172,8 +172,7 @@ template SQLiteDbRun() { writeln("ERROR SQLite : ", ex); } { /+ debug +/ - if (opt_action.debug_do_sqlite - && opt_action.verbose) { + if (opt_action.debug_do_sqlite) { writeln(note); if (opt_action.very_verbose) { writeln(db_statement); @@ -221,8 +220,7 @@ template SQLiteFormatAndLoadObject() { _txt ~= _urls; } { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(_txt, "\n"); } } @@ -265,8 +263,7 @@ template SQLiteFormatAndLoadObject() { string _urls; string _txt = _html_font_face(_html_special_characters(obj.text)); { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(_txt, "\n"); } } @@ -755,8 +752,7 @@ template SQLiteFormatAndLoadObject() { "html": html_heading(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -778,8 +774,7 @@ template SQLiteFormatAndLoadObject() { "html": html_para(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -801,8 +796,7 @@ template SQLiteFormatAndLoadObject() { "html": html_quote(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -824,8 +818,7 @@ template SQLiteFormatAndLoadObject() { "html": html_group(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -847,8 +840,7 @@ template SQLiteFormatAndLoadObject() { "html": html_block(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -870,8 +862,7 @@ template SQLiteFormatAndLoadObject() { "html": html_verse(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -893,8 +884,7 @@ template SQLiteFormatAndLoadObject() { "html": html_code(obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -916,8 +906,7 @@ template SQLiteFormatAndLoadObject() { "html": html_table(doc_matters, obj) ]; { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { debug(sql_txt) { writeln(obj_txt["text"]); } @@ -1297,8 +1286,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -1307,8 +1295,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -1332,8 +1319,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -1364,8 +1350,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -1374,8 +1359,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -1404,8 +1388,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); } } @@ -1414,8 +1397,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type); } } @@ -1426,8 +1408,7 @@ template SQLiteInsertDocObjectsLoop() { break; default: { /+ debug +/ - if (doc_matters.opt.action.debug_do_sqlite - && doc_matters.opt.action.verbose) { + if (doc_matters.opt.action.debug_do_sqlite) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); // check where empty value could come from writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from @@ -1436,7 +1417,10 @@ template SQLiteInsertDocObjectsLoop() { break; } if (obj.metainfo.is_a == "heading") { - if ((doc_matters.opt.action.very_verbose)) { + if (doc_matters.opt.action.show_sqlite) { + if (obj.metainfo.heading_lev_markup == 0) { + writeln(doc_matters.src.filename); + } writeln( "markup: ", obj.metainfo.heading_lev_markup, "> ", obj.metainfo.dom_structure_markedup_tags_status, 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); } } diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 97cc6b0..91184dc 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -116,13 +116,18 @@ string program_name = "spine"; "concordance" : false, "dark" : false, "debug" : false, - "debug-pod" : false, + "debug-curate" : false, + "debug-curate-authors" : false, + "debug-curate-topics" : false, "debug-epub" : false, "debug-harvest" : false, "debug-html" : false, "debug-latex" : false, "debug-manifest" : false, + "debug-metadata" : false, + "debug-pod" : false, "debug-sqlite" : false, + "debug-stages" : false, "digest" : false, "epub" : false, "curate" : false, @@ -148,10 +153,19 @@ string program_name = "spine"; "quiet" : false, "pod" : false, "serial" : false, - "show-summary" : false, - "show-metadata" : false, - "show-make" : false, "show-config" : false, + "show-curate" : false, + "show-curate-authors" : false, + "show-curate-topics" : false, + "show-epub" : false, + "show-html" : false, + "show-latex" : false, + "show-make" : false, + "show-manifest" : false, + "show-metadata" : false, + "show-pod" : false, + "show-sqlite" : false, + "show-summary" : false, "source" : false, "sqlite-discrete" : false, "sqlite-db-create" : false, @@ -213,14 +227,6 @@ string program_name = "spine"; "curate-authors", "extract info on authors from document header metadata", &opts["curate-authors"], "curate-topics", "extract info on topics from document header metadata", &opts["curate-topics"], "dark", "alternative dark theme", &opts["dark"], - "debug", "debug", &opts["debug"], - "debug-pod", "debug pod", &opts["debug-pod"], - "debug-epub", "debug epub", &opts["debug-epub"], - "debug-harvest", "debug harvest", &opts["debug-harvest"], - "debug-html", "debug html", &opts["debug-html"], - "debug-latex", "debug latex", &opts["debug-latex"], - "debug-manifest", "debug manifest", &opts["debug-manifest"], - "debug-sqlite", "debug sqlite", &opts["debug-sqlite"], "digest", "hash digest for each object", &opts["digest"], "epub", "process epub output", &opts["epub"], "hide-ocn", "object cite numbers", &opts["hide-ocn"], @@ -255,8 +261,17 @@ string program_name = "spine"; "serial", "serial processing", &opts["serial"], "skip-output", "skip output", &opts["skip-output"], "show-config", "show config", &opts["show-config"], + "show-curate", "show curate", &opts["show-curate"], + "show-curate-authors", "show curate authors", &opts["show-curate-authors"], + "show-curate-topics", "show curate topics", &opts["show-curate-topics"], + "show-epub", "show epub", &opts["show-epub"], + "show-html", "show html", &opts["show-html"], + "show-latex", "show latex", &opts["show-latex"], "show-make", "show make", &opts["show-make"], + "show-manifest", "show manifest", &opts["show-manifest"], "show-metadata", "show metadata", &opts["show-metadata"], + "show-pod", "show pod", &opts["show-pod"], + "show-sqlite", "show sqlite", &opts["show-sqlite"], "show-summary", "show summary", &opts["show-summary"], "source", "document markup source", &opts["source"], "set-digest", "default hash digest type (e.g. sha256)", &settings["set-digest"], @@ -284,6 +299,19 @@ string program_name = "spine"; "workon", "(reserved for some matters under development & testing)", &opts["workon"], "xhtml", "xhtml output", &opts["xhtml"], "config", "=/path/to/config/file/including/filename", &settings["config"], + "debug", "debug", &opts["debug"], + "debug-curate", "debug curate", &opts["debug-curate"], + "debug-curate-authors", "debug curate authors", &opts["debug-curate-authors"], + "debug-curate-topics", "debug curate topics", &opts["debug-curate-topics"], + "debug-epub", "debug epub", &opts["debug-epub"], + "debug-harvest", "debug harvest", &opts["debug-harvest"], + "debug-html", "debug html", &opts["debug-html"], + "debug-latex", "debug latex", &opts["debug-latex"], + "debug-manifest", "debug manifest", &opts["debug-manifest"], + "debug-metadata", "debug metadata", &opts["debug-metadata"], + "debug-pod", "debug pod", &opts["debug-pod"], + "debug-sqlite", "debug sqlite", &opts["debug-sqlite"], + "debug-stages", "debug stages", &opts["debug-stages"], // "sqlite-db-filename", "=[filename].sql.db", &settings["sqlite-db-filename"], ); if (helpInfo.helpWanted) { @@ -316,20 +344,19 @@ string program_name = "spine"; } @trusted bool debug_do() { bool _dbg; - if (opts["debug"] - ||opts["debug-epub"] - ||opts["debug-harvest"] - ||opts["debug-html"] - ||opts["debug-latex"] - ||opts["debug-manifest"] - ||opts["debug-sqlite"] - ) { + if (opts["debug"]) { _dbg = true; } else { _dbg = false; } return _dbg; } - @trusted bool debug_do_pod() { - return (opts["debug"] || opts["debug-pod"]) ? true : false; + @trusted bool debug_do_curate() { + return (opts["debug"] || opts["debug-curate"]) ? true : false; + } + @trusted bool debug_do_curate_authors() { + return (opts["debug"] || opts["debug-curate"] || opts["debug-curate-authors"]) ? true : false; + } + @trusted bool debug_do_curate_topics() { + return (opts["debug"] || opts["debug-curate"] || opts["debug-curate-topics"]) ? true : false; } @trusted bool debug_do_epub() { return (opts["debug"] || opts["debug-epub"]) ? true : false; @@ -346,9 +373,18 @@ string program_name = "spine"; @trusted bool debug_do_manifest() { return (opts["debug"] || opts["debug-manifest"]) ? true : false; } + @trusted bool debug_do_metadata() { + return (opts["debug"] || opts["debug-metadata"]) ? true : false; + } + @trusted bool debug_do_pod() { + return (opts["debug"] || opts["debug-pod"]) ? true : false; + } @trusted bool debug_do_sqlite() { return (opts["debug"] || opts["debug-sqlite"]) ? true : false; } + @trusted bool debug_do_stages() { + return (opts["debug"] || opts["debug-stages"]) ? true : false; + } @trusted bool debug_do_xmls() { return (opts["debug"] || opts["debug-html"] || opts["debug-epub"]) ? true : false; } @@ -409,17 +445,44 @@ string program_name = "spine"; @trusted bool pod() { return opts["pod"]; } - @trusted bool show_summary() { - return opts["show-summary"]; + @trusted bool show_config() { + return opts["show-config"]; + } + @trusted bool show_curate() { + return opts["show-curate"]; + } + @trusted bool show_curate_authors() { + return (opts["show-curate"] || opts["show-curate-authors"] || opts["verbose"] || opts["very-verbose"]) ? true : false; + } + @trusted bool show_curate_topics() { + return (opts["show-curate"] || opts["show-curate-topics"] || opts["very-verbose"]) ? true : false; + } + @trusted bool show_epub() { + return opts["show-epub"]; + } + @trusted bool show_html() { + return opts["show-html"]; + } + @trusted bool show_latex() { + return opts["show-latex"]; } @trusted bool show_make() { return opts["show-make"]; } + @trusted bool show_manifest() { + return opts["show-manifest"]; + } @trusted bool show_metadata() { return opts["show-metadata"]; } - @trusted bool show_config() { - return opts["show-config"]; + @trusted bool show_pod() { + return opts["show-pod"]; + } + @trusted bool show_sqlite() { + return (opts["show-sqlite"] || opts["very-verbose"]) ? true : false; + } + @trusted bool show_summary() { + return (opts["show-summary"] || opts["verbose"] || opts["very-verbose"]) ? true : false; } @trusted bool source() { return opts["source"]; @@ -720,13 +783,13 @@ string program_name = "spine"; } if (!(_opt_action.skip_output)) { if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { writeln("step0 commence → (without processing files)"); } outputHubOp!()(_env, _opt_action, _siteConfig); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { writeln("- step0 complete"); } @@ -924,23 +987,21 @@ string program_name = "spine"; manifest.src.filename ~ "»" ); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("--->\nstepX commence → (document abstraction)"); + writeln("--->\nstepX commence → (document abstraction) [", manifest.src.filename, "]"); } auto t = spineAbstraction!()(_env, program_info, _opt_action, _cfg, manifest, _make_and_meta_struct); static assert(t.length==2); auto doc_abstraction = t[dAM.abstraction]; auto doc_matters = t[dAM.matters]; if ((doc_matters.opt.action.debug_do) - || (doc_matters.opt.action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- stepX complete"); + writeln("- stepX complete for [", manifest.src.filename, "]"); } /+ ↓ debugs +/ - if (doc_matters.opt.action.verbose - || doc_matters.opt.action.show_summary - ) { + if (doc_matters.opt.action.show_summary) { import doc_reform.meta.metadoc_show_summary; spineMetaDocSummary!()(doc_abstraction, doc_matters); } @@ -968,7 +1029,8 @@ string program_name = "spine"; hvst.curates ~= _hvst; } else { if ((doc_matters.opt.action.debug_do) - || (doc_matters.opt.action.very_verbose) + || (_opt_action.debug_do_curate) + || (doc_matters.opt.action.very_verbose) ) { writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); } @@ -981,15 +1043,15 @@ string program_name = "spine"; /+ ↓ output hub +/ if (!(doc_matters.opt.action.skip_output)) { if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("step5 commence → (process outputs)"); + writeln("step5 commence → (process outputs) [", manifest.src.filename, "]"); } doc_abstraction.outputHub!()(doc_matters); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- step5 complete"); + writeln("- step5 complete for [", manifest.src.filename, "]"); } } scope(exit) { @@ -1038,23 +1100,21 @@ string program_name = "spine"; manifest.src.filename ~ "»" ); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("--->\nstepX commence → (document abstraction)"); + writeln("--->\nstepX commence → (document abstraction) [", manifest.src.filename, "]"); } auto t = spineAbstraction!()(_env, program_info, _opt_action, _cfg, manifest, _make_and_meta_struct); static assert(t.length==2); auto doc_abstraction = t[dAM.abstraction]; auto doc_matters = t[dAM.matters]; if ((doc_matters.opt.action.debug_do) - || (doc_matters.opt.action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- stepX complete"); + writeln("- stepX complete for [", manifest.src.filename, "]"); } /+ ↓ debugs +/ - if (doc_matters.opt.action.verbose - || doc_matters.opt.action.show_summary - ) { + if (doc_matters.opt.action.show_summary) { import doc_reform.meta.metadoc_show_summary; spineMetaDocSummary!()(doc_abstraction, doc_matters); } @@ -1082,7 +1142,8 @@ string program_name = "spine"; hvst.curates ~= _hvst; } else { if ((doc_matters.opt.action.debug_do) - || (doc_matters.opt.action.very_verbose) + || (_opt_action.debug_do_curate) + || (doc_matters.opt.action.very_verbose) ) { writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); } @@ -1095,15 +1156,15 @@ string program_name = "spine"; /+ ↓ output hub +/ if (!(doc_matters.opt.action.skip_output)) { if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("step5 commence → (process outputs)"); + writeln("step5 commence → (process outputs) [", manifest.src.filename, "]"); } doc_abstraction.outputHub!()(doc_matters); if ((_opt_action.debug_do) - || (_opt_action.very_verbose) + || (_opt_action.debug_do_stages) ) { - writeln("- step5 complete"); + writeln("- step5 complete for [", manifest.src.filename, "]"); } } scope(exit) { -- cgit v1.2.3