aboutsummaryrefslogtreecommitdiffhomepage
path: root/org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-02-21 12:48:35 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2022-02-21 14:05:24 -0500
commit8757dfd0fd175698b2bdf61ae49875080b8e1612 (patch)
treef3afdbc0bfb2902b4ba826e90e67c7cac1641307 /org
parentcgi search housekeeping, sync & remove redundancy (diff)
debug flags, narrow purpose
Diffstat (limited to 'org')
-rw-r--r--org/out_latex.org10
-rw-r--r--org/out_sqlite.org38
-rw-r--r--org/out_src_pod.org12
-rw-r--r--org/out_xmls.org76
-rw-r--r--org/spine.org51
5 files changed, 118 insertions, 69 deletions
diff --git a/org/out_latex.org b/org/out_latex.org
index ab4ccd2..fcd5061 100644
--- a/org/out_latex.org
+++ b/org/out_latex.org
@@ -132,7 +132,7 @@ void writeOutputLaTeX(T,M)(
auto pth_latex = spinePathsLaTeX(doc_matters);
try {
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_latex
&& doc_matters.opt.action.verbose) {
writeln(latex_content.head);
writeln(latex_content.content);
@@ -1695,9 +1695,9 @@ string _latex_head = format(q"┃%%%% spine LaTeX output
#+NAME: output_latex_head_a_format_string_variables
#+BEGIN_SRC d
┃",
- doc_matters.opt.action.debug_do ? "" : doc_matters.generator_program.name_and_version.strip,
- doc_matters.opt.action.debug_do ? "" : doc_matters.generator_program.compiler.strip,
- doc_matters.opt.action.debug_do ? "" : doc_matters.generator_program.stime.strip,
+ doc_matters.opt.action.debug_do_latex ? "" : doc_matters.generator_program.name_and_version.strip,
+ doc_matters.opt.action.debug_do_latex ? "" : doc_matters.generator_program.compiler.strip,
+ doc_matters.opt.action.debug_do_latex ? "" : doc_matters.generator_program.stime.strip,
doc_matters.generator_program.project_name.strip,
doc_matters.generator_program.url_home.strip,
paper_size_orientation_latex.strip,
@@ -1904,7 +1904,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_latex
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
diff --git a/org/out_sqlite.org b/org/out_sqlite.org
index 36c0efd..d5fbe7b 100644
--- a/org/out_sqlite.org
+++ b/org/out_sqlite.org
@@ -158,7 +158,7 @@ template SQLiteDbRun() {
writeln("ERROR SQLite : ", ex);
}
{ /+ debug +/
- if (opt_action.debug_do
+ if (opt_action.debug_do_sqlite
&& opt_action.verbose) {
writeln(note);
if (opt_action.very_verbose) {
@@ -519,7 +519,7 @@ string generic_munge_sanitize_text_for_search(
_txt ~= _urls;
}
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(_txt, "\n");
}
@@ -576,7 +576,7 @@ string munge_html(M,O)(
string _urls;
string _txt = _html_font_face(_html_special_characters(obj.text));
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(_txt, "\n");
}
@@ -1205,7 +1205,7 @@ string[string] heading(M,O)(
"html": html_heading(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1234,7 +1234,7 @@ string[string] para(M,O)(
"html": html_para(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1263,7 +1263,7 @@ string[string] quote(M,O)(
"html": html_quote(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1291,7 +1291,7 @@ string[string] group(M,O)(
"html": html_group(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1320,7 +1320,7 @@ string[string] block(M,O)(
"html": html_block(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1349,7 +1349,7 @@ string[string] verse(M,O)(
"html": html_verse(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1378,7 +1378,7 @@ string[string] code(M,O)(
"html": html_code(obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1407,7 +1407,7 @@ string[string] table(M,O)(
"html": html_table(doc_matters, obj)
];
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
debug(sql_txt) {
writeln(obj_txt["text"]);
@@ -1443,7 +1443,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1453,7 +1453,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -1478,7 +1478,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1510,7 +1510,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1520,7 +1520,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -1550,7 +1550,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1560,7 +1560,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -1572,7 +1572,7 @@ foreach (part; doc_matters.has.keys_seq.sql) {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_sqlite
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part); // check where empty value could come from
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
diff --git a/org/out_src_pod.org b/org/out_src_pod.org
index 7e45825..d08cbcc 100644
--- a/org/out_src_pod.org
+++ b/org/out_src_pod.org
@@ -181,7 +181,7 @@ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
zip = pod_archive("file_path_bin", fn_src_in, fn_src_out_pod_zip_base, zip);
}
} else {
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_pod
&& doc_matters.opt.action.verbose) {
writeln("WARNING (io) src out NOT found (image): ", fn_src_in);
}
@@ -208,7 +208,7 @@ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
zip = pod_archive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip);
}
} else {
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_pod
&& doc_matters.opt.action.verbose) {
writeln("WARNING (io) src out NOT found (document make): ", fn_src_in);
}
@@ -235,7 +235,7 @@ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
= 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
+ if (doc_matters.opt.action.debug_do_pod
&& doc_matters.opt.action.verbose) {
try {
_pmy = Loader.fromString(_pm).load();
@@ -298,7 +298,7 @@ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
}
}
} else {
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_pod
&& doc_matters.opt.action.verbose) {
writeln("WARNING (io) src in NOT found (markup source): ", fn_src_in);
}
@@ -341,7 +341,7 @@ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
zip = pod_archive("file_path_text", _pth_mkup_src_in, _pth_mkup_src_out, zip);
}
} else {
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_pod
&& doc_matters.opt.action.verbose) {
writeln("WARNING (io) src out NOT found (insert file): ", _pth_mkup_src_in);
}
@@ -373,7 +373,7 @@ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
zip = pod_archive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip);
}
} else {
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_pod
&& doc_matters.opt.action.verbose) {
writeln("WARNING (io) src out NOT found (insert file): ", fn_src_in);
}
diff --git a/org/out_xmls.org b/org/out_xmls.org
index 613925e..fdb64d9 100644
--- a/org/out_xmls.org
+++ b/org/out_xmls.org
@@ -315,7 +315,7 @@ import
special_characters_text(doc_matters.conf_make_meta.meta.date_modified),
doc_matters.src.language,
special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright),
- doc_matters.opt.action.debug_do ? "" : special_characters_text(doc_matters.generator_program.name_and_version),
+ doc_matters.opt.action.debug_do_xmls ? "" : special_characters_text(doc_matters.generator_program.name_and_version),
special_characters_text(doc_matters.generator_program.url_home),
);
return o;
@@ -1769,7 +1769,7 @@ case "frontmatter": assert(part == "head" || "toc");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1779,7 +1779,7 @@ case "frontmatter": assert(part == "head" || "toc");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -1805,7 +1805,7 @@ case "body": assert(part == "body" || "head");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1837,7 +1837,7 @@ case "body": assert(part == "body" || "head");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1847,7 +1847,7 @@ case "body": assert(part == "body" || "head");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -1889,7 +1889,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -1899,7 +1899,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -1911,7 +1911,7 @@ case "comment":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
@@ -2053,7 +2053,7 @@ if (obj.metainfo.is_a == "heading") {
break;
case 8: .. case 9:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
@@ -2062,7 +2062,7 @@ if (obj.metainfo.is_a == "heading") {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
}
@@ -2095,7 +2095,7 @@ case "frontmatter": assert(part == "head" || "toc");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2105,7 +2105,7 @@ case "frontmatter": assert(part == "head" || "toc");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2130,7 +2130,7 @@ case "body": assert(part == "body");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2170,7 +2170,7 @@ case "body": assert(part == "body");
doc_html[segment_filename] ~= t[0].to!string;
doc_html_endnotes[segment_filename] ~= t[1];
} else { /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2180,7 +2180,7 @@ case "body": assert(part == "body");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -2230,7 +2230,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2240,7 +2240,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -2252,7 +2252,7 @@ case "comment":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_html
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
}
@@ -2765,7 +2765,7 @@ if (obj.metainfo.is_a == "heading") {
break;
case 8: .. case 9:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
@@ -2774,7 +2774,7 @@ if (obj.metainfo.is_a == "heading") {
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
}
@@ -2808,7 +2808,7 @@ case "frontmatter": assert(part == "head" || "toc");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2818,7 +2818,7 @@ case "frontmatter": assert(part == "head" || "toc");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -2843,7 +2843,7 @@ case "body": assert(part == "body");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2884,7 +2884,7 @@ case "body": assert(part == "body");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2894,7 +2894,7 @@ case "body": assert(part == "body");
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -2944,7 +2944,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
}
@@ -2954,7 +2954,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
}
@@ -2972,7 +2972,7 @@ case "backmatter":
break;
default:
{ /+ debug +/
- if (doc_matters.opt.action.debug_do
+ if (doc_matters.opt.action.debug_do_epub
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
}
@@ -3077,7 +3077,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
- (doc_matters.opt.action.debug_do)
+ (doc_matters.opt.action.debug_do_epub)
? zip_data.write(contents.dup)
: zip_data.write(contents.dup
.replaceAll(rgx.spaces_line_start, "")
@@ -3093,7 +3093,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
pth_epub3.base.mkdirRecurse;
}
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename))) {
pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename).mkdirRecurse;
}
@@ -3112,7 +3112,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
string fn_dbg = pth_epub3.dbg_fn_oebps_content_xhtml(doc_matters.src.filename, seg_filename);
auto f = File(fn_dbg, "w");
foreach (docseg; epub_write.doc_epub3[seg_filename]) {
@@ -3142,7 +3142,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
File f;
{ /+ mimetypes (identify zip file type) +/
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
fn_dbg = pth_epub3.dbg_fn_mimetypes(doc_matters.src.filename);
File(fn_dbg, "w").writeln(epub_write.mimetypes);
}
@@ -3152,7 +3152,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
}
{ /+ META-INF/container.xml (identify doc root) +/
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
fn_dbg = pth_epub3.dbg_fn_dmi_container_xml(doc_matters.src.filename);
File(fn_dbg, "w").writeln(epub_write.meta_inf_container_xml);
}
@@ -3162,7 +3162,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
}
{ /+ OEBPS/toc_nav.xhtml (navigation toc epub3) +/
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
fn_dbg = pth_epub3.dbg_fn_oebps_toc_nav_xhtml(doc_matters.src.filename);
File(fn_dbg, "w").writeln(epub_write.oebps_toc_nav_xhtml);
}
@@ -3172,7 +3172,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
}
{ /+ OEBPS/content.opf (doc manifest) +/
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
fn_dbg = pth_epub3.dbg_fn_oebps_content_opf(doc_matters.src.filename);
File(fn_dbg, "w").writeln(epub_write.oebps_content_opf);
}
@@ -3183,7 +3183,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
{ /+ OEBPS/_dr/image (images) +/
foreach (image; doc_matters.srcs.image_list) {
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
if (doc_matters.opt.action.very_verbose) {
writeln(
doc_matters.src.image_dir_path, "/", image, " -> ",
@@ -3214,7 +3214,7 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
{ /+ OEBPS/epub.css +/
auto css = spineCss(doc_matters);
{ /+ debug +/
- if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.debug_do_epub) {
fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.src.filename);
File(fn_dbg, "w").writeln(css.epub);
}
diff --git a/org/spine.org b/org/spine.org
index da5418d..ae78e86 100644
--- a/org/spine.org
+++ b/org/spine.org
@@ -334,6 +334,13 @@ bool[string] opts = [
"concordance" : false,
"dark" : false,
"debug" : false,
+ "debug-pod" : false,
+ "debug-epub" : false,
+ "debug-harvest" : false,
+ "debug-html" : false,
+ "debug-latex" : false,
+ "debug-manifest" : false,
+ "debug-sqlite" : false,
"digest" : false,
"epub" : false,
"curate" : false,
@@ -439,6 +446,13 @@ auto helpInfo = getopt(args,
"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"],
@@ -540,7 +554,42 @@ struct OptActions {
return _is_light;
}
@trusted bool debug_do() {
- return opts["debug"];
+ bool _dbg;
+ if (opts["debug"]
+ ||opts["debug-epub"]
+ ||opts["debug-harvest"]
+ ||opts["debug-html"]
+ ||opts["debug-latex"]
+ ||opts["debug-manifest"]
+ ||opts["debug-sqlite"]
+ ) {
+ _dbg = true;
+ } else { _dbg = false; }
+ return _dbg;
+ }
+ @trusted bool debug_do_pod() {
+ return (opts["debug"] || opts["debug-pod"]) ? true : false;
+ }
+ @trusted bool debug_do_epub() {
+ return (opts["debug"] || opts["debug-epub"]) ? true : false;
+ }
+ @trusted bool debug_do_harvest() {
+ return (opts["debug"] || opts["debug-harvest"]) ? true : false;
+ }
+ @trusted bool debug_do_html() {
+ return (opts["debug"] || opts["debug-html"]) ? true : false;
+ }
+ @trusted bool debug_do_latex() {
+ return (opts["debug"] || opts["debug-latex"]) ? true : false;
+ }
+ @trusted bool debug_do_manifest() {
+ return (opts["debug"] || opts["debug-manifest"]) ? true : false;
+ }
+ @trusted bool debug_do_sqlite() {
+ return (opts["debug"] || opts["debug-sqlite"]) ? true : false;
+ }
+ @trusted bool debug_do_xmls() {
+ return (opts["debug"] || opts["debug-html"] || opts["debug-epub"]) ? true : false;
}
@trusted bool digest() {
return opts["digest"];