From 3f393a3c2955c5af64cab3f22b776b96aebebd66 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 25 Jan 2019 12:34:03 -0500 Subject: rearrange some code --- org/output_xmls.org | 403 +++++++++++++++++++++++++--------------------------- 1 file changed, 191 insertions(+), 212 deletions(-) (limited to 'org/output_xmls.org') diff --git a/org/output_xmls.org b/org/output_xmls.org index 8c9ed75..979534c 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -427,10 +427,10 @@ auto tail() { #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_images(M,O)( - M doc_matters, - const O obj, +auto inline_images(O,M)( string _txt, + const O obj, + M doc_matters, string _suffix = ".html", string _xml_type = "seg", ) { @@ -458,18 +458,18 @@ auto inline_images(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_links(M,O)( - M doc_matters, - const O obj, - string _txt, +auto inline_links(O,M)( + string _txt, + const O obj, + M doc_matters, string _suffix = ".html", string _xml_type = "seg", ) { string seg_lvs; if (obj.has.inline_links) { if (obj.metainfo.is_a != "code") { - _txt = replaceAll!(hit => - hit[1] ~ "┤" ~ to!string((obj.stow.link[hit[2].to!ulong])).encode ~ "├" + _txt = replaceAll!(m => + m[1] ~ "┤" ~ to!string((obj.stow.link[m[2].to!ulong])).encode ~ "├" )(_txt, rgx.inline_link_number_only); } if ((_txt.match(rgx.mark_internal_site_lnk)) @@ -552,10 +552,10 @@ auto inline_links(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_notes_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, +auto inline_notes_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, ) { if (obj.has.inline_notes_reg) { _txt = font_face(_txt); @@ -582,10 +582,10 @@ auto inline_notes_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_notes_seg(M,O)( - M doc_matters, - const O obj, - string _txt, +auto inline_notes_seg(O,M)( + string _txt, + const O obj, + M doc_matters, ) { string[] _endnotes; if (obj.has.inline_notes_reg) { @@ -629,15 +629,15 @@ auto inline_notes_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_markup_scroll(M,O)( - M doc_matters, - const O obj, +auto inline_markup_scroll(O,M)( string _txt, + const O obj, + M doc_matters, string _suffix = ".html", ) { - _txt = inline_images(doc_matters, obj, _txt, _suffix, "scroll"); - _txt = inline_links(doc_matters, obj, _txt, _suffix, "scroll"); - _txt = inline_notes_scroll(doc_matters, obj, _txt); + _txt = inline_images(_txt, obj, doc_matters, _suffix, "scroll"); + _txt = inline_links(_txt, obj, doc_matters, _suffix, "scroll"); + _txt = inline_notes_scroll(_txt, obj, doc_matters); return _txt; } #+END_SRC @@ -646,16 +646,16 @@ auto inline_markup_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_markup_seg(M,O)( - M doc_matters, - const O obj, +auto inline_markup_seg(O,M)( string _txt, + const O obj, + M doc_matters, string _suffix = ".html", string _xml_type = "seg", ) { - _txt = inline_images(doc_matters, obj, _txt, _suffix, _xml_type); // TODO - _txt = inline_links(doc_matters, obj, _txt, _suffix, _xml_type); // TODO - auto t = inline_notes_seg(doc_matters, obj, _txt); + _txt = inline_images(_txt, obj, doc_matters, _suffix, _xml_type); // TODO + _txt = inline_links(_txt, obj, doc_matters, _suffix, _xml_type); // TODO + auto t = inline_notes_seg(_txt, obj, doc_matters); return t; } #+END_SRC @@ -665,9 +665,9 @@ auto inline_markup_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -string lev4_heading_subtoc(M,O)( - M doc_matters, - const O obj, +string lev4_heading_subtoc(O,M)( + const O obj, + M doc_matters, ) { char[] lev4_subtoc; lev4_subtoc ~= "
\n"; @@ -698,9 +698,9 @@ string lev4_heading_subtoc(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto nav_pre_next_svg(M,O)( - M doc_matters, - const O obj, +auto nav_pre_next_svg(O,M)( + const O obj, + M doc_matters, ) { string prev, next, toc; if (obj.tags.segment_anchor_tag_epub == "toc") { @@ -784,8 +784,8 @@ auto nav_pre_next_svg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto heading(O)( - const O obj, string _txt, + const O obj, string _xml_type = "html", ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); @@ -848,15 +848,15 @@ auto heading(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto heading_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", +auto heading_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", ) { auto tags = _xhtml_anchor_tags(obj); - _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = heading(obj, _txt); + _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); + string o = heading(_txt, obj); return o; } #+END_SRC @@ -865,17 +865,17 @@ auto heading_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto heading_seg(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html" +auto heading_seg(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { - auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); + auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0]; string[] _endnotes = t[1]; - string o = heading(obj, _txt, _xml_type); + string o = heading(_txt, obj, _xml_type); auto u = tuple( o, _endnotes, @@ -890,8 +890,8 @@ auto heading_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto para(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -940,15 +940,15 @@ auto para(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto para_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", +auto para_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", ) { auto tags = _xhtml_anchor_tags(obj); - _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = para(obj, _txt); + _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); + string o = para(_txt, obj); return o; } #+END_SRC @@ -957,17 +957,17 @@ auto para_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto para_seg(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto para_seg(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { - auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); + auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = para(obj, _txt); + string o = para(_txt, obj); auto u = tuple( o, _endnotes, @@ -982,8 +982,8 @@ auto para_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto quote(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1022,15 +1022,15 @@ auto quote(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto quote_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", +auto quote_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", ) { auto tags = _xhtml_anchor_tags(obj); - _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = quote(obj, _txt); + _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); + string o = quote(_txt, obj); return o; } #+END_SRC @@ -1039,17 +1039,17 @@ auto quote_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto quote_seg(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto quote_seg(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { - auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); + auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = quote(obj, _txt); + string o = quote(_txt, obj); auto u = tuple( o, _endnotes, @@ -1064,8 +1064,8 @@ auto quote_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto group(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1104,16 +1104,16 @@ auto group(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto group_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto group_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { auto tags = _xhtml_anchor_tags(obj); - _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = group(obj, _txt); + _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); + string o = group(_txt, obj); return o; } #+END_SRC @@ -1122,17 +1122,17 @@ auto group_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto group_seg(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto group_seg(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { - auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); + auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = group(obj, _txt); + string o = group(_txt, obj); auto u = tuple( o, _endnotes, @@ -1147,8 +1147,8 @@ auto group_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto block(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1183,16 +1183,16 @@ auto block(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto block_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto block_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { auto tags = _xhtml_anchor_tags(obj); - _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = block(obj, _txt); + _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); + string o = block(_txt, obj); return o; } #+END_SRC @@ -1201,17 +1201,17 @@ auto block_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto block_seg(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto block_seg(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { - auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); + auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = block(obj, _txt); + string o = block(_txt, obj); auto u = tuple( o, _endnotes, @@ -1226,8 +1226,8 @@ auto block_seg(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto verse(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -1262,16 +1262,16 @@ auto verse(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto verse_scroll(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto verse_scroll(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { auto tags = _xhtml_anchor_tags(obj); - _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = verse(obj, _txt); + _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); + string o = verse(_txt, obj); return o; } #+END_SRC @@ -1280,17 +1280,17 @@ auto verse_scroll(M,O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto verse_seg(M,O)( - M doc_matters, - const O obj, - string _txt, - string _suffix = ".html", - string _xml_type = "html", +auto verse_seg(O,M)( + string _txt, + const O obj, + M doc_matters, + string _suffix = ".html", + string _xml_type = "html", ) { - auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); + auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = verse(obj, _txt); + string o = verse(_txt, obj); auto u = tuple( o, _endnotes, @@ -1304,8 +1304,8 @@ auto verse_seg(M,O)( #+name: xhtml_format_objects_code #+BEGIN_SRC d auto code(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -1349,8 +1349,8 @@ align="left|right|center" #+name: xhtml_format_objects #+BEGIN_SRC d auto tablarize(O)( - const O obj, string _txt, + const O obj, ) { string[] _table_rows = (_txt).split(rgx.table_delimiter_row); string[] _table_cols; @@ -1388,8 +1388,8 @@ auto tablarize(O)( #+name: xhtml_format_objects #+BEGIN_SRC d auto table(O)( - const O obj, string _txt, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -1397,7 +1397,7 @@ auto table(O)( assert(obj.metainfo.is_a == "table"); auto tags = _xhtml_anchor_tags(obj); _txt = font_face(_txt); - auto t = tablarize(obj, _txt); + auto t = tablarize(_txt, obj); _txt = t[0]; string _note = t[1]; string o; @@ -1422,27 +1422,6 @@ auto table(O)( } #+END_SRC -*** endnote - -#+name: xhtml_format_objects -#+BEGIN_SRC d -auto endnote(O)( - const O obj, - string _txt, -) { - string o; - o = format(q"¶

- %s -

¶", - obj.metainfo.is_a, - obj.attrib.indent_hang, - obj.attrib.indent_base, - _txt - ); - return o; -} -#+END_SRC - * _html_ [#A] :html: ** module template :module: @@ -1497,10 +1476,10 @@ void scroll(D,M)( case "para": switch (obj.metainfo.is_a) { case "heading": - doc_html ~= delimit ~ xhtml_format.heading_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= delimit ~ xhtml_format.heading_scroll(_txt, obj, doc_matters, suffix); break; case "toc": - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; default: { /+ debug +/ @@ -1533,10 +1512,10 @@ void scroll(D,M)( case "para": switch (obj.metainfo.is_a) { case "heading": - doc_html ~= delimit ~ xhtml_format.heading_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= delimit ~ xhtml_format.heading_scroll(_txt, obj, doc_matters, suffix); break; case "para": - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; default: { /+ debug +/ @@ -1551,24 +1530,24 @@ void scroll(D,M)( case "block": switch (obj.metainfo.is_a) { case "quote": - doc_html ~= xhtml_format.quote_scroll(doc_matters, obj, _txt); + doc_html ~= xhtml_format.quote_scroll(_txt, obj, doc_matters); break; case "group": - doc_html ~= xhtml_format.group_scroll(doc_matters, obj, _txt); + doc_html ~= xhtml_format.group_scroll(_txt, obj, doc_matters); break; case "block": - doc_html ~= xhtml_format.block_scroll(doc_matters, obj, _txt); + doc_html ~= xhtml_format.block_scroll(_txt, obj, doc_matters); break; case "poem": break; case "verse": - doc_html ~= xhtml_format.verse_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.verse_scroll(_txt, obj, doc_matters, suffix); break; case "code": - doc_html ~= xhtml_format.code(obj, _txt); + doc_html ~= xhtml_format.code(_txt, obj); break; case "table": - doc_html ~= xhtml_format.table(obj, _txt); + doc_html ~= xhtml_format.table(_txt, obj); break; default: { /+ debug +/ @@ -1602,22 +1581,22 @@ void scroll(D,M)( case "para": switch (obj.metainfo.is_a) { case "heading": - doc_html ~= delimit ~ xhtml_format.heading_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= delimit ~ xhtml_format.heading_scroll(_txt, obj, doc_matters, suffix); break; case "endnote": assert(part == "endnotes"); - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; case "glossary": assert(part == "glossary"); - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; case "bibliography": assert(part == "bibliography"); - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; case "bookindex": assert(part == "bookindex"); - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; case "blurb": assert(part == "blurb"); - doc_html ~= xhtml_format.para_scroll(doc_matters, obj, _txt, suffix); + doc_html ~= xhtml_format.para_scroll(_txt, obj, doc_matters, suffix); break; default: { /+ debug +/ @@ -1756,7 +1735,7 @@ void seg(D,M)( top_level_headings[3] = ""; goto default; default: - auto t = xhtml_format.heading_seg(doc_matters, obj, _txt, suffix, "seg"); + auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "seg"); top_level_headings[obj.metainfo.heading_lev_markup] = t[0]; break; } @@ -1764,19 +1743,19 @@ void seg(D,M)( case 4: segment_filename = obj.tags.segment_anchor_tag_epub; doc_html[segment_filename] ~= xhtml_format.html_head(doc_matters, "seg"); - auto navigation_bar = xhtml_format.nav_pre_next_svg(doc_matters, obj); + auto navigation_bar = xhtml_format.nav_pre_next_svg(obj, doc_matters); doc_html[segment_filename] ~= navigation_bar.toc_pre_next; previous_seg_filename = segment_filename; foreach (top_level_heading; top_level_headings) { doc_html[segment_filename] ~= top_level_heading; } - auto t = xhtml_format.heading_seg(doc_matters, obj, _txt, suffix, "seg"); + auto 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(doc_matters, obj); + 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(doc_matters, obj, _txt, suffix, "seg"); + auto 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; @@ -1818,7 +1797,7 @@ void seg(D,M)( case "para": switch (obj.metainfo.is_a) { case "toc": - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "seg"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "seg"); doc_html[segment_filename] ~= t[0].to!string; break; default: @@ -1852,7 +1831,7 @@ void seg(D,M)( case "para": switch (obj.metainfo.is_a) { case "para": - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "seg"); + auto 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; @@ -1869,32 +1848,32 @@ void seg(D,M)( case "block": switch (obj.metainfo.is_a) { case "quote": - auto t = xhtml_format.quote_seg(doc_matters, obj, _txt, suffix, "seg"); + 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; case "group": - auto t = xhtml_format.group_seg(doc_matters, obj, _txt, suffix, "seg"); + 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; case "block": - auto t = xhtml_format.block_seg(doc_matters, obj, _txt, suffix, "seg"); + 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; case "poem": break; case "verse": - auto t = xhtml_format.verse_seg(doc_matters, obj, _txt, suffix, "seg"); + 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; case "code": - doc_html[segment_filename] ~= xhtml_format.code(obj, _txt); + doc_html[segment_filename] ~= xhtml_format.code(_txt, obj); break; case "table": - doc_html[segment_filename] ~= xhtml_format.table(obj, _txt); + doc_html[segment_filename] ~= xhtml_format.table(_txt, obj); doc_html_endnotes[segment_filename] ~= ""; break; default: @@ -1929,26 +1908,26 @@ void seg(D,M)( case "para": switch (obj.metainfo.is_a) { case "endnote": assert(part == "endnotes"); - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "seg"); + auto 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(doc_matters, obj, _txt, suffix, "seg"); + auto 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(doc_matters, obj, _txt, suffix, "seg"); + auto 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(doc_matters, obj, _txt, suffix, "seg"); + auto 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(doc_matters, obj, _txt, suffix, "seg"); + auto 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; @@ -2523,7 +2502,7 @@ void outputEPub3(D,I)( default: epubWrite.doc_parts ~= obj.tags.segment_anchor_tag_epub; epubWrite.doc_epub3[obj.tags.segment_anchor_tag_epub] ~= xhtml_format.epub3_seg_head(doc_matters); - auto t = xhtml_format.heading_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[obj.tags.segment_anchor_tag_epub] ~= t[0]; epubWrite.doc_epub3_endnotes[obj.tags.segment_anchor_tag_epub] ~= t[1]; break; @@ -2532,12 +2511,12 @@ void outputEPub3(D,I)( case 4: segment_filename = obj.tags.segment_anchor_tag_epub; epubWrite.doc_epub3[segment_filename] ~= xhtml_format.epub3_seg_head(doc_matters); - auto t = xhtml_format.heading_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case 5: .. case 7: - auto t = xhtml_format.heading_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.heading_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; @@ -2579,7 +2558,7 @@ void outputEPub3(D,I)( case "para": switch (obj.metainfo.is_a) { case "toc": - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; @@ -2614,7 +2593,7 @@ void outputEPub3(D,I)( case "para": switch (obj.metainfo.is_a) { case "para": - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; @@ -2631,32 +2610,32 @@ void outputEPub3(D,I)( case "block": switch (obj.metainfo.is_a) { case "quote": - auto t = xhtml_format.quote_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.quote_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0].to!string; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "group": - auto t = xhtml_format.group_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.group_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0].to!string; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "block": - auto t = xhtml_format.block_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.block_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0].to!string; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "poem": break; case "verse": - auto t = xhtml_format.verse_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.verse_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0].to!string; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "code": - epubWrite.doc_epub3[segment_filename] ~= xhtml_format.code(obj, _txt); + epubWrite.doc_epub3[segment_filename] ~= xhtml_format.code(_txt, obj); break; case "table": - epubWrite.doc_epub3[segment_filename] ~= xhtml_format.table(obj, _txt); + epubWrite.doc_epub3[segment_filename] ~= xhtml_format.table(_txt, obj); epubWrite.doc_epub3_endnotes[segment_filename] ~= ""; break; default: @@ -2691,26 +2670,26 @@ void outputEPub3(D,I)( case "para": switch (obj.metainfo.is_a) { case "endnote": assert(part == "endnotes"); - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; break; case "glossary": assert(part == "glossary"); - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "bibliography": assert(part == "bibliography"); - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "bookindex": assert(part == "bookindex"); - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; case "blurb": assert(part == "blurb"); - auto t = xhtml_format.para_seg(doc_matters, obj, _txt, suffix, "epub"); + auto t = xhtml_format.para_seg(_txt, obj, doc_matters, suffix, "epub"); epubWrite.doc_epub3[segment_filename] ~= t[0]; epubWrite.doc_epub3_endnotes[segment_filename] ~= t[1]; break; @@ -2802,9 +2781,9 @@ void outputEPub3(D,I)( /+ epub specific documents +/ epubWrite.mimetypes = epub3_mimetypes; epubWrite.meta_inf_container_xml = epub3_container_xml; - epubWrite.oebps_toc_ncx = epub2_oebps_toc_ncx(doc_abstraction, doc_matters); - epubWrite.oebps_toc_nav_xhtml = epub3_oebps_toc_nav_xhtml(doc_abstraction, doc_matters); - epubWrite.oebps_content_opf = epub3_oebps_content(doc_abstraction, doc_matters, oepbs_content_parts); + epubWrite.oebps_toc_ncx = doc_abstraction.epub2_oebps_toc_ncx(doc_matters); + epubWrite.oebps_toc_nav_xhtml = doc_abstraction.epub3_oebps_toc_nav_xhtml(doc_matters); + epubWrite.oebps_content_opf = doc_abstraction.epub3_oebps_content(doc_matters, oepbs_content_parts); epubWrite.epub3_write_output_files(doc_matters); } #+END_SRC -- cgit v1.2.3