aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output/epub3.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-06-06 17:50:43 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit042a9203d48d784115b34553c84a894eaa7c1254 (patch)
treefad89d1e4f1970d8bf4498e65607a04dd600c757 /src/sdp/output/epub3.d
parentepub, special characters in content.opf header, fix (diff)
output xmls, minor asserts
Diffstat (limited to 'src/sdp/output/epub3.d')
-rw-r--r--src/sdp/output/epub3.d17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/sdp/output/epub3.d b/src/sdp/output/epub3.d
index b05cf20..2c014b5 100644
--- a/src/sdp/output/epub3.d
+++ b/src/sdp/output/epub3.d
@@ -287,6 +287,7 @@ template outputEPub3() {
foreach (obj; doc_abstraction[part]) {
string _txt = xhtml_format.special_characters(obj, obj.text);
if (obj.is_a == "heading") {
+ assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
switch (obj.heading_lev_markup) {
case 0: .. case 3:
/+ fill buffer, and replace with new levels from 1 to 3 +/
@@ -343,8 +344,9 @@ template outputEPub3() {
break;
}
} else {
+ assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
switch (obj.use) {
- case "frontmatter":
+ case "frontmatter": assert(part == "head" || "toc_seg");
switch (obj.is_of) {
case "para":
switch (obj.is_a) {
@@ -367,7 +369,7 @@ template outputEPub3() {
break;
}
break;
- case "body":
+ case "body": assert(part == "body");
switch (obj.is_of) {
case "para":
switch (obj.is_a) {
@@ -430,29 +432,30 @@ template outputEPub3() {
}
break;
case "backmatter":
+ assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
switch (obj.is_of) {
case "para":
switch (obj.is_a) {
- case "endnote":
+ case "endnote": assert(part == "endnotes");
auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_epub3[segment_filename] ~= t[0];
break;
- case "glossary":
+ case "glossary": assert(part == "glossary");
auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_epub3[segment_filename] ~= t[0];
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
- case "bibliography":
+ case "bibliography": assert(part == "bibliography");
auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_epub3[segment_filename] ~= t[0];
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
- case "bookindex":
+ case "bookindex": assert(part == "bookindex_seg");
auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_epub3[segment_filename] ~= t[0];
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
- case "blurb":
+ case "blurb": assert(part == "blurb");
auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_epub3[segment_filename] ~= t[0];
doc_epub3_endnotes[segment_filename] ~= t[1];