From 6f8fddb2dfa5faad56af2a0bfd0bf3b694695136 Mon Sep 17 00:00:00 2001
From: Ralph Amissah %s
%s
");
}
@@ -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 ~= "
%s
%s
%s
%s
¶", - 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"¶%s
%s
¶", - 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"¶%s
%s
¶", - 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 ¶", - 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"¶%s
¶", - 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), " ") ~ "" ~ "\n"; toc ~= markup.indent_by_spaces_provided(n, " ") ~ "" ~ "\n"; break; case DomTags.close_and_open : toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "" ~ "\n"; - if (obj.heading_lev_markup < 4) { + if (obj.node.heading_lev_markup < 4) { toc ~= markup.indent_by_spaces_provided((n + 1), " ") ~ "