diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-12-05 11:41:09 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-01-13 16:06:43 -0500 |
commit | 9a91485c10e059dee1374e152e4b068cd9d3866c (patch) | |
tree | 4eaa00d4e7e8fb5d576142d364657d5b67d3b766 /src/doc_reform/io_out/xmls.d | |
parent | yaml config, provide default if not read (diff) |
0.9.2 @safe & @trusted first pass
Diffstat (limited to 'src/doc_reform/io_out/xmls.d')
-rw-r--r-- | src/doc_reform/io_out/xmls.d | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index a88dced..74ebf82 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -18,7 +18,7 @@ template outputXHTMLs() { string div_delimit( string part, return ref string previous_part - ){ + ) @safe { string delimit = ""; string delimit_ = ""; if (part != previous_part) { @@ -45,7 +45,7 @@ template outputXHTMLs() { // you also need to close the last div, introduce a footer? return delimit; } - string special_characters_text(string _txt){ + string special_characters_text(string _txt) @safe { _txt = _txt .replaceAll(rgx.xhtml_ampersand, "&") .replaceAll(rgx.xhtml_quotation, """) @@ -56,7 +56,7 @@ template outputXHTMLs() { } string special_characters(O)( const O obj, - ){ + ) @safe { string _txt = special_characters_text(obj.text); if (!(obj.metainfo.is_a == "code")) { _txt = (_txt) @@ -64,7 +64,7 @@ template outputXHTMLs() { } return _txt; } - string font_face(string _txt){ + string font_face(string _txt) @safe { _txt = _txt .replaceAll(rgx.inline_emphasis, ("<em>$1</em>")) .replaceAll(rgx.inline_bold, ("<b>$1</b>")) @@ -78,7 +78,7 @@ template outputXHTMLs() { .replaceAll(rgx.inline_cite, ("<cite>$1</cite>")); return _txt; } - string _xhtml_anchor_tags(O)(O obj) { + string _xhtml_anchor_tags(O)(O obj) @safe { const(string[]) anchor_tags = obj.tags.anchor_tags; string tags=""; if (anchor_tags.length > 0) { @@ -92,7 +92,7 @@ template outputXHTMLs() { } string header_metadata(M)( M doc_matters, - ) { + ) @safe { string _publisher="Publisher"; // TODO string o; o = format(q"┃<!-- spine header metadata --> @@ -129,7 +129,7 @@ template outputXHTMLs() { } string site_info_button(M)( M doc_matters, - ) { + ) @safe { string _locations; if (doc_matters.conf_make_meta.make.home_button_text.length > 0) { _locations = (doc_matters.conf_make_meta.make.home_button_text) @@ -153,7 +153,7 @@ template outputXHTMLs() { } string inline_search_form(M)( M doc_matters, - ) { + ) @safe { string _action="http://www.sisudoc.org/cgi-bin/search.cgi"; string _db="spine.7a.manual"; string o; @@ -189,7 +189,7 @@ template outputXHTMLs() { string html_head(M)( M doc_matters, string type, - ) { + ) @safe { string _manifest = ""; if (doc_matters.opt.action.workon) { _manifest = format(q"┃ @@ -243,7 +243,7 @@ template outputXHTMLs() { } string epub3_seg_head(M)( M doc_matters, - ) { + ) @safe { string html_base = format(q"┃<!DOCTYPE html> <html>┃", ); @@ -309,7 +309,7 @@ template outputXHTMLs() { ); return o; } - string tail() { + string tail() @safe { string o; o = format(q"┃ <a name="bottom" id="bottom"></a> @@ -324,7 +324,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "seg", - ) { + ) @safe { string _img_pth; if (_xml_type == "epub") { _img_pth = "image/"; @@ -351,7 +351,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "seg", - ) { + ) @safe { string seg_lvs; if (obj.has.inline_links) { if (obj.metainfo.is_a != "code") { @@ -440,7 +440,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { if (obj.has.inline_notes_reg) { _txt = font_face(_txt); _txt = _txt.replaceAll( @@ -471,7 +471,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { string[] _endnotes; if (obj.has.inline_notes_star) { _txt = font_face(_txt); @@ -536,7 +536,7 @@ template outputXHTMLs() { const O obj, M doc_matters, string _suffix = ".html", - ) { + ) @safe { if (obj.metainfo.dummy_heading && (obj.metainfo.is_a == "toc" || obj.metainfo.is_a == "heading")) { _txt = ""; @@ -553,7 +553,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "seg", - ) { + ) @safe { if (obj.metainfo.dummy_heading && ((_xml_type == "epub" && (obj.metainfo.is_a == "toc" || obj.metainfo.is_a == "heading")) @@ -570,7 +570,7 @@ template outputXHTMLs() { string lev4_heading_subtoc(O,M)( const O obj, M doc_matters, - ) { + ) @safe { char[] lev4_subtoc; lev4_subtoc ~= " <div class=\"nav\">\n"; foreach (subtoc; obj.tags.lev4_subtoc) { @@ -597,7 +597,7 @@ template outputXHTMLs() { auto nav_pre_next_svg(O,M)( const O obj, M doc_matters, - ) { + ) @safe { string prev, next, toc; string harvest_link = (doc_matters.opt.action.harvest_link) ? format(q"┃<p class="tiny">[<a href="../../../topics.html"> T </a>|<a href="../../../authors.html"> A </a>]</p>┃") @@ -684,7 +684,7 @@ template outputXHTMLs() { const O obj, M doc_matters, string _xml_type = "html", - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "para"); @@ -749,7 +749,7 @@ template outputXHTMLs() { const O obj, M doc_matters, string _suffix = ".html", - ) { + ) @safe { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = heading(_txt, obj, doc_matters); return o; @@ -760,7 +760,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0]; string[] _endnotes = t[1]; @@ -775,7 +775,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "para"); @@ -822,7 +822,7 @@ template outputXHTMLs() { const O obj, M doc_matters, string _suffix = ".html", - ) { + ) @safe { if (obj.metainfo.is_a == "toc" && _txt.match(rgx.inline_link_toc_to_backmatter)) { _txt = _txt.replaceAll(rgx.inline_link_toc_to_backmatter, "┤#section_$1├"); } @@ -836,7 +836,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; @@ -851,7 +851,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "block"); @@ -888,7 +888,7 @@ template outputXHTMLs() { const O obj, M doc_matters, string _suffix = ".html", - ) { + ) @safe { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = quote(_txt, obj, doc_matters); return o; @@ -899,7 +899,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; @@ -914,7 +914,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "block"); @@ -952,7 +952,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = group(_txt, obj, doc_matters); return o; @@ -963,7 +963,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; @@ -978,7 +978,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "block"); @@ -1012,7 +1012,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = block(_txt, obj, doc_matters); return o; @@ -1023,7 +1023,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; @@ -1038,7 +1038,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "block"); @@ -1072,7 +1072,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = verse(_txt, obj, doc_matters); return o; @@ -1083,7 +1083,7 @@ template outputXHTMLs() { M doc_matters, string _suffix = ".html", string _xml_type = "html", - ) { + ) @safe { auto t = inline_markup_seg(_txt, obj, doc_matters, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; @@ -1097,7 +1097,7 @@ template outputXHTMLs() { auto tablarize(O)( string _txt, const O obj, - ) { + ) @safe { string[] _table_rows = (_txt).split(rgx.table_delimiter_row); string[] _table_cols; string _table; @@ -1131,7 +1131,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); @@ -1165,7 +1165,7 @@ template outputXHTMLs() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); |