diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2025-09-24 23:55:49 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2025-09-25 11:58:17 -0400 |
commit | 710bb22a76d6dcd33395984726cf0cc08f894122 (patch) | |
tree | c2d3969cf48a2facf55b4be5c7f1b5dffd27e088 /src | |
parent | spine.d tidy (diff) |
terminal output verbosity levels, minor rework
Diffstat (limited to 'src')
-rw-r--r-- | src/sisudoc/io_in/paths_source.d | 8 | ||||
-rw-r--r-- | src/sisudoc/io_in/read_config_files.d | 2 | ||||
-rw-r--r-- | src/sisudoc/io_out/epub3.d | 4 | ||||
-rw-r--r-- | src/sisudoc/io_out/html.d | 6 | ||||
-rw-r--r-- | src/sisudoc/io_out/hub.d | 10 | ||||
-rw-r--r-- | src/sisudoc/io_out/latex.d | 6 | ||||
-rw-r--r-- | src/sisudoc/io_out/metadata.d | 10 | ||||
-rw-r--r-- | src/sisudoc/io_out/odt.d | 54 | ||||
-rw-r--r-- | src/sisudoc/io_out/source_pod.d | 36 | ||||
-rw-r--r-- | src/sisudoc/io_out/sqlite.d | 12 | ||||
-rw-r--r-- | src/sisudoc/io_out/xmls.d | 2 | ||||
-rw-r--r-- | src/sisudoc/meta/metadoc_show_summary.d | 2 | ||||
-rw-r--r-- | src/sisudoc/share/defaults.d | 4 | ||||
-rwxr-xr-x | src/sisudoc/spine.d | 81 |
14 files changed, 130 insertions, 107 deletions
diff --git a/src/sisudoc/io_in/paths_source.d b/src/sisudoc/io_in/paths_source.d index c30b5d5..2c0d545 100644 --- a/src/sisudoc/io_in/paths_source.d +++ b/src/sisudoc/io_in/paths_source.d @@ -88,8 +88,10 @@ template PodManifest() { _manifest_path = m.captures["podpath"]; } } else { - if (_opt_action.vox_gt1 || _opt_action.debug_do) { - writeln("WARNING, src is not a pod, issue with manifest_path: ", _pth); // remove? unless can distinguish pod + if (_opt_action.vox_gt_3 || _opt_action.debug_do) { + if (exists(_pth) == 0 && (_pth.isFile)) { + writeln("WARNING, src file is not .sst or .ssm (nor is it a pod directory): ", _pth); // remove? unless can distinguish pod + } } _manifest_path = ""; } @@ -106,7 +108,7 @@ template PodManifest() { _k = pod_manifest_path; } if (exists(_k)==0) { - writeln("ERROR >> Processing Skipped! Manifest not found: ", _k); + // writeln("ERROR >> Processing Skipped! Manifest not found: ", _k); _k = null; } return _k; diff --git a/src/sisudoc/io_in/read_config_files.d b/src/sisudoc/io_in/read_config_files.d index 9a390d5..531dc72 100644 --- a/src/sisudoc/io_in/read_config_files.d +++ b/src/sisudoc/io_in/read_config_files.d @@ -138,7 +138,7 @@ webserv: try { if (exists(conf_file)) { if (conf_file.getLinkAttributes.attrIsFile) { - if (_opt_action.vox_gt1 || _opt_action.debug_do) { + if (_opt_action.vox_gt_2 || _opt_action.debug_do) { writeln("config file used: \"", conf_file, "\" (cli flag settings override config file's individual settings)"); } config_file_str = conf_file.readText; diff --git a/src/sisudoc/io_out/epub3.d b/src/sisudoc/io_out/epub3.d index 77bf040..c8ca757 100644 --- a/src/sisudoc/io_out/epub3.d +++ b/src/sisudoc/io_out/epub3.d @@ -737,7 +737,7 @@ template outputEPub3() { foreach (image; doc_matters.srcs.image_list) { { /+ debug +/ if (doc_matters.opt.action.debug_do_epub) { - if (doc_matters.opt.action.vox_gt2) { + if (doc_matters.opt.action.vox_gt_3) { writeln( doc_matters.src.image_dir_path, "/", image, " -> ", pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename), "/", image @@ -784,7 +784,7 @@ template outputEPub3() { } catch (ErrnoException ex) { // Handle error } - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", fn_epub); } debug(epub_archive) { diff --git a/src/sisudoc/io_out/html.d b/src/sisudoc/io_out/html.d index 5ca320c..fc9ef54 100644 --- a/src/sisudoc/io_out/html.d +++ b/src/sisudoc/io_out/html.d @@ -262,7 +262,7 @@ template outputHTML() { } catch (ErrnoException ex) { // Handle error } - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pth_html.fn_scroll(doc_matters.src.filename)); } } @@ -545,7 +545,7 @@ template outputHTML() { } catch (ErrnoException ex) { // handle error } - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc")); } } @@ -593,7 +593,7 @@ template outputHTML() { if (exists(fn_src_in)) { fn_src_in.copy(fn_src_out); } else { - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln("WARNING image not found: ", fn_src_in); } } diff --git a/src/sisudoc/io_out/hub.d b/src/sisudoc/io_out/hub.d index 8c41ce5..0e25811 100644 --- a/src/sisudoc/io_out/hub.d +++ b/src/sisudoc/io_out/hub.d @@ -131,7 +131,7 @@ template outputHub() { msg.vv("sqlite done"); } } - if (doc.matters.opt.action.vox_gt0) { writeln(doc.matters.src.filename_base); } + if (doc.matters.opt.action.vox_gt_1) { writeln(doc.matters.src.filename_base); } if (!(doc.matters.opt.action.parallelise_subprocesses)) { foreach(schedule; doc.matters.opt.action.output_task_scheduler) { Scheduled!()(schedule, doc); @@ -203,23 +203,23 @@ template outputHubOp() { sisudoc.io_out.paths_output; @system void outputHubOp(E,O,C)(E env, O opt_action, C config) { if ((opt_action.sqlite_db_drop)) { - if ((opt_action.vox_gt1)) { + if ((opt_action.vox_gt_2)) { writeln("sqlite drop db..."); } import sisudoc.io_out.sqlite; SQLiteDbDrop!()(opt_action, config); - if ((opt_action.vox_gt2)) { + if ((opt_action.vox_gt_3)) { writeln("sqlite drop db done"); } } if ((opt_action.sqlite_db_create)) { - if ((opt_action.vox_gt1)) { + if ((opt_action.vox_gt_2)) { auto pth_sqlite_db = spinePathsSQLite!()(opt_action.cgi_sqlite_search_filename, opt_action.output_dir_set); writeln("sqlite create table..."); } import sisudoc.io_out.sqlite; SQLiteTablesCreate!()(env, opt_action, config); - if ((opt_action.vox_gt2)) { + if ((opt_action.vox_gt_3)) { writeln("sqlite create table done"); } } diff --git a/src/sisudoc/io_out/latex.d b/src/sisudoc/io_out/latex.d index d895e25..02e434e 100644 --- a/src/sisudoc/io_out/latex.d +++ b/src/sisudoc/io_out/latex.d @@ -1294,7 +1294,7 @@ template outputLaTeX() { default: { /+ debug +/ if (doc_matters.opt.action.debug_do_latex - && doc_matters.opt.action.vox_gt1) { + && doc_matters.opt.action.vox_gt_2) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); @@ -1332,7 +1332,7 @@ template outputLaTeX() { try { { /+ debug +/ if (doc_matters.opt.action.debug_do_latex - && doc_matters.opt.action.vox_gt1) { + && doc_matters.opt.action.vox_gt_2) { writeln(latex_content.head); writeln(latex_content.content); writeln(latex_content.tail); @@ -1341,7 +1341,7 @@ template outputLaTeX() { if (!exists(pth_latex.latex_path_stuff)) { (pth_latex.latex_path_stuff).mkdirRecurse; } - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pth_latex.latex_file_with_path(paper_size_orientation)); } { diff --git a/src/sisudoc/io_out/metadata.d b/src/sisudoc/io_out/metadata.d index 0d586d2..6e6183b 100644 --- a/src/sisudoc/io_out/metadata.d +++ b/src/sisudoc/io_out/metadata.d @@ -392,7 +392,7 @@ string theme_light_1 = format(q"┃ } catch (ErrnoException ex) { // Handle error } - if (doc_matters.opt.action.vox_gt0) { writeln(" ", pth_html.fn_scroll("metadata." ~ doc_matters.src.filename)); } + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pth_html.fn_scroll("metadata." ~ doc_matters.src.filename)); } } static auto mkup = InlineMarkup(); import sisudoc.io_out.html_snippet; @@ -442,7 +442,7 @@ string theme_light_1 = format(q"┃ metadata_ ~= "</div>" ~ inline_search_form(doc_matters) ~ "</div><hr />"; if (!(doc_matters.conf_make_meta.meta.title_full.empty)) { metadata_ ~= "<p class=\"lev0\">Title: <b><a href=\"" ~ doc_matters.src.filename_base ~ "/toc.html\">" ~ doc_matters.conf_make_meta.meta.title_full ~ "</a></b></p>"; - } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt2) { + } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt_3) { writeln("ERROR no Title information provided in document header ", doc_matters.src.filename_base); } if (!(doc_matters.conf_make_meta.meta.creator_author.empty)) { @@ -453,18 +453,18 @@ string theme_light_1 = format(q"┃ metadata_ ~= "<p class=\"lev1\">Author: <b>" ~ doc_matters.conf_make_meta.meta.creator_author ~ "</b></p>"; } - } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt2) { + } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt_3) { writeln("ERROR no Author information provided in document header ", doc_matters.src.filename_base); } metadata_ ~= "<p class=\"lev1\">Published: " ~ doc_matters.conf_make_meta.meta.date_published ~ "</p>"; if (!(doc_matters.conf_make_meta.meta.rights_copyright.empty)) { metadata_ ~= "<p class=\"lev1\">Copyright: " ~ special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright) ~ "</p>"; - } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt2) { + } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt_3) { writeln("WARNING no Copyright information provided in document header ", doc_matters.src.filename_base); } if (!(doc_matters.conf_make_meta.meta.rights_license.empty)) { metadata_ ~= "<p class=\"lev1\">License: " ~ special_characters_text(doc_matters.conf_make_meta.meta.rights_license) ~ "</p>"; - } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt2) { + } else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt_3) { writeln("WARNING no License information provided in document header ", doc_matters.src.filename_base); } if (!(doc_matters.conf_make_meta.meta.notes_summary.empty)) { diff --git a/src/sisudoc/io_out/odt.d b/src/sisudoc/io_out/odt.d index 8740d44..c8f5fe9 100644 --- a/src/sisudoc/io_out/odt.d +++ b/src/sisudoc/io_out/odt.d @@ -50,20 +50,17 @@ module sisudoc.io_out.odt; @safe: template formatODT() { - import - sisudoc.io_out, - sisudoc.io_out.rgx, - sisudoc.io_out.rgx_xhtml; - import - std.file, - std.outbuffer, - std.uri, - std.zip, - std.conv : to; - import - sisudoc.io_out.create_zip_file, - sisudoc.io_out.xmls, - sisudoc.io_out.xmls_css; + import sisudoc.io_out; + import sisudoc.io_out.rgx; + import sisudoc.io_out.rgx_xhtml; + import std.file; + import std.outbuffer; + import std.uri; + import std.zip; + import std.conv : to; + import sisudoc.io_out.create_zip_file; + import sisudoc.io_out.xmls; + import sisudoc.io_out.xmls_css; mixin spineRgxOut; mixin spineRgxXHTML; struct formatODT { @@ -645,20 +642,17 @@ template formatODT() { } } template outputODT() { - import - sisudoc.io_out, - sisudoc.io_out.rgx, - sisudoc.io_out.rgx_xhtml; - import - std.file, - std.outbuffer, - std.uri, - std.zip, - std.conv : to; - import - sisudoc.io_out.create_zip_file, - sisudoc.io_out.xmls, - sisudoc.io_out.xmls_css; + import sisudoc.io_out; + import sisudoc.io_out.rgx; + import sisudoc.io_out.rgx_xhtml; + import std.file; + import std.outbuffer; + import std.uri; + import std.zip; + import std.conv : to; + import sisudoc.io_out.create_zip_file; + import sisudoc.io_out.xmls; + import sisudoc.io_out.xmls_css; mixin InternalMarkup; mixin spineRgxOut; mixin spineRgxXHTML; @@ -886,7 +880,7 @@ template outputODT() { default: { /+ debug +/ if (doc_matters.opt.action.debug_do - && doc_matters.opt.action.vox_gt1) { + && doc_matters.opt.action.vox_gt_2) { writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a); writeln(__FILE__, ":", __LINE__, ": ", obj.text); @@ -2099,7 +2093,7 @@ template outputODT() { } } } - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pth_odt.odt_file); } } diff --git a/src/sisudoc/io_out/source_pod.d b/src/sisudoc/io_out/source_pod.d index 6ac2590..bfc2fac 100644 --- a/src/sisudoc/io_out/source_pod.d +++ b/src/sisudoc/io_out/source_pod.d @@ -101,7 +101,7 @@ template spinePod() { pths_pod.pod_dir_().mkdirRecurse; } if (doc_matters.opt.action.source_or_pod) { - // if (doc_matters.opt.action.vox_gt0) { writeln(" ", pths_pod.fn_pod_filelist(doc_matters.src.filename).filesystem_open_zpod); } + // if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pths_pod.fn_pod_filelist(doc_matters.src.filename).filesystem_open_zpod); } if (!exists(pths_pod.text_root(doc_matters.src.filename).filesystem_open_zpod)) { pths_pod.text_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse; } @@ -136,7 +136,7 @@ template spinePod() { } auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) { auto pth_dr_doc_src = doc_matters.src_path_info; - if (doc_matters.opt.action.vox_gt2) { // correct + if (doc_matters.opt.action.vox_gt_3) { // correct writeln(__LINE__, ":", __FILE__, ":\n", doc_matters.src.filename, " -> ", pths_pod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod @@ -147,7 +147,7 @@ template spinePod() { string[string][string] _digests; { // bundle images - get digest foreach (image; doc_matters.srcs.image_list) { - if (doc_matters.opt.action.vox_gt2) { + if (doc_matters.opt.action.vox_gt_3) { writeln( pth_dr_doc_src.image_root.to!string, "/", image, " -> ", pths_pod.image_root(doc_matters.src.filename).zpod, "/", image @@ -174,7 +174,7 @@ template spinePod() { zip = podArchive("file_path_bin", fn_src_in, fn_src_out_pod_zip_base, zip); } } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { writeln("WARNING (io) src out NOT found (image): ", fn_src_in); } } @@ -198,7 +198,7 @@ template spinePod() { zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip); } } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { writeln("WARNING (io) src out NOT found (document make): ", fn_src_in); } } @@ -222,7 +222,7 @@ template spinePod() { = File(pths_pod.fn_pod_filelist(doc_matters.src.filename).filesystem_open_zpod, "w"); Node _pmy; string _pm = "doc:\n filename: " ~ doc_matters.src.filename ~ "\n language: " ~ doc_matters.pod.manifest_list_of_languages.to!string ~ "\n"; - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { try { _pmy = Loader.fromString(_pm).load(); } catch (ErrnoException ex) { @@ -297,7 +297,7 @@ template spinePod() { } } } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { writeln("WARNING (io) src in NOT found (markup source): \n", _sstm, "or in", fn_src_in); } } @@ -346,7 +346,7 @@ template spinePod() { zip = podArchive("file_path_text", _pth_mkup_src_in, _pth_mkup_src_out, zip); } } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { writeln("WARNING (io) src out NOT found (insert file): ", _pth_mkup_src_in); } } @@ -380,7 +380,7 @@ template spinePod() { zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip); } } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { writeln("WARNING (io) src out NOT found (insert file): ", fn_src_in); } } @@ -446,19 +446,19 @@ template spinePod() { // Handle error } try { - // if (doc_matters.opt.action.vox_gt1) { writeln(" ", pths_pod.pod_dir_(), "/", doc_matters.src.filename_base, ".digests.txt"); } + // if (doc_matters.opt.action.vox_gt_2) { writeln(" ", pths_pod.pod_dir_(), "/", doc_matters.src.filename_base, ".digests.txt"); } string _digest_fn = pths_pod.pod_dir_() ~ "/" ~ doc_matters.src.filename_base ~ ".digests.txt"; - // if (doc_matters.opt.action.vox_gt1) { writeln(_digest_fn); } + // if (doc_matters.opt.action.vox_gt_2) { writeln(_digest_fn); } auto f = File(_digest_fn, "w"); if (exists(fn_pod)) { try { auto data = (cast(byte[]) (fn_pod).read); - // if (doc_matters.opt.action.vox_gt1) { writeln(" ", doc_matters.src.filename, " > ", doc_matters.src.filename_base, ".zip"); } + // if (doc_matters.opt.action.vox_gt_2) { writeln(" ", doc_matters.src.filename, " > ", doc_matters.src.filename_base, ".zip"); } if (doc_matters.opt.action.pod) { _zip_digest = (data.sha256Of.toHexString ~ "::" ~ data.length.to!string ~ " - " ~ doc_matters.src.filename_base ~ ".zip"); - if (doc_matters.opt.action.vox_gt0) { writeln(" ", _zip_digest); } - if (doc_matters.opt.action.vox_gt0) { writeln(" ", pths_pod.pod_dir_(), "/", doc_matters.src.filename_base, "/"); } - if (doc_matters.opt.action.vox_gt0) { writeln(" ", _digest_fn); } + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", _zip_digest); } + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", pths_pod.pod_dir_(), "/", doc_matters.src.filename_base, "/"); } + if (doc_matters.opt.action.vox_gt_1) { writeln(" ", _digest_fn); } f.writeln(_zip_digest); } } catch (ErrnoException ex) { @@ -468,18 +468,18 @@ template spinePod() { foreach (_lang; doc_matters.pod.manifest_list_of_languages) { if (_lang in _digests) { if (("sstm" in _digests[_lang]) && (_digests[_lang]["sstm"].length > 0)) { - // if (doc_matters.opt.action.vox_gt1) { writeln(_digests[_lang]["sstm"]); } + // if (doc_matters.opt.action.vox_gt_2) { writeln(_digests[_lang]["sstm"]); } f.writeln(_digests[_lang]["sstm"]); } if (("ssi" in _digests[_lang]) && (_digests[_lang]["ssi"].length > 0)) { - // if (doc_matters.opt.action.vox_gt1) { writeln(_digests[_lang]["ssi"]); } + // if (doc_matters.opt.action.vox_gt_2) { writeln(_digests[_lang]["ssi"]); } f.writeln(_digests[_lang]["ssi"]); } } } if ("shared" in _digests) { if (("images" in _digests["shared"]) && (_digests["shared"]["images"].length > 0)) { - // if (doc_matters.opt.action.vox_gt1) { writeln(_digests["shared"]["images"]); } + // if (doc_matters.opt.action.vox_gt_2) { writeln(_digests["shared"]["images"]); } f.writeln(_digests["shared"]["images"]); } } diff --git a/src/sisudoc/io_out/sqlite.d b/src/sisudoc/io_out/sqlite.d index 486b87e..a62e658 100644 --- a/src/sisudoc/io_out/sqlite.d +++ b/src/sisudoc/io_out/sqlite.d @@ -112,7 +112,7 @@ template SQLiteHubBuildTablesAndPopulate() { _db_statement = []; } db.close; - if (doc.matters.opt.action.vox_gt0) { + if (doc.matters.opt.action.vox_gt_1) { writeln(" ", pth_sqlite.sqlite_file); } } @@ -195,7 +195,7 @@ template SQLiteHubDiscreteBuildTablesAndPopulate() { import core.runtime; core.runtime.Runtime.terminate(); } - if (doc.matters.opt.action.vox_gt0) { + if (doc.matters.opt.action.vox_gt_1) { writeln(" ", pth_sqlite.sqlite_file(doc.matters.src.filename)); } } @@ -227,7 +227,7 @@ template SQLiteDbRun() { { /+ debug +/ if (opt_action.debug_do_sqlite) { writeln(note); - if (opt_action.vox_gt2) { + if (opt_action.vox_gt_3) { writeln(db_statement); } } @@ -480,7 +480,7 @@ template SQLiteFormatAndLoadObject() { ); } } else { - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln( "WARNING on internal document links, anchor to link <<" ~ m.captures["hash"] @@ -1658,12 +1658,12 @@ template SQLiteTablesCreate() { ? config.conf.w_srv_db_sqlite_path : ""; if (db_filename.length > 0 && db_path.length > 0) { - if (opt_action.vox_gt2) { + if (opt_action.vox_gt_3) { writeln("db name: ", db_filename); writeln("db path: ", db_path); writeln("db name & path: ", db_path, "/", db_filename); } - if (opt_action.vox_gt1) { + if (opt_action.vox_gt_2) { writeln("attempting to create db: ", db_path, "/", db_filename); } auto pth_sqlite = spinePathsSQLite!()(db_filename, db_path); diff --git a/src/sisudoc/io_out/xmls.d b/src/sisudoc/io_out/xmls.d index 1091aa5..bf52524 100644 --- a/src/sisudoc/io_out/xmls.d +++ b/src/sisudoc/io_out/xmls.d @@ -575,7 +575,7 @@ string tail(M)(M doc_matters) { ); } } else { - if (doc_matters.opt.action.vox_gt0) { + if (doc_matters.opt.action.vox_gt_1) { writeln( "WARNING on internal document links, anchor to link <<" ~ m.captures["hash"] diff --git a/src/sisudoc/meta/metadoc_show_summary.d b/src/sisudoc/meta/metadoc_show_summary.d index 923473c..ceb4fd5 100644 --- a/src/sisudoc/meta/metadoc_show_summary.d +++ b/src/sisudoc/meta/metadoc_show_summary.d @@ -73,7 +73,7 @@ template spineMetaDocSummary() { char_repeat_number = (char_repeat_number > min_repeat_number) ? char_repeat_number : min_repeat_number; - if (doc_matters.opt.action.vox_gt1 + if (doc_matters.opt.action.vox_gt_2 || doc_matters.opt.action.show_summary) { string[string] check = [ "last_object_number" : "NA [debug \"checkdoc\" not run]", diff --git a/src/sisudoc/share/defaults.d b/src/sisudoc/share/defaults.d index 502aca0..c285260 100644 --- a/src/sisudoc/share/defaults.d +++ b/src/sisudoc/share/defaults.d @@ -57,12 +57,12 @@ template Msg() { auto Msg(I)(I doc_matters) { struct Msg_ { void v()(string message) { - if (doc_matters.opt.action.vox_gt1) { + if (doc_matters.opt.action.vox_gt_2) { writeln(message); } } void vv()(string message) { - if (doc_matters.opt.action.vox_gt2) { + if (doc_matters.opt.action.vox_gt_3) { writeln(message); } } diff --git a/src/sisudoc/spine.d b/src/sisudoc/spine.d index 2b6096b..eceaf51 100755 --- a/src/sisudoc/spine.d +++ b/src/sisudoc/spine.d @@ -185,9 +185,11 @@ string program_name = "spine"; "sqlite-insert" : false, "sqlite-update" : false, "text" : false, - "vox_is0" : false, - "vox_gt1" : false, - "vox_gt2" : false, + "vox_is0" : false, // silent + "vox_is1" : false, // quiet + "vox_is2" : false, // default (unset) + "vox_is3" : false, // verbose + "vox_is4" : false, // very verbose "xhtml" : false, "section_toc" : true, "section_body" : true, @@ -268,7 +270,7 @@ string program_name = "spine"; "pdf-color-links", "mono or color links for pdfs", &opts["pdf-color-links"], "pdf-init", "initialise latex shared files (see latex-header-sty)", &opts["pdf-init"], "pod", "spine (doc reform) pod source content bundled", &opts["pod"], - "quiet|q", "output to terminal", &opts["vox_is0"], + "quiet|q", "output to terminal", &opts["vox_is1"], "section-backmatter", "document backmatter (default)" , &opts["backmatter"], "section-biblio", "document biblio (default)", &opts["section_biblio"], "section-blurb", "document blurb (default)", &opts["section_blurb"], @@ -293,6 +295,7 @@ string program_name = "spine"; "show-sqlite", "show sqlite", &opts["show-sqlite"], "show-summary", "show summary", &opts["show-summary"], "source", "document markup source", &opts["source"], + "silent", "output to terminal", &opts["vox_is0"], "set-digest", "default hash digest type (e.g. sha256)", &settings["set-digest"], "set-papersize", "default papersize (latex pdf eg. a4 or a5 or b4 or letter)", &settings["set-papersize"], "set-textwrap", "default textwrap (e.g. 80 (characters)", &settings["set-textwrap"], @@ -305,16 +308,16 @@ string program_name = "spine"; "sqlite-delete", "sqlite output", &opts["sqlite-delete"], "sqlite-insert", "sqlite output", &opts["sqlite-insert"], "sqlite-update", "sqlite output", &opts["sqlite-update"], + "text", "text output", &opts["text"], + "txt", "text output", &opts["text"], "www-http", "http or https", &settings["www-http"], "www-host", "web server host (domain) name", &settings["www-host"], "www-host-doc-root", "web host host (domain) name with path to doc root", &settings["www-host-doc-root"], "www-url-doc-root", "e.g. http://localhost", &settings["www-url-doc-root"], - "text", "text output", &opts["text"], "theme-dark", "alternative dark theme", &opts["theme-dark"], "theme-light", "default light theme", &opts["theme-light"], - "txt", "text output", &opts["text"], - "verbose|v", "output to terminal", &opts["vox_gt1"], - "very-verbose", "output to terminal", &opts["vox_gt2"], + "verbose|v", "output to terminal", &opts["vox_is3"], + "very-verbose", "output to terminal", &opts["vox_is4"], "workon", "(reserved for some matters under development & testing)", &opts["workon"], "xhtml", "xhtml output", &opts["xhtml"], "config", "=/path/to/config/file/including/filename", &settings["config"], @@ -486,10 +489,10 @@ string program_name = "spine"; return opts["show-curate"]; } @trusted bool show_curate_authors() { - return (opts["show-curate"] || opts["show-curate-authors"] || opts["vox_gt1"] || opts["vox_gt2"]) ? true : false; + return (opts["show-curate"] || opts["show-curate-authors"] || vox_gt_2) ? true : false; } @trusted bool show_curate_topics() { - return (opts["show-curate"] || opts["show-curate-topics"] || opts["vox_gt2"]) ? true : false; + return (opts["show-curate"] || opts["show-curate-topics"] || vox_gt_3) ? true : false; } @trusted bool show_epub() { return opts["show-epub"]; @@ -513,10 +516,10 @@ string program_name = "spine"; return opts["show-pod"]; } @trusted bool show_sqlite() { - return (opts["show-sqlite"] || opts["vox_gt2"]) ? true : false; + return (opts["show-sqlite"] || vox_gt_3) ? true : false; } @trusted bool show_summary() { - return (opts["show-summary"] || opts["vox_gt1"] || opts["vox_gt2"]) ? true : false; + return (opts["show-summary"] || vox_gt_2) ? true : false; } @trusted bool source() { return opts["source"]; @@ -548,18 +551,42 @@ string program_name = "spine"; || opts["sqlite-update"] ) ? true : false; } - @trusted bool vox_is0() { // --quiet -q + @trusted bool vox_0() { // --silent return opts["vox_is0"]; } - @trusted bool vox_gt0() { // normal, minimal, without flag - return (!(opts["vox_is0"]) || opts["vox_gt1"] || opts["vox_gt2"]) ? true : false; + @trusted bool vox_1() { // --quiet -q + return opts["vox_is1"]; + } + @trusted bool vox_2() { // normal, minimal, without flag + bool _vox_default = true; + if (opts["vox_is0"] || opts["vox_is1"] || opts["vox_is3"] || opts["vox_is4"]) { _vox_default = false; + } else { _vox_default = true; + } + return _vox_default; + } + @trusted bool vox_3() { // --verbose -v + return opts["vox_is3"]; + } + @trusted bool vox_4() { // --very-verbose + return opts["vox_is4"]; + } + @trusted bool vox_gt_0() { // --quiet -q and above + return ( vox_1 || vox_2 || vox_3 || vox_4) ? true : false; + } + @trusted bool vox_gt_1() { // normal, and above + return (vox_2 || vox_3 || vox_4) ? true : false; } - @trusted bool vox_gt1() { // -- verbose -v - return (opts["vox_gt1"] || opts["vox_gt2"]) ? true : false; + @trusted bool vox_gt_2() { // --verbose -v and above + return ( vox_3 || vox_4) ? true : false; } - @trusted bool vox_gt2() { // --very-verbose - return opts["vox_gt2"]; + @trusted bool vox_gt_3() { // --very-verbose + return (vox_4) ? true : false; } + @trusted bool vox_silent() { return vox_0; } // --silent + @trusted bool vox_quiet() { return vox_gt_0; } // --quiet -q & above + @trusted bool vox_default() { return vox_gt_1; } // defalt, & above + @trusted bool vox_verbose() { return vox_gt_2; } // --verbose -v & above + @trusted bool vox_very_verbose() { return vox_gt_3; } // --very-verbose @trusted bool text() { return opts["text"]; } @@ -1013,7 +1040,7 @@ string program_name = "spine"; foreach(manifest; parallel(_manifests[1..$])) { if (!empty(manifest.src.filename)) { scope(success) { - if (_opt_action.vox_gt0) { writeln("-- ~ document complete, ok ~ ------------------------------------"); } + if (_opt_action.vox_gt_1) { writeln("-- ~ document complete, ok ~ ------------------------------------"); } } scope(failure) { debug(checkdoc) { @@ -1071,7 +1098,7 @@ string program_name = "spine"; } else { if ((doc.matters.opt.action.debug_do) || (_opt_action.debug_do_curate) - || (doc.matters.opt.action.vox_gt2) + || (doc.matters.opt.action.vox_gt_3) ) { writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); } @@ -1092,7 +1119,7 @@ string program_name = "spine"; } } scope(exit) { - if (_opt_action.vox_gt0) { + if (_opt_action.vox_gt_1) { writefln( "processed file: %s [%s]", manifest.src.filename, @@ -1109,10 +1136,10 @@ string program_name = "spine"; } } else { // note cannot parallelise sqlite shared db foreach(manifest; _manifests[1..$]) { - if (_opt_action.vox_gt2) { writeln("parallelisation off: actions include sqlite shared db"); } + if (_opt_action.vox_gt_3) { writeln("parallelisation off: actions include sqlite shared db"); } if (!empty(manifest.src.filename)) { scope(success) { - if (_opt_action.vox_gt0) { writeln("-- ~ document complete, ok ~ ------------------------------------"); } + if (_opt_action.vox_gt_1) { writeln("-- ~ document complete, ok ~ ------------------------------------"); } } scope(failure) { debug(checkdoc) { @@ -1170,7 +1197,7 @@ string program_name = "spine"; } else { if ((doc.matters.opt.action.debug_do) || (_opt_action.debug_do_curate) - || (doc.matters.opt.action.vox_gt2) + || (doc.matters.opt.action.vox_gt_3) ) { writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc); } @@ -1191,7 +1218,7 @@ string program_name = "spine"; } } scope(exit) { - if (_opt_action.vox_gt0) { + if (_opt_action.vox_gt_1) { writefln( "processed file: %s [%s]", manifest.src.filename, @@ -1215,7 +1242,7 @@ string program_name = "spine"; if (_opt_action.curate_authors) { spineMetaDocCuratesAuthors!()(hvst.curates, _make_and_meta_struct, _opt_action); } - if (_opt_action.vox_gt0) { + if (_opt_action.vox_gt_1) { import sisudoc.io_out.paths_output; auto out_pth = spinePathsHTML!()(_make_and_meta_struct.conf.output_path, ""); if (_opt_action.curate_authors) { |