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/sisudoc/io_out | |
parent | spine.d tidy (diff) |
terminal output verbosity levels, minor rework
Diffstat (limited to 'src/sisudoc/io_out')
-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 |
9 files changed, 67 insertions, 73 deletions
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"] |