From da0f051e1aced4fa1fd5cd13c0548279bf04b2a0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 12 Apr 2017 15:23:23 -0400 Subject: 0.13.9 sisupod & epub3, zipped output --- src/sdp/output_xhtmls.d | 120 +++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 58 deletions(-) (limited to 'src/sdp/output_xhtmls.d') diff --git a/src/sdp/output_xhtmls.d b/src/sdp/output_xhtmls.d index 2a86d4c..804b82f 100644 --- a/src/sdp/output_xhtmls.d +++ b/src/sdp/output_xhtmls.d @@ -3,22 +3,26 @@ template outputXHTMLs() { std.algorithm, std.array, std.container, + std.digest.sha, std.exception, std.file, std.getopt, std.json, - std.process, - std.stdio, + std.outbuffer, std.path, + std.process, std.range, std.regex, + std.stdio, std.string, std.traits, std.typecons, std.uni, std.utf, + std.zip, std.conv : to; import + create_zip_file, defaults, output_rgx, output_xhtmls; @@ -30,7 +34,7 @@ template outputXHTMLs() { .replaceAll(rgx.xhtml_ampersand, "&") .replaceAll(rgx.xhtml_less_than, "<") .replaceAll(rgx.xhtml_greater_than, ">") - .replaceAll(rgx.xhtml_line_break, "
"); + .replaceAll(rgx.xhtml_line_break, "
"); return _txt; } string font_face(string _txt){ @@ -61,7 +65,7 @@ template outputXHTMLs() { auto scroll_head(Me)( Me dochead_meta, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(dochead_meta) == string[string][string])); } string o; @@ -69,26 +73,27 @@ template outputXHTMLs() { - - %s%s - - - - - - - - - - - - - - + + %s%s + + + + + + + + + + + + + + + - - + + ¶", @@ -100,7 +105,7 @@ template outputXHTMLs() { auto seg_head(Me)( Me dochead_meta, ) { - debug(asserts){ + debug(asserts) { static assert(is(typeof(dochead_meta) == string[string][string])); } string o; @@ -108,26 +113,27 @@ template outputXHTMLs() { - - %s%s - - - - - - - - - - - - - - + + %s%s + + + + + + + + + + + + + + + + - - + + ¶", @@ -192,13 +198,13 @@ template outputXHTMLs() { return _txt; } auto inline_notes_scroll(O)( - auto return ref const O obj, - string _txt, + auto return ref const O obj, + string _txt, ) { if (obj.inline_notes_reg) { _txt = (_txt).replaceAll( rgx.inline_notes_delimiter_al_regular_number_note, - (" $1 ") + (" $1 ") ); } debug(markup_endnotes) { @@ -236,7 +242,7 @@ template outputXHTMLs() { "\">", " ", + "\"> ", m.captures[1], ".", m.captures[2], @@ -245,7 +251,7 @@ template outputXHTMLs() { } _txt = (_txt).replaceAll( rgx.inline_notes_delimiter_al_regular_number_note, - (" $1 ") + (" $1 ") ); } else if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) { debug(markup) { @@ -301,7 +307,7 @@ template outputXHTMLs() { auto tags = _xhtml_anchor_tags(obj.anchor_tags); string o; if (obj.obj_cite_number.empty) { - o = format(q"¶


+ o = format(q"¶


%s %s @@ -314,7 +320,7 @@ template outputXHTMLs() { obj.heading_lev_markup, ); } else { - o = format(q"¶


+ o = format(q"¶


%s @@ -364,7 +370,7 @@ template outputXHTMLs() { auto tags = _xhtml_anchor_tags(obj.anchor_tags); _txt = font_face(_txt); string o; - _txt = (obj.bullet) ? ("●  " ~ _txt) : _txt; + _txt = (obj.bullet) ? ("●  " ~ _txt) : _txt; if (obj.obj_cite_number.empty) { o = format(q"¶

%s @@ -541,7 +547,6 @@ template outputXHTMLs() {

¶", obj.is_a, _txt - // obj.text ); } else { o = format(q"¶
@@ -555,7 +560,6 @@ template outputXHTMLs() { obj.is_a, obj.obj_cite_number, _txt - // obj.text ); } return o; @@ -589,9 +593,9 @@ template outputXHTMLs() { ) { _txt = font_face(_txt); _txt = (_txt) - .replaceAll(rgx.newline, "
\n") - .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") - .replaceAll(rgx.nbsp_and_space, " " ~ " ") + .replaceAll(rgx.newline, "
\n") + .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") + .replaceAll(rgx.nbsp_and_space, " " ~ " ") .replaceAll(rgx.strip_br, ""); string o; if (obj.obj_cite_number.empty) { @@ -723,8 +727,8 @@ template outputXHTMLs() { ) { string _txt = obj.text; _txt = (_txt) - .replaceAll(rgx.newline, "
\n") - .replaceAll(rgx.nbsp_char, " "); + .replaceAll(rgx.newline, "
\n") + .replaceAll(rgx.nbsp_char, " "); string o; if (obj.obj_cite_number.empty) { o = format(q"¶
-- cgit v1.2.3