aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2018-10-30 11:46:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-04-10 15:14:15 -0400
commitc37eb0768635a42686ea986343ff95ae03f08c1d (patch)
treeb05d4c4030758aa245f9bb483c7aaa36f5759ada /src/doc_reform/output
parent0.2.1 segnames, anchor tags (diff)
0.3.0 internal links, anchor tags & segment associationsdoc-reform_v0.3.0
Diffstat (limited to 'src/doc_reform/output')
-rw-r--r--src/doc_reform/output/defaults.d28
-rw-r--r--src/doc_reform/output/epub3.d204
-rw-r--r--src/doc_reform/output/html.d148
-rw-r--r--src/doc_reform/output/paths_output.d79
-rw-r--r--src/doc_reform/output/sqlite.d245
-rw-r--r--src/doc_reform/output/xmls.d23
6 files changed, 443 insertions, 284 deletions
diff --git a/src/doc_reform/output/defaults.d b/src/doc_reform/output/defaults.d
index f0173cc..36f5c8e 100644
--- a/src/doc_reform/output/defaults.d
+++ b/src/doc_reform/output/defaults.d
@@ -11,20 +11,20 @@ template InternalMarkup() {
auto lnk_o = "┥"; auto lnk_c = "┝";
auto url_o = "┤"; auto url_c = "├";
auto mark_internal_site_lnk = "¤";
- auto nbsp = "░";
- auto br_line = "┘";
- auto br_nl = "┙";
- auto br_paragraph = "┚";
- auto br_obj = "break_obj";
- auto br_page_line = "┼";
- auto br_page = "┿";
- auto br_page_new = "╂";
- auto tc_s = "┊";
- auto tc_o = "┏";
- auto tc_c = "┚";
- auto tc_p = "┆";
- auto mono = "■";
- auto img = "☼";
+ auto nbsp = "░";
+ auto br_line = "┘";
+ auto br_nl = "┙";
+ auto br_paragraph = "┚";
+ auto br_obj = "break_obj";
+ auto br_page_line = "┼";
+ auto br_page = "┿";
+ auto br_page_new = "╂";
+ auto tc_s = "┊";
+ auto tc_o = "┏";
+ auto tc_c = "┚";
+ auto tc_p = "┆";
+ auto mono = "■";
+ auto img = "☼";
static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") {
_indent_spaces = replicate(_indent_spaces, indent);
return _indent_spaces;
diff --git a/src/doc_reform/output/epub3.d b/src/doc_reform/output/epub3.d
index 1bcf13d..e862a3f 100644
--- a/src/doc_reform/output/epub3.d
+++ b/src/doc_reform/output/epub3.d
@@ -102,8 +102,8 @@ template outputEPub3() {
content ~= " " ~ "</guide>" ~ "\n ";
content ~= "" ~ "</package>";
debug(epubmanifest) {
- foreach (s; doc_matters.xml.keys_seq.seg) {
- foreach (obj; doc_abstraction[s]) {
+ foreach (part; doc_matters.xml.keys_seq.seg) { // TODO
+ foreach (obj; doc_abstraction[part]) {
if (obj.metainfo.is_a == "heading") {
if (obj.metainfo.heading_lev_markup == 4) {
writefln(
@@ -235,8 +235,8 @@ template outputEPub3() {
doc_matters.conf_make_meta.meta.title_full, // title
(doc_matters.conf_make_meta.meta.creator_author.empty) ? ""
: " by " ~ doc_matters.conf_make_meta.meta.creator_author, // author
- uuid, // uuid
- "3", // content depth
+ uuid, // uuid
+ "3", // content depth
doc_matters.conf_make_meta.meta.title_full, // title
(doc_matters.conf_make_meta.meta.creator_author.empty) ? ""
: doc_matters.conf_make_meta.meta.creator_author, // author
@@ -311,7 +311,7 @@ template outputEPub3() {
foreach (obj; doc_abstraction[part]) {
string _txt = xhtml_format.special_characters(obj, obj.text);
if (obj.metainfo.is_a == "heading") {
- assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
+ assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.heading_lev_markup) {
case 0: .. case 3:
/+ fill buffer, and replace with new levels from 1 to 3 +/
@@ -356,21 +356,27 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
- writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ }
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
+ }
}
break;
}
} else {
- assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
+ assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.is_of_part) {
- case "frontmatter": assert(part == "head" || "toc_seg");
+ case "frontmatter": assert(part == "head" || "toc");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -380,15 +386,21 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -403,8 +415,11 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
@@ -441,21 +456,27 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= "";
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
break;
case "backmatter":
- assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
+ assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -473,7 +494,7 @@ template outputEPub3() {
doc_epub3[segment_filename] ~= t[0];
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
- case "bookindex": assert(part == "bookindex_seg");
+ case "bookindex": assert(part == "bookindex");
auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub");
doc_epub3[segment_filename] ~= t[0];
doc_epub3_endnotes[segment_filename] ~= t[1];
@@ -484,15 +505,21 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -500,8 +527,11 @@ template outputEPub3() {
case "comment":
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
+ }
}
break;
}
@@ -600,15 +630,17 @@ template outputEPub3() {
if (!exists(pth_epub3.base)) {
pth_epub3.base.mkdirRecurse;
}
- debug(epub_output) {
- if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename))) {
- pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename).mkdirRecurse;
- }
- if (!exists(pth_epub3.dbg_doc_oebps_css(doc_matters.src.filename))) {
- pth_epub3.dbg_doc_oebps_css(doc_matters.src.filename).mkdirRecurse;
- }
- if (!exists(pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename))) {
- pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename).mkdirRecurse;
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename))) {
+ pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename).mkdirRecurse;
+ }
+ if (!exists(pth_epub3.dbg_doc_oebps_css(doc_matters.src.filename))) {
+ pth_epub3.dbg_doc_oebps_css(doc_matters.src.filename).mkdirRecurse;
+ }
+ if (!exists(pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename))) {
+ pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename).mkdirRecurse;
+ }
}
}
{ /+ OEBPS/[segments].xhtml (the document contents) +/
@@ -617,19 +649,25 @@ template outputEPub3() {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
- debug(epub_output) {
- string fn_dbg = pth_epub3.dbg_fn_oebps_content_xhtml(doc_matters.src.filename, seg_filename);
- auto f = File(fn_dbg, "w");
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ string fn_dbg = pth_epub3.dbg_fn_oebps_content_xhtml(doc_matters.src.filename, seg_filename);
+ auto f = File(fn_dbg, "w");
+ foreach (docseg; doc_epub3[seg_filename]) {
+ f.writeln(docseg);
+ }
+ foreach (docseg; doc_epub3_endnotes[seg_filename]) {
+ f.writeln(docseg);
+ }
+ f.writeln(xhtml_format.tail);
+ }
}
foreach (docseg; doc_epub3[seg_filename]) {
- debug(epub_output) { f.writeln(docseg); }
zip_data.write(docseg.dup);
}
foreach (docseg; doc_epub3_endnotes[seg_filename]) {
- debug(epub_output) { f.writeln(docseg); }
zip_data.write(docseg.dup);
}
- debug(epub_output) { f.writeln(xhtml_format.tail); }
zip_data.write(xhtml_format.tail.dup);
zip_arc_member_file.expandedData = zip_data.toBytes();
zip.addMember(zip_arc_member_file);
@@ -638,12 +676,14 @@ template outputEPub3() {
}
}
string fn;
- debug(epub_output) { string fn_dbg; }
+ string fn_dbg;
File f;
{ /+ mimetypes (identify zip file type) +/
- debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_mimetypes(doc_matters.src.filename);
- File(fn_dbg, "w").writeln(mimetypes);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ fn_dbg = pth_epub3.dbg_fn_mimetypes(doc_matters.src.filename);
+ File(fn_dbg, "w").writeln(mimetypes);
+ }
}
fn = pth_epub3.fn_mimetypes(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
@@ -655,9 +695,11 @@ template outputEPub3() {
createZipFile!()(fn_epub, zip.build());
}
{ /+ META-INF/container.xml (identify doc root) +/
- debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_dmi_container_xml(doc_matters.src.filename);
- File(fn_dbg, "w").writeln(meta_inf_container_xml);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ fn_dbg = pth_epub3.dbg_fn_dmi_container_xml(doc_matters.src.filename);
+ File(fn_dbg, "w").writeln(meta_inf_container_xml);
+ }
}
fn = pth_epub3.fn_dmi_container_xml(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
@@ -669,9 +711,11 @@ template outputEPub3() {
createZipFile!()(fn_epub, zip.build());
}
{ /+ OEBPS/toc_nav.xhtml (navigation toc epub3) +/
- debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_toc_nav_xhtml(doc_matters.src.filename);
- File(fn_dbg, "w").writeln(oebps_toc_nav_xhtml);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ fn_dbg = pth_epub3.dbg_fn_oebps_toc_nav_xhtml(doc_matters.src.filename);
+ File(fn_dbg, "w").writeln(oebps_toc_nav_xhtml);
+ }
}
fn = pth_epub3.fn_oebps_toc_nav_xhtml(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
@@ -683,9 +727,11 @@ template outputEPub3() {
createZipFile!()(fn_epub, zip.build());
}
{ /+ OEBPS/toc.ncx (navigation toc epub2) +/
- debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_toc_ncx(doc_matters.src.filename);
- File(fn_dbg, "w").writeln(oebps_toc_ncx);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ fn_dbg = pth_epub3.dbg_fn_oebps_toc_ncx(doc_matters.src.filename);
+ File(fn_dbg, "w").writeln(oebps_toc_ncx);
+ }
}
fn = pth_epub3.fn_oebps_toc_ncx(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
@@ -697,9 +743,11 @@ template outputEPub3() {
createZipFile!()(fn_epub, zip.build());
}
{ /+ OEBPS/content.opf (doc manifest) +/
- debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_content_opf(doc_matters.src.filename);
- File(fn_dbg, "w").writeln(oebps_content_opf);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ fn_dbg = pth_epub3.dbg_fn_oebps_content_opf(doc_matters.src.filename);
+ File(fn_dbg, "w").writeln(oebps_content_opf);
+ }
}
fn = pth_epub3.fn_oebps_content_opf(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
@@ -712,20 +760,18 @@ template outputEPub3() {
}
{ /+ OEBPS/_sisu/image (images) +/
foreach (image; doc_matters.srcs.image_list) {
- debug(epub_output) {
- if (exists(doc_matters.src_path_info.image_root ~ "/" ~ image)) {
- (doc_matters.src_path_info.image_root ~ "/" ~ image)
- .copy((pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename)) ~ "/" ~ image);
- }
- }
- }
- foreach (image; doc_matters.srcs.image_list) {
- debug(epub_output) {
- debug(epub_images) {
- writeln(
- doc_matters.src.image_dir_path, "/", image, " -> ",
- pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename), "/", image
- );
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ if (doc_matters.opt.action.very_verbose) {
+ writeln(
+ doc_matters.src.image_dir_path, "/", image, " -> ",
+ pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename), "/", image
+ );
+ }
+ if (exists(doc_matters.src.image_dir_path ~ "/" ~ image)) {
+ (doc_matters.src.image_dir_path ~ "/" ~ image)
+ .copy((pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename)) ~ "/" ~ image);
+ }
}
}
auto fn_src = doc_matters.src.image_dir_path ~ "/" ~ image;
@@ -745,9 +791,11 @@ template outputEPub3() {
}
{ /+ OEBPS/epub.css +/
auto css = DocReformCss();
- debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.src.filename);
- File(fn_dbg, "w").writeln(css.epub_css);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do) {
+ fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.src.filename);
+ File(fn_dbg, "w").writeln(css.epub_css);
+ }
}
fn = pth_epub3.fn_oebps_css(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
diff --git a/src/doc_reform/output/html.d b/src/doc_reform/output/html.d
index 3424dc9..e247221 100644
--- a/src/doc_reform/output/html.d
+++ b/src/doc_reform/output/html.d
@@ -29,7 +29,7 @@ template outputHTML() {
delimit = xhtml_format.div_delimit(part, previous_part);
string _txt = xhtml_format.special_characters(obj, obj.text);
switch (obj.metainfo.is_of_part) {
- case "frontmatter": assert(part == "head" || "toc_scroll");
+ case "frontmatter": assert(part == "head" || "toc");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -40,15 +40,21 @@ template outputHTML() {
doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -64,8 +70,11 @@ template outputHTML() {
doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
@@ -93,21 +102,27 @@ template outputHTML() {
doc_html ~= xhtml_format.table(doc_matters, obj, _txt);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
break;
case "backmatter":
- assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_scroll" || "blurb" || "tail");
+ assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -123,22 +138,28 @@ template outputHTML() {
case "bibliography": assert(part == "bibliography");
doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix);
break;
- case "bookindex": assert(part == "bookindex_scroll");
+ case "bookindex": assert(part == "bookindex");
doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix);
break;
case "blurb": assert(part == "blurb");
doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -146,10 +167,13 @@ template outputHTML() {
case "comment":
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
- writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ }
}
break;
}
@@ -202,7 +226,7 @@ template outputHTML() {
delimit = xhtml_format.div_delimit(part, previous_part);
string _txt = xhtml_format.special_characters(obj, obj.text);
if (obj.metainfo.is_a == "heading") {
- assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
+ assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.heading_lev_markup) {
case 0: .. case 3:
/+ fill buffer, and replace with new levels from 1 to 3 +/
@@ -251,21 +275,27 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
- writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.text);
+ }
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a, ": ", obj.metainfo.heading_lev_markup);
+ }
}
break;
}
} else {
- assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
+ assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.is_of_part) {
- case "frontmatter": assert(part == "head" || "toc_seg");
+ case "frontmatter": assert(part == "head" || "toc");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -274,15 +304,21 @@ template outputHTML() {
doc_html[segment_filename] ~= t[0].to!string;
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
@@ -297,8 +333,11 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
@@ -335,21 +374,27 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= "";
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
break;
case "backmatter":
- assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
+ assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -367,7 +412,7 @@ template outputHTML() {
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
- case "bookindex": assert(part == "bookindex_seg");
+ case "bookindex": assert(part == "bookindex");
auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "seg");
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
@@ -378,15 +423,21 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -394,8 +445,11 @@ template outputHTML() {
case "comment":
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_part);
+ }
}
break;
}
diff --git a/src/doc_reform/output/paths_output.d b/src/doc_reform/output/paths_output.d
index 11232a9..f4dc083 100644
--- a/src/doc_reform/output/paths_output.d
+++ b/src/doc_reform/output/paths_output.d
@@ -185,46 +185,45 @@ template DocReformPathsEPUB() {
string fn_oebps_css(string fn_src) {
return asNormalizedPath(doc_oebps_css(fn_src).chainPath("epub.css")).array;
}
- debug(epub_output) {
- string dbg_docdir(string fn_src) {
- return base.chainPath(base_filename(fn_src)).array;
- }
- string dbg_docdir_oebps(string fn_src) {
- return dbg_docdir(fn_src).chainPath("OEBPS").array;
- }
- string dbg_doc_meta_inf(string fn_src) {
- return dbg_docdir(fn_src).chainPath("META-INF").array;
- }
- string dbg_doc_oebps(string fn_src) {
- return dbg_docdir(fn_src).chainPath("OEBPS").array;
- }
- string dbg_doc_oebps_css(string fn_src) {
- return dbg_doc_oebps(fn_src).chainPath("css").array;
- }
- string dbg_doc_oebps_image(string fn_src) {
- return dbg_doc_oebps(fn_src).chainPath("image").array;
- }
- string dbg_fn_mimetypes(string fn_src) {
- return dbg_docdir(fn_src).chainPath("mimetypes").array;
- }
- string dbg_fn_dmi_container_xml(string fn_src) {
- return dbg_doc_meta_inf(fn_src).chainPath("container.xml").array;
- }
- string dbg_fn_oebps_toc_nav_xhtml(string fn_src) {
- return dbg_docdir_oebps(fn_src).chainPath("toc_nav.xhtml").array;
- }
- string dbg_fn_oebps_toc_ncx(string fn_src) {
- return dbg_docdir_oebps(fn_src).chainPath("toc.ncx").array;
- }
- string dbg_fn_oebps_content_opf(string fn_src) {
- return dbg_docdir_oebps(fn_src).chainPath("content.opf").array;
- }
- string dbg_fn_oebps_content_xhtml(string fn_src, string seg_filename) {
- return dbg_docdir_oebps(fn_src).chainPath(seg_filename ~ ".xhtml").array;
- }
- string dbg_fn_oebps_css(string fn_src) {
- return dbg_doc_oebps_css(fn_src).chainPath("epub.css").array;
- }
+ /+ debug +/
+ string dbg_docdir(string fn_src) {
+ return base.chainPath(base_filename(fn_src)).array;
+ }
+ string dbg_docdir_oebps(string fn_src) {
+ return dbg_docdir(fn_src).chainPath("OEBPS").array;
+ }
+ string dbg_doc_meta_inf(string fn_src) {
+ return dbg_docdir(fn_src).chainPath("META-INF").array;
+ }
+ string dbg_doc_oebps(string fn_src) {
+ return dbg_docdir(fn_src).chainPath("OEBPS").array;
+ }
+ string dbg_doc_oebps_css(string fn_src) {
+ return dbg_doc_oebps(fn_src).chainPath("css").array;
+ }
+ string dbg_doc_oebps_image(string fn_src) {
+ return dbg_doc_oebps(fn_src).chainPath("image").array;
+ }
+ string dbg_fn_mimetypes(string fn_src) {
+ return dbg_docdir(fn_src).chainPath("mimetypes").array;
+ }
+ string dbg_fn_dmi_container_xml(string fn_src) {
+ return dbg_doc_meta_inf(fn_src).chainPath("container.xml").array;
+ }
+ string dbg_fn_oebps_toc_nav_xhtml(string fn_src) {
+ return dbg_docdir_oebps(fn_src).chainPath("toc_nav.xhtml").array;
+ }
+ string dbg_fn_oebps_toc_ncx(string fn_src) {
+ return dbg_docdir_oebps(fn_src).chainPath("toc.ncx").array;
+ }
+ string dbg_fn_oebps_content_opf(string fn_src) {
+ return dbg_docdir_oebps(fn_src).chainPath("content.opf").array;
+ }
+ string dbg_fn_oebps_content_xhtml(string fn_src, string seg_filename) {
+ return dbg_docdir_oebps(fn_src).chainPath(seg_filename ~ ".xhtml").array;
+ }
+ string dbg_fn_oebps_css(string fn_src) {
+ return dbg_doc_oebps_css(fn_src).chainPath("epub.css").array;
}
}
return _PathsStruct();
diff --git a/src/doc_reform/output/sqlite.d b/src/doc_reform/output/sqlite.d
index 0d31e2f..2456509 100644
--- a/src/doc_reform/output/sqlite.d
+++ b/src/doc_reform/output/sqlite.d
@@ -112,10 +112,13 @@ template SQLiteDbRun() {
} catch (Exception ex) {
writeln("ERROR SQLite : ", ex);
}
- if (opt_action.debug_do) {
- writeln(note);
- if (opt_action.verbose) {
- writeln(db_statement);
+ { /+ debug +/
+ if (opt_action.debug_do
+ && opt_action.verbose) {
+ writeln(note);
+ if (opt_action.very_verbose) {
+ writeln(db_statement);
+ }
}
}
}
@@ -158,8 +161,11 @@ template SQLiteFormatAndLoadObject() {
if (_urls.length > 0) {
_txt ~= _urls;
}
- if (doc_matters.opt.action.debug_do) {
- writeln(_txt, "\n");
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(_txt, "\n");
+ }
}
debug(sql_text_clean) {
writeln(_txt);
@@ -206,8 +212,11 @@ template SQLiteFormatAndLoadObject() {
if (_notes.length > 0) {
_txt ~= _notes;
}
- if (doc_matters.opt.action.debug_do) {
- writeln(_txt, "\n");
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(_txt, "\n");
+ }
}
return _txt;
}
@@ -285,7 +294,7 @@ template SQLiteFormatAndLoadObject() {
if (_xml_type == "seg") {
foreach (m; _txt.match(rgx.inline_link_hash)) {
if (m.captures[3] in doc_matters.xml.tag_associations) {
- if (m.captures[3] == doc_matters.xml.tag_associations[(m.captures[3])][0]) {
+ if (m.captures[3] == doc_matters.xml.tag_associations[(m.captures[3])]["seg_lv4"]) {
_txt = _txt.replaceFirst(
rgx.inline_link_hash,
"┥$1┝┤"
@@ -300,7 +309,7 @@ template SQLiteFormatAndLoadObject() {
"┥$1┝┤"
~ doc_matters.conf_make_meta.conf.webserv_url_doc_root
~ "/"
- ~ doc_matters.xml.tag_associations[(m.captures[3])][0]
+ ~ doc_matters.xml.tag_associations[(m.captures[3])]["seg_lv4"]
~ ".html"
~ "#" ~ "$3"
~ "├"
@@ -621,15 +630,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_heading(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -641,15 +653,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_para(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -661,15 +676,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_quote(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -681,15 +699,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_group(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -701,15 +722,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_block(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -721,15 +745,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_verse(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -741,15 +768,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_code(obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -761,15 +791,18 @@ template SQLiteFormatAndLoadObject() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_table(doc_matters, obj)
];
- if (doc_matters.opt.action.debug_do) {
- debug(sql_txt) {
- writeln(obj_txt["text"]);
- }
- debug(sql_html) {
- writeln(obj_txt["html"]);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ debug(sql_txt) {
+ writeln(obj_txt["text"]);
+ }
+ debug(sql_html) {
+ writeln(obj_txt["html"]);
+ }
+ } else {
+ // load sql
}
- } else {
- // load sql
}
return obj_txt;
}
@@ -1139,15 +1172,21 @@ template SQLiteInsertDocObjectsLoop() {
obj_txt = format_and_sqlite_load.heading(doc_matters, obj);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -1168,8 +1207,11 @@ template SQLiteInsertDocObjectsLoop() {
obj_txt = format_and_sqlite_load.para(doc_matters, obj);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
@@ -1197,21 +1239,27 @@ template SQLiteInsertDocObjectsLoop() {
obj_txt = format_and_sqlite_load.table(doc_matters, obj);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
break;
case "backmatter":
- assert(part == "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail", part);
+ assert(part == "glossary" || "bibliography" || "bookindex" || "blurb" || "tail", part);
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -1224,22 +1272,28 @@ template SQLiteInsertDocObjectsLoop() {
case "bibliography": assert(part == "bibliography", part);
obj_txt = format_and_sqlite_load.para(doc_matters, obj);
break;
- case "bookindex": assert(part == "bookindex_seg", part);
+ case "bookindex": assert(part == "bookindex", part);
obj_txt = format_and_sqlite_load.para(doc_matters, obj);
break;
case "blurb": assert(part == "blurb", part);
obj_txt = format_and_sqlite_load.para(doc_matters, obj);
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
+ }
}
break;
}
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && doc_matters.opt.action.verbose) {
+ writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_of_type);
+ }
}
break;
}
@@ -1247,10 +1301,13 @@ template SQLiteInsertDocObjectsLoop() {
case "comment":
break;
default:
- if ((doc_matters.opt.action.debug_do)) {
- 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
+ { /+ debug +/
+ if (doc_matters.opt.action.debug_do
+ && 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);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from
+ }
}
break;
}
diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d
index bc93271..6154010 100644
--- a/src/doc_reform/output/xmls.d
+++ b/src/doc_reform/output/xmls.d
@@ -25,16 +25,10 @@ template outputXHTMLs() {
case "head":
delimit_ ~= "\n<div class=\"doc_title\">\n" ;
break;
- case "toc_seg":
+ case "toc":
delimit_ ~= "\n<div class=\"doc_toc\">\n" ;
break;
- case "toc_scroll":
- delimit_ ~= "\n<div class=\"doc_toc\">\n" ;
- break;
- case "bookindex_seg":
- delimit_ ~= "\n<div class=\"doc_bookindex\">\n" ;
- break;
- case "bookindex_scroll":
+ case "bookindex":
delimit_ ~= "\n<div class=\"doc_bookindex\">\n" ;
break;
default:
@@ -343,6 +337,7 @@ template outputXHTMLs() {
string _suffix = ".html",
string _xml_type = "seg",
) {
+ string seg_lvs;
if (obj.has.inline_links) {
if ((_txt.match(rgx.mark_internal_site_lnk))
&& (_xml_type == "scroll")) { // conditions reversed to avoid: gdc compiled program run segfault
@@ -351,9 +346,13 @@ template outputXHTMLs() {
"$1");
}
if (_xml_type == "seg" || _xml_type == "epub") {
+ seg_lvs = (_xml_type == "epub") ? "seg_lv1_to_4" : "seg_lv4";
foreach (m; _txt.match(rgx.inline_link_hash)) {
if (m.captures[3] in doc_matters.xml.tag_associations) {
- if (m.captures[3] == doc_matters.xml.tag_associations[(m.captures[3])][0]) {
+ if (
+ m.captures[3]
+ == doc_matters.xml.tag_associations[(m.captures[3])][seg_lvs]
+ ) {
_txt = _txt.replaceFirst(
rgx.inline_link_hash,
"┥$1┝┤$3" ~ _suffix ~ "├"
@@ -362,7 +361,7 @@ template outputXHTMLs() {
_txt = _txt.replaceFirst(
rgx.inline_link_hash,
"┥$1┝┤"
- ~ doc_matters.xml.tag_associations[(m.captures[3])][0]
+ ~ doc_matters.xml.tag_associations[(m.captures[3])][seg_lvs]
~ _suffix
~ "#" ~ "$3"
~ "├"
@@ -370,7 +369,9 @@ template outputXHTMLs() {
}
} else {
writeln(
- "WARNING on internal document links, anchor to link not found in document, "
+ "WARNING on internal document links, anchor to link <<"
+ ~ m.captures[3]
+ ~ ">> not found in document, "
~ "anchor: " ~ m.captures[3]
~ " document: " ~ doc_matters.src.filename
);