From d28ce48b155a11bf4f313982139f4697120e2df1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 28 Feb 2017 15:26:52 -0500 Subject: work on outputs --- org/output.org | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'org/output.org') diff --git a/org/output.org b/org/output.org index 8ad43d9..bda3325 100644 --- a/org/output.org +++ b/org/output.org @@ -272,6 +272,40 @@ template outputXHTMLs() { #+END_SRC **** misc +***** special characters + +#+name: xhtml_format_objects +#+BEGIN_SRC d +string special_characters(string _txt){ + _txt = (_txt) + .replaceAll(rgx.xhtml_ampersand, "&") + .replaceAll(rgx.xhtml_less_than, "<") + .replaceAll(rgx.xhtml_greater_than, ">") + .replaceAll(rgx.xhtml_line_break, "
"); + return _txt; +} +#+END_SRC + +***** font_face + +#+name: xhtml_format_objects +#+BEGIN_SRC d +string font_face(string _txt){ + _txt = (_txt) + .replaceAll(rgx.inline_emphasis, ("$1")) + .replaceAll(rgx.inline_bold, ("$1")) + .replaceAll(rgx.inline_underscore, ("$1")) + .replaceAll(rgx.inline_italics, ("$1")) + .replaceAll(rgx.inline_superscript, ("$1")) + .replaceAll(rgx.inline_subscript, ("$1")) + .replaceAll(rgx.inline_strike, ("$1")) + .replaceAll(rgx.inline_insert, ("$1")) + .replaceAll(rgx.inline_mono, ("$1")) + .replaceAll(rgx.inline_cite, ("$1")); + return _txt; +} +#+END_SRC + ***** anchor tags #+name: xhtml_format_objects @@ -536,6 +570,7 @@ auto inline_markup_scroll(O)( string _suffix = ".html", ) { string _txt = obj.text; + _txt = special_characters(_txt); _txt = inline_links(obj, _txt, _suffix, "scroll"); _txt = inline_notes_scroll(obj, _txt); return _txt; @@ -551,6 +586,7 @@ auto inline_markup_seg(O)( string _suffix = ".html", ) { string _txt = obj.text; + _txt = special_characters(_txt); _txt = inline_links(obj, _txt, _suffix, "seg"); auto t = inline_notes_seg(obj, _txt); return t; @@ -671,7 +707,9 @@ auto para(O)( string _txt, ) { auto tags = _xhtml_anchor_tags(obj.anchor_tags); + _txt = font_face(_txt); string o; + _txt = (obj.bullet) ? ("●  " ~ _txt) : _txt; if (obj.obj_cite_number.empty) { o = format(q"¶

%s @@ -802,6 +840,10 @@ auto endnote(O)( auto code(O)( auto return ref const O obj, ) { + string _txt = obj.text; + _txt = (_txt) + .replaceAll(rgx.newline, "
\n") + .replaceAll(rgx.nbsp_char, " "); string o; if (obj.obj_cite_number.empty) { o = format(q"¶

@@ -810,7 +852,7 @@ auto endnote(O)(

¶", obj.is_a, - obj.text + _txt ); } else { o = format(q"¶
@@ -823,7 +865,7 @@ auto endnote(O)( obj.obj_cite_number, obj.is_a, obj.obj_cite_number, - obj.text + _txt ); } return o; -- cgit v1.2.3