aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/spine.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/spine.d')
-rwxr-xr-xsrc/sisudoc/spine.d81
1 files changed, 54 insertions, 27 deletions
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) {