From 9a91485c10e059dee1374e152e4b068cd9d3866c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 5 Dec 2019 11:41:09 -0500 Subject: 0.9.2 @safe & @trusted first pass --- org/out_xmls.org | 106 +++++++++++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'org/out_xmls.org') diff --git a/org/out_xmls.org b/org/out_xmls.org index e875330..52a0ac1 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -61,7 +61,7 @@ import string div_delimit( string part, return ref string previous_part -){ +) @safe { string delimit = ""; string delimit_ = ""; if (part != previous_part) { @@ -94,7 +94,7 @@ string div_delimit( #+name: xhtml_format_objects #+BEGIN_SRC d -string special_characters_text(string _txt){ +string special_characters_text(string _txt) @safe { _txt = _txt .replaceAll(rgx.xhtml_ampersand, "&") .replaceAll(rgx.xhtml_quotation, """) @@ -111,7 +111,7 @@ string special_characters_text(string _txt){ #+BEGIN_SRC d string special_characters(O)( const O obj, -){ +) @safe { string _txt = special_characters_text(obj.text); if (!(obj.metainfo.is_a == "code")) { _txt = (_txt) @@ -125,7 +125,7 @@ string special_characters(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -string font_face(string _txt){ +string font_face(string _txt) @safe { _txt = _txt .replaceAll(rgx.inline_emphasis, ("$1")) .replaceAll(rgx.inline_bold, ("$1")) @@ -145,7 +145,7 @@ string font_face(string _txt){ #+name: xhtml_format_objects #+BEGIN_SRC d -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) { @@ -166,7 +166,7 @@ string _xhtml_anchor_tags(O)(O obj) { #+BEGIN_SRC d string header_metadata(M)( M doc_matters, -) { +) @safe { string _publisher="Publisher"; // TODO string o; o = format(q"┃ @@ -209,7 +209,7 @@ string header_metadata(M)( #+BEGIN_SRC d 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) @@ -239,7 +239,7 @@ string site_info_button(M)( #+BEGIN_SRC d 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; @@ -281,7 +281,7 @@ string inline_search_form(M)( string html_head(M)( M doc_matters, string type, -) { +) @safe { string _manifest = ""; if (doc_matters.opt.action.workon) { _manifest = format(q"┃ @@ -341,7 +341,7 @@ if (doc_matters.opt.action.workon) { #+BEGIN_SRC d string epub3_seg_head(M)( M doc_matters, -) { +) @safe { string html_base = format(q"┃ ┃", ); @@ -413,7 +413,7 @@ string epub3_seg_head(M)( #+name: xhtml_format_objects #+BEGIN_SRC d -string tail() { +string tail() @safe { string o; o = format(q"┃ @@ -435,7 +435,7 @@ string inline_images(O,M)( M doc_matters, string _suffix = ".html", string _xml_type = "seg", -) { +) @safe { string _img_pth; if (_xml_type == "epub") { _img_pth = "image/"; @@ -469,7 +469,7 @@ string inline_links(O,M)( 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") { @@ -565,7 +565,7 @@ string inline_notes_scroll(O,M)( string _txt, const O obj, M doc_matters, -) { +) @safe { if (obj.has.inline_notes_reg) { _txt = font_face(_txt); _txt = _txt.replaceAll( @@ -602,7 +602,7 @@ auto inline_notes_seg(O,M)( string _txt, const O obj, M doc_matters, -) { +) @safe { string[] _endnotes; if (obj.has.inline_notes_star) { _txt = font_face(_txt); @@ -674,7 +674,7 @@ string inline_markup_scroll(O,M)( 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 = ""; @@ -697,7 +697,7 @@ auto inline_markup_seg(O,M)( 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")) @@ -721,7 +721,7 @@ auto inline_markup_seg(O,M)( string lev4_heading_subtoc(O,M)( const O obj, M doc_matters, -) { +) @safe { char[] lev4_subtoc; lev4_subtoc ~= "
\n"; foreach (subtoc; obj.tags.lev4_subtoc) { @@ -754,7 +754,7 @@ string lev4_heading_subtoc(O,M)( 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"┃

[ T | A ]

┃") @@ -848,7 +848,7 @@ string heading(O,M)( 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"); @@ -919,7 +919,7 @@ string heading_scroll(O,M)( 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; @@ -936,7 +936,7 @@ auto heading_seg(O,M)( 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]; @@ -958,7 +958,7 @@ string para(O,M)( 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"); @@ -1011,7 +1011,7 @@ string para_scroll(O,M)( 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├"); } @@ -1031,7 +1031,7 @@ auto para_seg(O,M)( 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]; @@ -1053,7 +1053,7 @@ string quote(O,M)( 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"); @@ -1096,7 +1096,7 @@ string quote_scroll(O,M)( 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; @@ -1113,7 +1113,7 @@ auto quote_seg(O,M)( 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]; @@ -1135,7 +1135,7 @@ string group(O,M)( 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"); @@ -1179,7 +1179,7 @@ string group_scroll(O,M)( 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; @@ -1196,7 +1196,7 @@ auto group_seg(O,M)( 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]; @@ -1218,7 +1218,7 @@ string block(O,M)( 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"); @@ -1258,7 +1258,7 @@ string block_scroll(O,M)( 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; @@ -1275,7 +1275,7 @@ auto block_seg(O,M)( 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]; @@ -1297,7 +1297,7 @@ string verse(O,M)( 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"); @@ -1337,7 +1337,7 @@ string verse_scroll(O,M)( 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; @@ -1354,7 +1354,7 @@ auto verse_seg(O,M)( 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]; @@ -1375,7 +1375,7 @@ string code(O,M)( 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"); @@ -1446,7 +1446,7 @@ align="left|right|center" auto tablarize(O)( string _txt, const O obj, -) { +) @safe { string[] _table_rows = (_txt).split(rgx.table_delimiter_row); string[] _table_cols; string _table; @@ -1486,7 +1486,7 @@ string table(O,M)( 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"); @@ -1541,7 +1541,7 @@ template outputHTML() { void scroll(D,M)( const D doc_abstraction, M doc_matters, -) { +) @safe { mixin spineOutputRgxInit; auto xhtml_format = outputXHTMLs(); auto rgx = Rgx(); @@ -1747,7 +1747,7 @@ void scroll(D,M)( void scroll_write_output(D,M)( D doc, M doc_matters, -) { +) @trusted { debug(asserts) { static assert(is(typeof(doc) == string[])); } @@ -1777,7 +1777,7 @@ void scroll_write_output(D,M)( void seg(D,M)( const D doc_abstraction, M doc_matters, -) { +) @safe { mixin spineOutputRgxInit; auto rgx = Rgx(); auto xhtml_format = outputXHTMLs(); @@ -2079,7 +2079,7 @@ void seg_write_output(D,E,M)( D doc_html, E doc_html_endnotes, M doc_matters, -) { +) @trusted { // @system? debug(asserts) { static assert(is(typeof(doc_html) == string[][string])); } @@ -2115,7 +2115,7 @@ void seg_write_output(D,E,M)( #+name: output_html_css #+BEGIN_SRC d -void css(M)(M doc_matters) { +void css(M)(M doc_matters) @safe { auto css = spineCss(doc_matters); auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); try { @@ -2138,7 +2138,7 @@ void css(M)(M doc_matters) { #+BEGIN_SRC d void images_cp(M)( M doc_matters, -) { +) @trusted { // @system { /+ (copy html images) +/ auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); @@ -2205,7 +2205,7 @@ template outputEPub3() { #+name: output_epub3_fixed #+BEGIN_SRC d -string epub3_mimetypes() { +string epub3_mimetypes() @safe { string o; o = format(q"┃application/epub+zip┃") ~ "\n"; return o; @@ -2218,7 +2218,7 @@ string epub3_mimetypes() { #+name: output_epub3_fixed #+BEGIN_SRC d -string epub3_container_xml() { +string epub3_container_xml() @safe { string o; o = format(q"┃┃") ~ "\n"; o ~= format(q"┃ #+name: output_epub3_constructs #+BEGIN_SRC d -string epub3_oebps_content(D,M,P)(D doc_abstraction, M doc_matters, P parts) { +string epub3_oebps_content(D,M,P)(D doc_abstraction, M doc_matters, P parts) @safe { auto xhtml_format = outputXHTMLs(); auto pth_epub3 = spinePathsEPUB!()(doc_matters.output_path, doc_matters.src.language); string _uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO sort uuid in doc_matters! @@ -2346,7 +2346,7 @@ string epub3_oebps_content(D,M,P)(D doc_abstraction, M doc_matters, P parts) { #+name: output_epub3_constructs #+BEGIN_SRC d -string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) { +string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) @safe { enum DomTags { none, open, close, close_and_open, open_still, } auto markup = InlineMarkup(); auto rgx = Rgx(); @@ -2434,7 +2434,7 @@ string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) { #+name: output_epub3_constructs #+BEGIN_SRC d -string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) { +string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) @safe { int counter = 0; string _uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO shared elsewhere auto markup = InlineMarkup(); @@ -2533,7 +2533,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) { void outputEPub3(D,I)( const D doc_abstraction, I doc_matters, -) { +) { // @trusted mixin spineOutputRgxInit; auto xhtml_format = outputXHTMLs(); auto rgx = Rgx(); @@ -2890,7 +2890,7 @@ void outputEPub3(D,I)( void epub3_write_output_files(W,M)( W epub_write, M doc_matters, -) { +) { // @trusted debug(asserts) { static assert(is(typeof(epub_write.doc_epub3) == string[][string])); static assert(is(typeof(epub_write.mimetypes) == string)); -- cgit v1.2.3