aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output_xmls.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-06-12 15:38:38 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:15 -0400
commit6f8fddb2dfa5faad56af2a0bfd0bf3b694695136 (patch)
tree6b8af78c4cbb2a7a601de5430f41ab4a93503d67 /org/output_xmls.org
parent0.26.2 image(s) without dimensions (diff)
0.26.3 object info changes
Diffstat (limited to 'org/output_xmls.org')
-rw-r--r--org/output_xmls.org398
1 files changed, 199 insertions, 199 deletions
diff --git a/org/output_xmls.org b/org/output_xmls.org
index 7b86093..eb0e263 100644
--- a/org/output_xmls.org
+++ b/org/output_xmls.org
@@ -107,7 +107,7 @@ string special_characters(O)(
.replaceAll(rgx.xhtml_less_than, "&#60;")
.replaceAll(rgx.xhtml_greater_than, "&#62;")
.replaceAll(rgx.nbsp_char, " ");
- if (!(obj.is_a == "code")) {
+ if (!(obj.typeinfo.is_a == "code")) {
_txt = (_txt)
.replaceAll(rgx.xhtml_line_break, "<br />");
}
@@ -455,7 +455,7 @@ auto inline_links(O)(
string _suffix = ".html",
string _xml_type = "seg",
) {
- if (obj.inline_links) {
+ 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
_txt = (_txt).replaceAll(
@@ -477,8 +477,8 @@ auto inline_links(O)(
if (_txt.match(rgx.inline_link)) {
writeln(__LINE__,
" (missed) markup link identified (",
- obj.inline_links,
- "): ", obj.is_a, ": ",
+ obj.has.inline_links,
+ "): ", obj.typeinfo.is_a, ": ",
obj.text
);
}
@@ -487,8 +487,8 @@ auto inline_links(O)(
if (_txt.match(rgx.inline_link)) {
writeln(__LINE__,
" (missed) markup link identified (",
- obj.inline_links,
- "): ", obj.is_a, ": ",
+ obj.has.inline_links,
+ "): ", obj.typeinfo.is_a, ": ",
obj.text
);
}
@@ -505,7 +505,7 @@ auto inline_notes_scroll(O)(
auto return ref const O obj,
string _txt,
) {
- if (obj.inline_notes_reg) {
+ if (obj.has.inline_notes_reg) {
_txt = font_face(_txt);
_txt = (_txt).replaceAll(
rgx.inline_notes_delimiter_al_regular_number_note,
@@ -514,12 +514,12 @@ auto inline_notes_scroll(O)(
}
debug(markup_endnotes) {
if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
- writeln(__LINE__, " (missed) markup endnote: ", obj.is_a, ": ", obj.text);
+ writeln(__LINE__, " (missed) markup endnote: ", obj.typeinfo.is_a, ": ", obj.text);
}
}
debug(markup) {
if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
- writeln(__LINE__, " (missed) markup endnote: ", obj.is_a, ": ", obj.text);
+ writeln(__LINE__, " (missed) markup endnote: ", obj.typeinfo.is_a, ": ", obj.text);
}
}
return _txt;
@@ -535,7 +535,7 @@ auto inline_notes_seg(O)(
string _txt,
) {
string[] _endnotes;
- if (obj.inline_notes_reg) {
+ if (obj.has.inline_notes_reg) {
_txt = font_face(_txt);
/+ need markup for text, and separated footnote +/
foreach(m; _txt.matchAll(rgx.inline_notes_delimiter_al_regular_number_note)) {
@@ -560,7 +560,7 @@ auto inline_notes_seg(O)(
);
} else if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
debug(markup) {
- writeln(__LINE__, " endnote: ", obj.is_a, ": ", obj.text);
+ writeln(__LINE__, " endnote: ", obj.typeinfo.is_a, ": ", obj.text);
}
}
auto t = tuple(
@@ -614,7 +614,7 @@ string lev4_heading_subtoc(O)(
) {
char[] lev4_subtoc;
lev4_subtoc ~= " <div class=\"nav\">\n";
- foreach (subtoc; obj.lev4_subtoc) {
+ foreach (subtoc; obj.tags.lev4_subtoc) {
if (auto m = subtoc.match(rgx.inline_link_subtoc)) {
auto indent = m.captures[1].to!string;
auto text = m.captures[2].to!string;
@@ -645,7 +645,7 @@ auto nav_pre_next_svg(O)(
auto return ref const O obj,
) {
string prev, next, toc;
- if (obj.segment_anchor_tag == "toc") {
+ if (obj.tags.segment_anchor_tag == "toc") {
toc = "";
prev = "";
} else {
@@ -658,7 +658,7 @@ auto nav_pre_next_svg(O)(
</a>¶",
);
}
- if (obj.segname_prev == "") {
+ if (obj.tags.segname_prev == "") {
prev = "";
} else {
prev = format(q"¶<a href="%s.html" target="_top">
@@ -668,10 +668,10 @@ auto nav_pre_next_svg(O)(
</svg>
</div>
</a>¶",
- obj.segname_prev,
+ obj.tags.segname_prev,
);
}
- if (obj.segname_next == "") {
+ if (obj.tags.segname_next == "") {
next = "";
} else {
next = format(q"¶<a href="%s.html" target="_top">
@@ -681,7 +681,7 @@ auto nav_pre_next_svg(O)(
</svg>
</div>
</a>¶",
- obj.segname_next,
+ obj.tags.segname_next,
);
}
string _toc_pre_next = format(q"¶ <div class="flex-menu-option">
@@ -730,15 +730,15 @@ auto heading(O)(
string _txt,
string _xml_type = "html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
string _horizontal_rule = "<hr />";
if ((_xml_type != "html")
- || (obj.heading_lev_markup == 0 || obj.heading_lev_markup > 4)) {
+ || (obj.node.heading_lev_markup == 0 || obj.node.heading_lev_markup > 4)) {
_horizontal_rule = "";
}
_txt = font_face(_txt);
string o;
- if (obj.obj_cite_number.empty) {
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶%s
<div class="substance">
<h%s class="%s">%s
@@ -746,11 +746,11 @@ auto heading(O)(
</h%s>
</div>¶",
_horizontal_rule,
- obj.heading_lev_markup,
- obj.is_a,
+ obj.node.heading_lev_markup,
+ obj.typeinfo.is_a,
tags,
_txt,
- obj.heading_lev_markup,
+ obj.node.heading_lev_markup,
);
} else {
o = format(q"¶%s
@@ -761,15 +761,15 @@ auto heading(O)(
</h%s>
</div>¶",
_horizontal_rule,
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.heading_lev_markup,
- obj.is_a,
- obj.obj_cite_number,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.heading_lev_markup,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
tags,
_txt,
- obj.heading_lev_markup,
+ obj.node.heading_lev_markup,
);
}
return o;
@@ -785,7 +785,7 @@ auto heading_scroll(O)(
string _txt,
string _suffix = ".html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = inline_markup_scroll(obj, _txt, _suffix);
string o = heading(obj, _txt);
return o;
@@ -823,19 +823,19 @@ auto para(O)(
auto return ref const O obj,
string _txt,
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = font_face(_txt);
string o;
- _txt = (obj.bullet) ? ("●&#160;&#160;" ~ _txt) : _txt;
- if (obj.obj_cite_number.empty) {
+ _txt = (obj.attrib.bullet) ? ("●&#160;&#160;" ~ _txt) : _txt;
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s" indent="h%si%s">%s
%s
</p>
</div>¶",
- obj.is_a,
- obj.indent_hang,
- obj.indent_base,
+ obj.typeinfo.is_a,
+ obj.attrib.indent_hang,
+ obj.attrib.indent_base,
tags,
_txt
);
@@ -846,12 +846,12 @@ auto para(O)(
%s
</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.indent_hang,
- obj.indent_base,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.attrib.indent_hang,
+ obj.attrib.indent_base,
+ obj.node.obj_cite_number,
tags,
_txt
);
@@ -869,7 +869,7 @@ auto para_scroll(O)(
string _txt,
string _suffix = ".html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = inline_markup_scroll(obj, _txt, _suffix);
string o = para(obj, _txt);
return o;
@@ -909,13 +909,13 @@ auto quote(O)(
) {
_txt = font_face(_txt);
string o;
- if (obj.obj_cite_number.empty) {
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s">
%s
</p>
</div>¶",
- obj.is_a,
+ obj.typeinfo.is_a,
_txt
);
} else {
@@ -925,10 +925,10 @@ auto quote(O)(
%s
</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
_txt
);
}
@@ -945,7 +945,7 @@ auto quote_scroll(O)(
string _txt,
string _suffix = ".html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = inline_markup_scroll(obj, _txt, _suffix);
string o = quote(obj, _txt);
return o;
@@ -985,13 +985,13 @@ auto group(O)(
) {
_txt = font_face(_txt);
string o;
- if (obj.obj_cite_number.empty) {
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s">
%s
</p>
</div>¶",
- obj.is_a,
+ obj.typeinfo.is_a,
_txt
);
} else {
@@ -1001,10 +1001,10 @@ auto group(O)(
%s
</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
_txt
);
}
@@ -1022,7 +1022,7 @@ auto group_scroll(O)(
string _suffix = ".html",
string _xml_type = "html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = inline_markup_scroll(obj, _txt, _suffix);
string o = group(obj, _txt);
return o;
@@ -1062,11 +1062,11 @@ auto block(O)(
) {
_txt = font_face(_txt);
string o;
- if (obj.obj_cite_number.empty) {
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s">%s</p>
</div>¶",
- obj.is_a,
+ obj.typeinfo.is_a,
_txt.stripRight
);
} else {
@@ -1074,10 +1074,10 @@ auto block(O)(
<label class="ocn"><a href="#%s" class="lnkocn">%s</a></label>
<p class="%s" id="%s">%s</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
_txt.stripRight
);
}
@@ -1095,7 +1095,7 @@ auto block_scroll(O)(
string _suffix = ".html",
string _xml_type = "html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = inline_markup_scroll(obj, _txt, _suffix);
string o = block(obj, _txt);
return o;
@@ -1135,11 +1135,11 @@ auto verse(O)(
) {
_txt = font_face(_txt);
string o;
- if (obj.obj_cite_number.empty) {
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s">%s</p>
</div>¶",
- obj.is_a,
+ obj.typeinfo.is_a,
_txt
);
} else {
@@ -1147,10 +1147,10 @@ auto verse(O)(
<label class="ocn"><a href="#%s" class="lnkocn">%s</a></label>
<p class="%s" id="%s">%s</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
_txt
);
}
@@ -1168,7 +1168,7 @@ auto verse_scroll(O)(
string _suffix = ".html",
string _xml_type = "html",
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = inline_markup_scroll(obj, _txt, _suffix);
string o = verse(obj, _txt);
return o;
@@ -1206,11 +1206,11 @@ auto code(O)(
string _txt,
) {
string o;
- if (obj.obj_cite_number.empty) {
+ if (obj.node.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s">%s</p>
</div>¶",
- obj.is_a,
+ obj.typeinfo.is_a,
_txt
);
} else {
@@ -1218,10 +1218,10 @@ auto code(O)(
<label class="ocn"><a href="#%s" class="lnkocn">%s</a></label>
<p class="%s" id="%s">%s</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
_txt
);
}
@@ -1258,11 +1258,11 @@ auto tablarize(O)(
&& (_table_rows.length <= row_idx+2)) {
_tablenote ~= cell;
} else {
- string _col_is = (row_idx == 0 && obj.table_heading) ? "th" : "td";
+ string _col_is = (row_idx == 0 && obj.table.heading) ? "th" : "td";
string _align = ("style=\"text-align:"
- ~ ((obj.table_column_aligns[col_idx] == "l")
+ ~ ((obj.table.column_aligns[col_idx] == "l")
? "left\"" : "right\""));
- _table ~= "<" ~ _col_is ~ " width=\"" ~ obj.table_column_widths[col_idx].to!string ~ "%\" " ~ _align ~ ">";
+ _table ~= "<" ~ _col_is ~ " width=\"" ~ obj.table.column_widths[col_idx].to!string ~ "%\" " ~ _align ~ ">";
_table ~= cell;
_table ~= "</" ~ _col_is ~ ">";
}
@@ -1285,7 +1285,7 @@ auto table(O)(
auto return ref const O obj,
string _txt,
) {
- auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ auto tags = _xhtml_anchor_tags(obj.tags.anchor_tags);
_txt = font_face(_txt);
auto t = tablarize(obj, _txt);
_txt = t[0];
@@ -1300,10 +1300,10 @@ auto table(O)(
%s
</p>
</div>¶",
- obj.obj_cite_number,
- obj.obj_cite_number,
- obj.is_a,
- obj.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.node.obj_cite_number,
+ obj.typeinfo.is_a,
+ obj.node.obj_cite_number,
tags,
_txt,
_note
@@ -1324,9 +1324,9 @@ auto endnote(O)(
o = format(q"¶ <p class="%s" indent="h%si%s">
%s
</p>¶",
- obj.is_a,
- obj.indent_hang,
- obj.indent_base,
+ obj.typeinfo.is_a,
+ obj.attrib.indent_hang,
+ obj.attrib.indent_base,
_txt
);
return o;
@@ -1349,7 +1349,7 @@ template outputHTML() {
#+END_SRC
** scroll :scroll:
-*** switch (sections & objects) format html output
+*** ↻ loop & switch (sections & objects) format html output
#+name: output_html_scroll
#+BEGIN_SRC d
@@ -1369,11 +1369,11 @@ void scroll(D,I)(
foreach (obj; doc_abstraction[part]) {
delimit = xhtml_format.div_delimit(part, previous_part);
string _txt = xhtml_format.special_characters(obj, obj.text);
- switch (obj.of_part) {
+ switch (obj.typeinfo.of_part) {
case "frontmatter": assert(part == "head" || "toc_scroll");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "heading":
doc_html ~= delimit ~ xhtml_format.heading_scroll(obj, _txt, suffix);
break;
@@ -1382,22 +1382,22 @@ void scroll(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
break;
case "body": assert(part == "body" || "head"); // surprise
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "heading":
doc_html ~= delimit ~ xhtml_format.heading_scroll(obj, _txt, suffix);
break;
@@ -1406,13 +1406,13 @@ void scroll(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
case "block":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "quote":
doc_html ~= xhtml_format.quote_scroll(obj, _txt);
break;
@@ -1435,23 +1435,23 @@ void scroll(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
break;
case "backmatter":
assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_scroll" || "blurb" || "tail");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "heading":
doc_html ~= delimit ~ xhtml_format.heading_scroll(obj, _txt, suffix);
break;
@@ -1472,14 +1472,14 @@ void scroll(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
@@ -1488,8 +1488,8 @@ void scroll(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
@@ -1530,7 +1530,7 @@ void scroll_write_output(M,C)(
#+END_SRC
** seg :seg:
-*** switch (sections & objects) format html output
+*** ↻ loop & switch (sections & objects) format html output
#+name: output_html_seg
#+BEGIN_SRC d
@@ -1554,12 +1554,12 @@ void seg(D,M)(
foreach (obj; doc_abstraction[part]) {
delimit = xhtml_format.div_delimit(part, previous_part);
string _txt = xhtml_format.special_characters(obj, obj.text);
- if (obj.is_a == "heading") {
+ if (obj.typeinfo.is_a == "heading") {
assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
- switch (obj.heading_lev_markup) {
+ switch (obj.node.heading_lev_markup) {
case 0: .. case 3:
/+ fill buffer, and replace with new levels from 1 to 3 +/
- switch (obj.heading_lev_markup) {
+ switch (obj.node.heading_lev_markup) {
case 0:
top_level_headings[0] = "";
top_level_headings[1] = "";
@@ -1580,12 +1580,12 @@ void seg(D,M)(
goto default;
default:
auto t = xhtml_format.heading_seg(obj, _txt, suffix, "seg");
- top_level_headings[obj.heading_lev_markup] = t[0];
+ top_level_headings[obj.node.heading_lev_markup] = t[0];
break;
}
break;
case 4:
- segment_filename = obj.segment_anchor_tag;
+ segment_filename = obj.tags.segment_anchor_tag;
doc_html[segment_filename] ~= xhtml_format.html_head(doc_matters, "seg");
auto navigation_bar = xhtml_format.nav_pre_next_svg(obj);
doc_html[segment_filename] ~= navigation_bar.toc_pre_next; // navigation bar
@@ -1606,45 +1606,45 @@ void seg(D,M)(
break;
case 8: .. case 9:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup);
}
break;
}
} else {
assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
- switch (obj.of_part) {
+ switch (obj.typeinfo.of_part) {
case "frontmatter": assert(part == "head" || "toc_seg");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "toc":
auto t = xhtml_format.para_seg(obj, _txt, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
case "body": assert(part == "body");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "para":
auto t = xhtml_format.para_seg(obj, _txt, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
@@ -1652,13 +1652,13 @@ void seg(D,M)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
case "block":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "quote":
auto t = xhtml_format.quote_seg(obj, _txt, suffix, "seg");
doc_html[segment_filename] ~= t[0].to!string;
@@ -1690,23 +1690,23 @@ void seg(D,M)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
break;
case "backmatter":
assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "endnote": assert(part == "endnotes");
auto t = xhtml_format.para_seg(obj, _txt, suffix, "seg");
doc_html[segment_filename] ~= t[0];
@@ -1733,14 +1733,14 @@ void seg(D,M)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
@@ -1749,7 +1749,7 @@ void seg(D,M)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part);
}
break;
}
@@ -2004,20 +2004,20 @@ string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) {
debug(epubmanifest) {
foreach (s; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[s]) {
- if (obj.is_a == "heading") {
- if (obj.heading_lev_markup == 4) {
+ if (obj.typeinfo.is_a == "heading") {
+ if (obj.node.heading_lev_markup == 4) {
writefln(
"%s~ [%s.xhtml] %s",
obj.marked_up_level,
- obj.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
obj.text
);
- } else if (obj.heading_lev_markup > 4) {
+ } else if (obj.node.heading_lev_markup > 4) {
writefln(
"%s~ [%s.xhtml#%s] %s",
obj.marked_up_level,
- obj.segment_anchor_tag,
- obj.obj_cite_number,
+ obj.tags.segment_anchor_tag,
+ obj.node.obj_cite_number,
obj.text
);
}
@@ -2054,49 +2054,49 @@ string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) {
);
foreach (sect; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[sect]) {
- if (obj.is_a == "heading") {
+ if (obj.typeinfo.is_a == "heading") {
string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip;
foreach_reverse (n; 0 .. 7) {
string k = n.to!string;
- switch (obj.dom_collapsed[n]) {
+ switch (obj.node.dom_collapsed[n]) {
case DomTags.close :
toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "</li>" ~ "\n";
toc ~= markup.indent_by_spaces_provided(n, " ") ~ "</ol>" ~ "\n";
break;
case DomTags.close_and_open :
toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "</li>" ~ "\n";
- if (obj.heading_lev_markup < 4) {
+ if (obj.node.heading_lev_markup < 4) {
toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "<li>" ~ "\n"
~ markup.indent_by_spaces_provided((n + 2), " ")
- ~ "<a href=\"" ~ obj.segment_anchor_tag ~ ".xhtml" ~ "\">"
+ ~ "<a href=\"" ~ obj.tags.segment_anchor_tag ~ ".xhtml" ~ "\">"
~ _txt
~ "</a>" ~ "\n";
} else {
- string hashtag =(obj.heading_lev_markup == 4)
+ string hashtag =(obj.node.heading_lev_markup == 4)
? ""
- : ("#" ~ obj.ocn.to!string);
+ : ("#" ~ obj.node.ocn.to!string);
toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "<li>" ~ "\n"
~ markup.indent_by_spaces_provided((n + 2), " ")
- ~ "<a href=\"" ~ obj.segment_anchor_tag ~ ".xhtml" ~ hashtag ~ "\">"
+ ~ "<a href=\"" ~ obj.tags.segment_anchor_tag ~ ".xhtml" ~ hashtag ~ "\">"
~ _txt
~ "</a>" ~ "\n";
}
break;
case DomTags.open :
toc ~= markup.indent_by_spaces_provided(n, " ") ~ "<ol>" ~ "\n";
- if (obj.heading_lev_markup < 4) {
+ if (obj.node.heading_lev_markup < 4) {
toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "<li>" ~ "\n"
~ markup.indent_by_spaces_provided((n + 2), " ")
- ~ "<a href=\"" ~ obj.segment_anchor_tag ~ ".xhtml" ~ "\">"
+ ~ "<a href=\"" ~ obj.tags.segment_anchor_tag ~ ".xhtml" ~ "\">"
~ _txt
~ "</a>" ~ "\n";
} else {
- string hashtag =(obj.heading_lev_markup == 4)
+ string hashtag =(obj.node.heading_lev_markup == 4)
? ""
- : ("#" ~ obj.ocn.to!string);
+ : ("#" ~ obj.node.ocn.to!string);
toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "<li>" ~ "\n"
~ markup.indent_by_spaces_provided((n + 2), " ")
- ~ "<a href=\"" ~ obj.segment_anchor_tag ~ ".xhtml" ~ hashtag ~ "\">"
+ ~ "<a href=\"" ~ obj.tags.segment_anchor_tag ~ ".xhtml" ~ hashtag ~ "\">"
~ _txt
~ "</a>" ~ "\n";
}
@@ -2160,11 +2160,11 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) {
);
foreach (sect; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[sect]) {
- if (obj.is_a == "heading") {
+ if (obj.typeinfo.is_a == "heading") {
string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip;
- string hashtag =(obj.heading_lev_markup <= 4) ? "" : ("#" ~ obj.ocn.to!string);
+ string hashtag =(obj.node.heading_lev_markup <= 4) ? "" : ("#" ~ obj.node.ocn.to!string);
foreach_reverse (k; 0 .. 7) {
- switch (obj.dom_markedup[k]) {
+ switch (obj.node.dom_markedup[k]) {
case DomTags.close :
toc ~= "\n </navPoint>";
break;
@@ -2179,7 +2179,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) {
<content src="%s.xhtml%s" />¶",
counter,
_txt,
- obj.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
hashtag,
);
break;
@@ -2193,7 +2193,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) {
<content src="%s.xhtml%s" />¶",
counter,
_txt,
- obj.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
hashtag,
);
break;
@@ -2211,7 +2211,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) {
#+END_SRC
** the document contents :seg:
-*** switch (sections & objects) format epub3 xhtml output
+*** ↻ loop & switch (sections & objects) format epub3 xhtml output
#+name: output_epub3_xhtml_seg
#+BEGIN_SRC d
@@ -2233,12 +2233,12 @@ void outputEPub3(D,I)(
foreach (part; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[part]) {
string _txt = xhtml_format.special_characters(obj, obj.text);
- if (obj.is_a == "heading") {
+ if (obj.typeinfo.is_a == "heading") {
assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
- switch (obj.heading_lev_markup) {
+ switch (obj.node.heading_lev_markup) {
case 0: .. case 3:
/+ fill buffer, and replace with new levels from 1 to 3 +/
- switch (obj.heading_lev_markup) {
+ switch (obj.node.heading_lev_markup) {
case 0:
top_level_headings[0] = "";
top_level_headings[1] = "";
@@ -2258,16 +2258,16 @@ void outputEPub3(D,I)(
top_level_headings[3] = "";
goto default;
default:
- doc_parts_ ~= obj.segment_anchor_tag;
- doc_epub3[obj.segment_anchor_tag] ~= xhtml_format.epub3_seg_head(doc_matters);
+ doc_parts_ ~= obj.tags.segment_anchor_tag;
+ doc_epub3[obj.tags.segment_anchor_tag] ~= xhtml_format.epub3_seg_head(doc_matters);
auto t = xhtml_format.heading_seg(obj, _txt, suffix, "epub");
- doc_epub3[obj.segment_anchor_tag] ~= t[0];
- doc_epub3_endnotes[obj.segment_anchor_tag] ~= t[1];
+ doc_epub3[obj.tags.segment_anchor_tag] ~= t[0];
+ doc_epub3_endnotes[obj.tags.segment_anchor_tag] ~= t[1];
break;
}
break;
case 4:
- segment_filename = obj.segment_anchor_tag;
+ segment_filename = obj.tags.segment_anchor_tag;
doc_epub3[segment_filename] ~= xhtml_format.epub3_seg_head(doc_matters);
auto t = xhtml_format.heading_seg(obj, _txt, suffix, "epub");
doc_epub3[segment_filename] ~= t[0];
@@ -2280,23 +2280,23 @@ void outputEPub3(D,I)(
break;
case 8: .. case 9:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a, ": ", obj.node.heading_lev_markup);
}
break;
}
} else {
assert(part == "head" || "toc_seg" || "body" || "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
- switch (obj.of_part) {
+ switch (obj.typeinfo.of_part) {
case "frontmatter": assert(part == "head" || "toc_seg");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "toc":
auto t = xhtml_format.para_seg(obj, _txt, suffix, "epub");
doc_epub3[segment_filename] ~= t[0];
@@ -2304,22 +2304,22 @@ void outputEPub3(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
break;
case "body": assert(part == "body");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "para":
auto t = xhtml_format.para_seg(obj, _txt, suffix, "epub");
doc_epub3[segment_filename] ~= t[0];
@@ -2327,13 +2327,13 @@ void outputEPub3(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
case "block":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "quote":
auto t = xhtml_format.quote_seg(obj, _txt, suffix, "epub");
doc_epub3[segment_filename] ~= t[0].to!string;
@@ -2365,23 +2365,23 @@ void outputEPub3(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
break;
case "backmatter":
assert(part == "endnotes" || "glossary" || "bibliography" || "bookindex_seg" || "blurb" || "tail");
- switch (obj.is_of) {
+ switch (obj.typeinfo.is_of) {
case "para":
- switch (obj.is_a) {
+ switch (obj.typeinfo.is_a) {
case "endnote": assert(part == "endnotes");
auto t = xhtml_format.para_seg(obj, _txt, suffix, "epub");
doc_epub3[segment_filename] ~= t[0];
@@ -2408,14 +2408,14 @@ void outputEPub3(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_a);
}
break;
}
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.is_of);
}
break;
}
@@ -2424,53 +2424,53 @@ void outputEPub3(D,I)(
break;
default:
if ((doc_matters.opt.action.debug_do)) {
- writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
+ writeln(__FILE__, ":", __LINE__, ": ", obj.typeinfo.of_part);
}
break;
}
}
- if (obj.is_a == "heading") {
+ if (obj.typeinfo.is_a == "heading") {
assert(obj.text.length > 0);
- if (obj.heading_lev_markup <= 4) {
+ if (obj.node.heading_lev_markup <= 4) {
oepbs_content_parts["manifest_documents"] ~=
format(q"¶ <item id="%s.xhtml" href="%s.xhtml" media-type="application/xhtml+xml" />
¶",
- obj.segment_anchor_tag,
- obj.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
);
oepbs_content_parts["spine"] ~=
format(q"¶ <itemref idref="%s.xhtml" linear="yes" />
¶",
- obj.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
);
oepbs_content_parts["guide"] ~=
format(q"¶ <reference type="%s" href="%s" />
¶",
- obj.segment_anchor_tag,
- obj.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
+ obj.tags.segment_anchor_tag,
);
- } else if (obj.heading_lev_markup > 4) {
+ } else if (obj.node.heading_lev_markup > 4) {
oepbs_content_parts["manifest_documents"] ~=
format(q"¶ <item id="%s.xhtml#%s" href="%s.xhtml#%s" media-type="application/xhtml+xml" />
¶",
- obj.segment_anchor_tag,
- obj.obj_cite_number,
- obj.segment_anchor_tag,
- obj.obj_cite_number,
+ obj.tags.segment_anchor_tag,
+ obj.node.obj_cite_number,
+ obj.tags.segment_anchor_tag,
+ obj.node.obj_cite_number,
);
oepbs_content_parts["spine"] ~=
format(q"¶ <itemref idref="%s.xhtml#%s" linear="yes" />
¶",
- obj.segment_anchor_tag,
- obj.obj_cite_number,
+ obj.tags.segment_anchor_tag,
+ obj.node.obj_cite_number,
);
oepbs_content_parts["guide"] ~=
format(q"¶ <reference type="%s#%s" href="%s#%s" />
¶",
- obj.segment_anchor_tag,
- obj.obj_cite_number,
- obj.segment_anchor_tag,
- obj.obj_cite_number,
+ obj.tags.segment_anchor_tag,
+ obj.node.obj_cite_number,
+ obj.tags.segment_anchor_tag,
+ obj.node.obj_cite_number,
);
}
}