aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_out/html.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2021-08-29 19:06:01 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2021-09-09 22:03:12 -0400
commit2cdc5d2a7c62e54009e915d6f6a9da87905e2699 (patch)
treeacb5e8af2cccc20546effef9722fe5526064f947 /src/doc_reform/io_out/html.d
parentconfig nix (diff)
xmls, epub3 toc_nav.xhtml toc.ncx
Diffstat (limited to 'src/doc_reform/io_out/html.d')
-rw-r--r--src/doc_reform/io_out/html.d56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d
index ceaf9f9..5c55bd7 100644
--- a/src/doc_reform/io_out/html.d
+++ b/src/doc_reform/io_out/html.d
@@ -299,7 +299,7 @@ template outputHTML() {
top_level_headings[3] = "";
goto default;
default:
- auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg");
+ Tuple!(string, string[]) t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg");
top_level_headings[obj.metainfo.heading_lev_markup] = t[0];
break;
}
@@ -313,13 +313,13 @@ template outputHTML() {
foreach (top_level_heading; top_level_headings) {
doc_html[segment_filename] ~= top_level_heading;
}
- auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg");
+ Tuple!(string, string[]) t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
doc_html[segment_filename] ~= xhtml_format.lev4_heading_subtoc(obj, doc_matters);
doc_html_endnotes[segment_filename] ~= t[1];
break;
case 5: .. case 7:
- auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg");
+ Tuple!(string, string[]) t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
doc_html_endnotes[segment_filename] ~= t[1];
break;
@@ -343,13 +343,14 @@ template outputHTML() {
}
} else {
assert(part == "head" || "toc" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb" || "tail");
+ Tuple!(string, string[]) t;
switch (obj.metainfo.is_of_part) {
case "frontmatter": assert(part == "head" || "toc");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
case "toc":
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
break;
default:
@@ -377,7 +378,7 @@ template outputHTML() {
case "para":
switch (obj.metainfo.is_a) {
case "para":
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
doc_html_endnotes[segment_filename] ~= t[1];
break;
@@ -394,27 +395,19 @@ template outputHTML() {
case "block":
switch (obj.metainfo.is_a) {
case "quote":
- auto t = xhtml_format.quote_seg(_txt, obj, doc_matters, suffix, "seg");
- doc_html[segment_filename] ~= t[0].to!string;
- doc_html_endnotes[segment_filename] ~= t[1];
- break;
+ t = xhtml_format.quote_seg(_txt, obj, doc_matters, suffix, "seg");
+ goto default;
case "group":
- auto t = xhtml_format.group_seg(_txt, obj, doc_matters, suffix, "seg");
- doc_html[segment_filename] ~= t[0].to!string;
- doc_html_endnotes[segment_filename] ~= t[1];
- break;
+ t = xhtml_format.group_seg(_txt, obj, doc_matters, suffix, "seg");
+ goto default;
case "block":
- auto t = xhtml_format.block_seg(_txt, obj, doc_matters, suffix, "seg");
- doc_html[segment_filename] ~= t[0].to!string;
- doc_html_endnotes[segment_filename] ~= t[1];
- break;
+ t = xhtml_format.block_seg(_txt, obj, doc_matters, suffix, "seg");
+ goto default;
case "poem":
break;
case "verse":
- auto t = xhtml_format.verse_seg(_txt, obj, doc_matters, suffix, "seg");
- doc_html[segment_filename] ~= t[0].to!string;
- doc_html_endnotes[segment_filename] ~= t[1];
- break;
+ t = xhtml_format.verse_seg(_txt, obj, doc_matters, suffix, "seg");
+ goto default;
case "code":
doc_html[segment_filename] ~= xhtml_format.code(_txt, obj, doc_matters);
break;
@@ -423,7 +416,14 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= "";
break;
default:
- { /+ debug +/
+ if ((obj.metainfo.is_a == "quote"
+ || obj.metainfo.is_a == "group"
+ || obj.metainfo.is_a == "block"
+ || obj.metainfo.is_a == "verse"
+ )) {
+ doc_html[segment_filename] ~= t[0].to!string;
+ doc_html_endnotes[segment_filename] ~= t[1];
+ } else { /+ debug +/
if (doc_matters.opt.action.debug_do
&& doc_matters.opt.action.verbose) {
writeln(__FILE__, ":", __LINE__, ": ", obj.metainfo.is_a);
@@ -448,26 +448,26 @@ template outputHTML() {
case "para":
switch (obj.metainfo.is_a) {
case "endnote": assert(part == "endnotes");
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0];
break;
case "glossary": assert(part == "glossary");
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "bibliography": assert(part == "bibliography");
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "bookindex": assert(part == "bookindex");
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "blurb": assert(part == "blurb");
- auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
+ t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg");
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
@@ -560,7 +560,7 @@ template outputHTML() {
M doc_matters,
) {
{ /+ (copy html images) +/
-
+
auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language);
if (!exists(pth_html.image)) {
pth_html.image.mkdirRecurse;