diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2024-03-12 22:39:09 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2024-03-12 22:56:34 -0400 |
commit | e9e17be24eba558c30fcdc41ea5bb9a1da7fd4e7 (patch) | |
tree | 1ed3c4b528b0a8e54d0eb9babc391e562578c7b4 /src/doc_reform/io_out/xmls.d | |
parent | nix flake & env upkeep (diff) |
mark modules as @safe: (& identify what is not)
Diffstat (limited to 'src/doc_reform/io_out/xmls.d')
-rw-r--r-- | src/doc_reform/io_out/xmls.d | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 5a8730e..ca7b9ea 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.xmls; +@safe: template outputXHTMLs() { import std.file, @@ -67,7 +68,7 @@ template outputXHTMLs() { struct outputXHTMLs { static auto rgx = RgxO(); static auto rgx_xhtml = RgxXHTML(); - @safe string div_delimit( + string div_delimit( string section, return ref string previous_section ) { @@ -97,7 +98,7 @@ template outputXHTMLs() { // you also need to close the last div, introduce a footer? return delimit; } - @safe string special_characters_text(string _txt) { + string special_characters_text(string _txt) { _txt = _txt .replaceAll(rgx_xhtml.ampersand, "&") // "&" .replaceAll(rgx_xhtml.quotation, """) // """ @@ -109,7 +110,7 @@ template outputXHTMLs() { .replaceAll(rgx.nbsp_char, " "); return _txt; } - @safe string special_characters_date(string _txt) { + string special_characters_date(string _txt) { _txt = _txt .replaceAll(regex(r"(?:-00)+"), "") .replaceAll(rgx.br_line, "<br />") @@ -118,7 +119,7 @@ template outputXHTMLs() { .replaceAll(rgx.nbsp_char, " "); return _txt; } - @safe string special_characters_breaks_indents_bullets(O)( + string special_characters_breaks_indents_bullets(O)( const O obj, ) { string _txt = special_characters_text(obj.text); @@ -169,7 +170,7 @@ template outputXHTMLs() { } return _txt; } - @safe string font_face(string _txt) { + string font_face(string _txt) { _txt = _txt .replaceAll(rgx.inline_emphasis, ("<em>$1</em>")) .replaceAll(rgx.inline_bold, ("<b>$1</b>")) @@ -183,7 +184,7 @@ template outputXHTMLs() { .replaceAll(rgx.inline_cite, ("<cite>$1</cite>")); return _txt; } - @safe string _xhtml_anchor_tags(O)(O obj) { + string _xhtml_anchor_tags(O)(O obj) { string tags=""; if (obj.tags.anchor_tags.length > 0) { foreach (tag; obj.tags.anchor_tags) { @@ -194,7 +195,7 @@ template outputXHTMLs() { } return tags; } - @safe string header_metadata(M)( + string header_metadata(M)( M doc_matters, ) { string _publisher="Publisher"; // TODO @@ -231,7 +232,7 @@ template outputXHTMLs() { ); return o; } - @safe string site_info_button(M)( + string site_info_button(M)( M doc_matters, ) { string _locations; @@ -255,7 +256,7 @@ template outputXHTMLs() { ); return o; } - @safe string inline_search_form(M)( + string inline_search_form(M)( M doc_matters, ) { string o; @@ -314,7 +315,7 @@ template outputXHTMLs() { } return o; } - @safe string html_head(M)( + string html_head(M)( M doc_matters, string type, ) { @@ -396,7 +397,7 @@ template outputXHTMLs() { ); return o; } - @safe string epub3_seg_head(M)( + string epub3_seg_head(M)( M doc_matters, ) { string html_base = format(q"┃<!DOCTYPE html> @@ -464,12 +465,12 @@ template outputXHTMLs() { ); return o; } -@safe string dom_close() { +string dom_close() { string o; o = format(q"┃</div>┃"); return o; } -@safe string tail(M)(M doc_matters) { +string tail(M)(M doc_matters) { string o; o = format(q"┃<hr /> <div class="rights"> @@ -504,7 +505,7 @@ template outputXHTMLs() { ); return o; } - @safe string inline_images(O,M)( + string inline_images(O,M)( string _txt, const O obj, M doc_matters, @@ -530,7 +531,7 @@ template outputXHTMLs() { } return _txt; } - @safe string inline_links(O,M)( + string inline_links(O,M)( string _txt, const O obj, M doc_matters, @@ -621,7 +622,7 @@ template outputXHTMLs() { } return _txt; } - @safe string inline_notes_scroll(O,M)( + string inline_notes_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -652,7 +653,7 @@ template outputXHTMLs() { } return _txt; } - @safe Tuple!(string, string[]) inline_notes_seg(O,M)( + Tuple!(string, string[]) inline_notes_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -716,7 +717,7 @@ template outputXHTMLs() { ); return t; } - @safe string inline_markup_scroll(O,M)( + string inline_markup_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -732,7 +733,7 @@ template outputXHTMLs() { } return _txt; } - @safe Tuple!(string, string[]) inline_markup_seg(O,M)( + Tuple!(string, string[]) inline_markup_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -752,7 +753,7 @@ template outputXHTMLs() { Tuple!(string, string[]) t = inline_notes_seg(_txt, obj, doc_matters); return t; } - @safe string lev4_heading_subtoc(O,M)( + string lev4_heading_subtoc(O,M)( const O obj, M doc_matters, ) { @@ -779,7 +780,7 @@ template outputXHTMLs() { lev4_subtoc ~= " </div>\n"; return lev4_subtoc.to!string; } - @safe auto nav_pre_next_svg(O,M)( + auto nav_pre_next_svg(O,M)( const O obj, M doc_matters, ) { @@ -849,7 +850,7 @@ template outputXHTMLs() { } return bar(); } - @safe string heading(O,M)( + string heading(O,M)( string _txt, const O obj, M doc_matters, @@ -937,7 +938,7 @@ template outputXHTMLs() { } return o; } - @safe string heading_scroll(O,M)( + string heading_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -947,7 +948,7 @@ template outputXHTMLs() { string o = heading(_txt, obj, doc_matters); return o; } - @safe Tuple!(string, string[]) heading_seg(O,M)( + Tuple!(string, string[]) heading_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -964,7 +965,7 @@ template outputXHTMLs() { ); return u; } - @safe string para(O,M)( + string para(O,M)( string _txt, const O obj, M doc_matters, @@ -1014,7 +1015,7 @@ template outputXHTMLs() { } return o; } - @safe string para_scroll(O,M)( + string para_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1027,7 +1028,7 @@ template outputXHTMLs() { string o = para(_txt, obj, doc_matters); return o; } - @safe Tuple!(string, string[]) para_seg(O,M)( + Tuple!(string, string[]) para_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1044,7 +1045,7 @@ template outputXHTMLs() { ); return u; } - @safe string quote(O,M)( + string quote(O,M)( string _txt, const O obj, M doc_matters, @@ -1080,7 +1081,7 @@ template outputXHTMLs() { } return o; } - @safe string quote_scroll(O,M)( + string quote_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1090,7 +1091,7 @@ template outputXHTMLs() { string o = quote(_txt, obj, doc_matters); return o; } - @safe Tuple!(string, string[]) quote_seg(O,M)( + Tuple!(string, string[]) quote_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1107,7 +1108,7 @@ template outputXHTMLs() { ); return u; } - @safe string group(O,M)( + string group(O,M)( string _txt, const O obj, M doc_matters, @@ -1145,7 +1146,7 @@ template outputXHTMLs() { } return o; } - @safe string group_scroll(O,M)( + string group_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1156,7 +1157,7 @@ template outputXHTMLs() { string o = group(_txt, obj, doc_matters); return o; } - @safe Tuple!(string, string[]) group_seg(O,M)( + Tuple!(string, string[]) group_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1173,7 +1174,7 @@ template outputXHTMLs() { ); return u; } - @safe string block(O,M)( + string block(O,M)( string _txt, const O obj, M doc_matters, @@ -1207,7 +1208,7 @@ template outputXHTMLs() { } return o; } - @safe string block_scroll(O,M)( + string block_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1218,7 +1219,7 @@ template outputXHTMLs() { string o = block(_txt, obj, doc_matters); return o; } - @safe Tuple!(string, string[]) block_seg(O,M)( + Tuple!(string, string[]) block_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1235,7 +1236,7 @@ template outputXHTMLs() { ); return u; } - @safe string verse(O,M)( + string verse(O,M)( string _txt, const O obj, M doc_matters, @@ -1267,7 +1268,7 @@ template outputXHTMLs() { } return o; } - @safe string verse_scroll(O,M)( + string verse_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1278,7 +1279,7 @@ template outputXHTMLs() { string o = verse(_txt, obj, doc_matters); return o; } - @safe Tuple!(string, string[]) verse_seg(O,M)( + Tuple!(string, string[]) verse_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1295,7 +1296,7 @@ template outputXHTMLs() { ); return u; } - @safe Tuple!(string, string) tablarize(O)( + Tuple!(string, string) tablarize(O)( string _txt, const O obj, ) { @@ -1328,7 +1329,7 @@ template outputXHTMLs() { ); return t; } - @safe string table(O,M)( + string table(O,M)( string _txt, const O obj, M doc_matters, @@ -1362,7 +1363,7 @@ template outputXHTMLs() { ); return o; } - @safe string code(O,M)( + string code(O,M)( string _txt, const O obj, M doc_matters, |