From e9e17be24eba558c30fcdc41ea5bb9a1da7fd4e7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 12 Mar 2024 22:39:09 -0400 Subject: mark modules as @safe: (& identify what is not) --- org/out_xmls.org | 102 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 50 deletions(-) (limited to 'org/out_xmls.org') diff --git a/org/out_xmls.org b/org/out_xmls.org index 75289a3..e9f8d79 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -23,7 +23,6 @@ 2024 #+END_SRC - * xml offspring (xhtml html epub) ** format xhtml objects :format: *** _module template_ :module: @@ -33,6 +32,7 @@ #+BEGIN_SRC d <> module doc_reform.io_out.xmls; +@safe: template outputXHTMLs() { <> mixin spineRgxOut; @@ -130,7 +130,7 @@ import #+NAME: xhtml_format_objects_div_delimit #+BEGIN_SRC d -@safe string div_delimit( +string div_delimit( string section, return ref string previous_section ) { @@ -166,7 +166,7 @@ import #+NAME: xhtml_format_objects_special_characters_text #+BEGIN_SRC d -@safe string special_characters_text(string _txt) { +string special_characters_text(string _txt) { _txt = _txt .replaceAll(rgx_xhtml.ampersand, "&") // "&" .replaceAll(rgx_xhtml.quotation, """) // """ @@ -184,7 +184,7 @@ import #+NAME: xhtml_format_objects_special_characters_date #+BEGIN_SRC d -@safe string special_characters_date(string _txt) { +string special_characters_date(string _txt) { _txt = _txt .replaceAll(regex(r"(?:-00)+"), "") .replaceAll(rgx.br_line, "
") @@ -199,7 +199,7 @@ import #+NAME: xhtml_format_objects_breaks_indents_bullets #+BEGIN_SRC d -@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); @@ -256,7 +256,7 @@ import #+NAME: xhtml_format_objects_font_face #+BEGIN_SRC d -@safe string font_face(string _txt) { +string font_face(string _txt) { _txt = _txt .replaceAll(rgx.inline_emphasis, ("$1")) .replaceAll(rgx.inline_bold, ("$1")) @@ -276,7 +276,7 @@ import #+NAME: xhtml_format_objects_xml_anchor_tags #+BEGIN_SRC d -@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) { @@ -294,7 +294,7 @@ import #+NAME: xhtml_format_objects_header_metadata #+BEGIN_SRC d -@safe string header_metadata(M)( +string header_metadata(M)( M doc_matters, ) { string _publisher="Publisher"; // TODO @@ -337,7 +337,7 @@ import #+NAME: xhtml_format_objects_site_info_button #+BEGIN_SRC d -@safe string site_info_button(M)( +string site_info_button(M)( M doc_matters, ) { string _locations; @@ -367,7 +367,7 @@ import #+NAME: xhtml_format_objects_inline_search_form #+BEGIN_SRC d -@safe string inline_search_form(M)( +string inline_search_form(M)( M doc_matters, ) { string o; @@ -434,7 +434,7 @@ import #+NAME: xhtml_format_objects_html_head #+BEGIN_SRC d -@safe string html_head(M)( +string html_head(M)( M doc_matters, string type, ) { @@ -522,7 +522,7 @@ import #+NAME: xhtml_format_objects_epub3_seg_head #+BEGIN_SRC d -@safe string epub3_seg_head(M)( +string epub3_seg_head(M)( M doc_matters, ) { string html_base = format(q"┃ @@ -596,7 +596,7 @@ import #+NAME: xhtml_format_objects_dom_close #+BEGIN_SRC d -@safe string dom_close() { +string dom_close() { string o; o = format(q"┃┃"); return o; @@ -608,7 +608,7 @@ import #+NAME: xhtml_format_objects_tail #+HEADER: :noweb yes #+BEGIN_SRC d -@safe string tail(M)(M doc_matters) { +string tail(M)(M doc_matters) { string o; o = format(q"┃
@@ -650,7 +650,7 @@ import #+NAME: xhtml_format_objects_inline_images #+BEGIN_SRC d -@safe string inline_images(O,M)( +string inline_images(O,M)( string _txt, const O obj, M doc_matters, @@ -683,7 +683,7 @@ import #+NAME: xhtml_format_objects_inline_links #+BEGIN_SRC d -@safe string inline_links(O,M)( +string inline_links(O,M)( string _txt, const O obj, M doc_matters, @@ -781,7 +781,7 @@ import #+NAME: xhtml_format_objects_inline_notes_scroll #+BEGIN_SRC d -@safe string inline_notes_scroll(O,M)( +string inline_notes_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -818,7 +818,7 @@ import #+NAME: xhtml_format_objects_inline_notes_seg #+BEGIN_SRC d -@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, @@ -889,7 +889,7 @@ import #+NAME: xhtml_format_objects_inline_markup_scroll #+BEGIN_SRC d -@safe string inline_markup_scroll(O,M)( +string inline_markup_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -911,7 +911,7 @@ import #+NAME: xhtml_format_objects_inline_markup_seg #+BEGIN_SRC d -@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, @@ -938,7 +938,7 @@ import #+NAME: xhtml_format_objects_lev4_heading_subtoc #+BEGIN_SRC d -@safe string lev4_heading_subtoc(O,M)( +string lev4_heading_subtoc(O,M)( const O obj, M doc_matters, ) { @@ -971,7 +971,7 @@ import #+NAME: xhtml_format_objects_nav_pre_next_svg #+BEGIN_SRC d -@safe auto nav_pre_next_svg(O,M)( +auto nav_pre_next_svg(O,M)( const O obj, M doc_matters, ) { @@ -1048,7 +1048,7 @@ import #+NAME: xhtml_format_objects_heading #+BEGIN_SRC d -@safe string heading(O,M)( +string heading(O,M)( string _txt, const O obj, M doc_matters, @@ -1142,7 +1142,7 @@ import #+NAME: xhtml_format_objects_heading_scroll #+BEGIN_SRC d -@safe string heading_scroll(O,M)( +string heading_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1158,7 +1158,7 @@ import #+NAME: xhtml_format_objects_heading_seg #+BEGIN_SRC d -@safe Tuple!(string, string[]) heading_seg(O,M)( +Tuple!(string, string[]) heading_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1182,7 +1182,7 @@ import #+NAME: xhtml_format_objects_para #+BEGIN_SRC d -@safe string para(O,M)( +string para(O,M)( string _txt, const O obj, M doc_matters, @@ -1238,7 +1238,7 @@ import #+NAME: xhtml_format_objects_para_scroll #+BEGIN_SRC d -@safe string para_scroll(O,M)( +string para_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1257,7 +1257,7 @@ import #+NAME: xhtml_format_objects_para_seg #+BEGIN_SRC d -@safe Tuple!(string, string[]) para_seg(O,M)( +Tuple!(string, string[]) para_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1281,7 +1281,7 @@ import #+NAME: xhtml_format_objects_quote #+BEGIN_SRC d -@safe string quote(O,M)( +string quote(O,M)( string _txt, const O obj, M doc_matters, @@ -1323,7 +1323,7 @@ import #+NAME: xhtml_format_objects_quote_scroll #+BEGIN_SRC d -@safe string quote_scroll(O,M)( +string quote_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1339,7 +1339,7 @@ import #+NAME: xhtml_format_objects_quote_seg #+BEGIN_SRC d -@safe Tuple!(string, string[]) quote_seg(O,M)( +Tuple!(string, string[]) quote_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1363,7 +1363,7 @@ import #+NAME: xhtml_format_objects_group #+BEGIN_SRC d -@safe string group(O,M)( +string group(O,M)( string _txt, const O obj, M doc_matters, @@ -1407,7 +1407,7 @@ import #+NAME: xhtml_format_objects_group_scroll #+BEGIN_SRC d -@safe string group_scroll(O,M)( +string group_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1424,7 +1424,7 @@ import #+NAME: xhtml_format_objects_group_seg #+BEGIN_SRC d -@safe Tuple!(string, string[]) group_seg(O,M)( +Tuple!(string, string[]) group_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1448,7 +1448,7 @@ import #+NAME: xhtml_format_objects_block #+BEGIN_SRC d -@safe string block(O,M)( +string block(O,M)( string _txt, const O obj, M doc_matters, @@ -1488,7 +1488,7 @@ import #+NAME: xhtml_format_objects_block_scroll #+BEGIN_SRC d -@safe string block_scroll(O,M)( +string block_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1505,7 +1505,7 @@ import #+NAME: xhtml_format_objects_block_seg #+BEGIN_SRC d -@safe Tuple!(string, string[]) block_seg(O,M)( +Tuple!(string, string[]) block_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1529,7 +1529,7 @@ import #+NAME: xhtml_format_objects_verse #+BEGIN_SRC d -@safe string verse(O,M)( +string verse(O,M)( string _txt, const O obj, M doc_matters, @@ -1567,7 +1567,7 @@ import #+NAME: xhtml_format_objects_verse_scroll #+BEGIN_SRC d -@safe string verse_scroll(O,M)( +string verse_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -1584,7 +1584,7 @@ import #+NAME: xhtml_format_objects_verse_seg #+BEGIN_SRC d -@safe Tuple!(string, string[]) verse_seg(O,M)( +Tuple!(string, string[]) verse_seg(O,M)( string _txt, const O obj, M doc_matters, @@ -1607,7 +1607,7 @@ import #+NAME: xhtml_format_objects_code #+BEGIN_SRC d -@safe string code(O,M)( +string code(O,M)( string _txt, const O obj, M doc_matters, @@ -1679,7 +1679,7 @@ align="left|right|center" #+NAME: xhtml_format_objects_tablarize #+BEGIN_SRC d -@safe Tuple!(string, string) tablarize(O)( +Tuple!(string, string) tablarize(O)( string _txt, const O obj, ) { @@ -1718,7 +1718,7 @@ align="left|right|center" #+NAME: xhtml_format_objects_table #+BEGIN_SRC d -@safe string table(O,M)( +string table(O,M)( string _txt, const O obj, M doc_matters, @@ -1762,10 +1762,11 @@ align="left|right|center" #+BEGIN_SRC d <> module doc_reform.io_out.html; +@safe: template outputHTML() { <> mixin outputXHTMLs; - @safe void scroll(D,M)( + void scroll(D,M)( const D doc_abstraction, M doc_matters, ) { @@ -1777,7 +1778,7 @@ template outputHTML() { <> } <> - @safe void seg(D,M)( + void seg(D,M)( const D doc_abstraction, M doc_matters, ) { @@ -2382,7 +2383,7 @@ seg_write_output(doc_html, doc_html_endnotes, doc_matters); #+NAME: output_html_css #+BEGIN_SRC d -@safe void css(M)(M doc_matters) { +void css(M)(M doc_matters) { auto css = spineCss(doc_matters); auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); try { @@ -2480,6 +2481,7 @@ seg_write_output(doc_html, doc_html_endnotes, doc_matters); #+BEGIN_SRC d <> module doc_reform.io_out.epub3; +@safe: template outputEPub3() { <> mixin InternalMarkup; @@ -2514,7 +2516,7 @@ template outputEPub3() { #+NAME: output_epub3_fixed_mimetypes #+BEGIN_SRC d -@safe string epub3_mimetypes() { +string epub3_mimetypes() { string o; o = format(q"┃application/epub+zip┃") ~ "\n"; return o; @@ -2527,7 +2529,7 @@ template outputEPub3() { #+NAME: output_epub3_fixed_container_xml #+BEGIN_SRC d -@safe string epub3_container_xml() { +string epub3_container_xml() { string o; o = format(q"┃┃") ~ "\n"; o ~= format(q"┃ #+NAME: output_epub3_constructs_oebps_content #+HEADER: :noweb yes #+BEGIN_SRC d -@safe 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) { 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! @@ -2656,7 +2658,7 @@ xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> #+NAME: output_epub3_constructs_oebps_toc_nav_xhtml #+BEGIN_SRC d -@safe 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) { enum DomTags { none, open, close, close_and_open, open_still, } auto markup = InlineMarkup(); static auto rgx = RgxO(); -- cgit v1.2.3