diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-03-28 21:08:52 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | e162e70ec5e83bf33fadc59e2375547828b81581 (patch) | |
tree | bdcb61244668b872017deea59b0ba347e1a85fe5 /src/sdp/output_xhtmls.d | |
parent | 0.13.8 endnotes for various types of block (diff) |
start work on block outputs
Diffstat (limited to 'src/sdp/output_xhtmls.d')
-rw-r--r-- | src/sdp/output_xhtmls.d | 170 |
1 files changed, 165 insertions, 5 deletions
diff --git a/src/sdp/output_xhtmls.d b/src/sdp/output_xhtmls.d index f371121..2a86d4c 100644 --- a/src/sdp/output_xhtmls.d +++ b/src/sdp/output_xhtmls.d @@ -419,9 +419,65 @@ template outputXHTMLs() { ); return u; } - auto nugget(O)( + auto quote(O)( auto return ref const O obj, + string _txt, + ) { + _txt = font_face(_txt); + string o; + if (obj.obj_cite_number.empty) { + o = format(q"¶ <div class="substance"> + <p class="%s"> + %s + </p> + </div>¶", + obj.is_a, + _txt + ); + } else { + o = format(q"¶ <div class="substance"> + <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, + _txt + ); + } + return o; + } + auto quote_scroll(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto tags = _xhtml_anchor_tags(obj.anchor_tags); + string _txt = inline_markup_scroll(obj, _suffix); // issue + string o = quote(obj, _txt); + return o; + } + auto quote_seg(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto t = inline_markup_seg(obj, _suffix); + string _txt = to!string(t[0]); + string[] _endnotes = t[1]; + string o = quote(obj, _txt); + auto u = tuple( + o, + _endnotes, + ); + return u; + } + auto group(O)( + auto return ref const O obj, + string _txt, ) { + _txt = font_face(_txt); string o; if (obj.obj_cite_number.empty) { o = format(q"¶ <div class="substance"> @@ -430,7 +486,7 @@ template outputXHTMLs() { </p> </div>¶", obj.is_a, - obj.text + _txt ); } else { o = format(q"¶ <div class="substance"> @@ -443,19 +499,100 @@ template outputXHTMLs() { obj.obj_cite_number, obj.is_a, obj.obj_cite_number, - obj.text + _txt ); } return o; } + auto group_scroll(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto tags = _xhtml_anchor_tags(obj.anchor_tags); + string _txt = inline_markup_scroll(obj, _suffix); // issue + string o = group(obj, _txt); + return o; + } + auto group_seg(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto t = inline_markup_seg(obj, _suffix); + string _txt = to!string(t[0]); + string[] _endnotes = t[1]; + string o = group(obj, _txt); + auto u = tuple( + o, + _endnotes, + ); + return u; + } + auto block(O)( + auto return ref const O obj, + string _txt, + ) { + _txt = font_face(_txt); + string o; + if (obj.obj_cite_number.empty) { + o = format(q"¶ <div class="substance"> + <p class="%s"> + %s + </p> + </div>¶", + obj.is_a, + _txt + // obj.text + ); + } else { + o = format(q"¶ <div class="substance"> + <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, + _txt + // obj.text + ); + } + return o; + } + auto block_scroll(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto tags = _xhtml_anchor_tags(obj.anchor_tags); + string _txt = inline_markup_scroll(obj, _suffix); // issue + string o = block(obj, _txt); + return o; + } + auto block_seg(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto t = inline_markup_seg(obj, _suffix); + string _txt = to!string(t[0]); + string[] _endnotes = t[1]; + string o = block(obj, _txt); + auto u = tuple( + o, + _endnotes, + ); + return u; + } auto verse(O)( // using code from code block, review auto return ref const O obj, + string _txt, ) { - string _txt = obj.text; + _txt = font_face(_txt); _txt = (_txt) .replaceAll(rgx.newline, "<br>\n") .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") - .replaceAll(rgx.nbsp_and_space, " " ~ " "); + .replaceAll(rgx.nbsp_and_space, " " ~ " ") + .replaceAll(rgx.strip_br, ""); string o; if (obj.obj_cite_number.empty) { o = format(q"¶ <div class="substance"> @@ -482,6 +619,29 @@ template outputXHTMLs() { } return o; } + auto verse_scroll(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto tags = _xhtml_anchor_tags(obj.anchor_tags); + string _txt = inline_markup_scroll(obj, _suffix); // issue + string o = verse(obj, _txt); + return o; + } + auto verse_seg(O)( + auto return ref const O obj, + string _suffix = ".html", + ) { + auto t = inline_markup_seg(obj, _suffix); + string _txt = to!string(t[0]); + string[] _endnotes = t[1]; + string o = verse(obj, _txt); + auto u = tuple( + o, + _endnotes, + ); + return u; + } auto tablarize(O)( auto return ref const O obj, string _txt, |