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) --- src/doc_reform/conf/compile_time_info.d | 1 + src/doc_reform/io_in/paths_source.d | 133 ++++++++++---------- src/doc_reform/io_in/read_config_files.d | 12 +- src/doc_reform/io_in/read_source_files.d | 21 ++-- src/doc_reform/io_out/create_zip_file.d | 3 +- src/doc_reform/io_out/defaults.d | 9 +- src/doc_reform/io_out/epub3.d | 11 +- src/doc_reform/io_out/html.d | 7 +- src/doc_reform/io_out/html_snippet.d | 3 +- src/doc_reform/io_out/hub.d | 1 + src/doc_reform/io_out/latex.d | 43 +++---- src/doc_reform/io_out/metadata.d | 7 +- src/doc_reform/io_out/odt.d | 79 ++++++------ src/doc_reform/io_out/paths_output.d | 1 + src/doc_reform/io_out/rgx.d | 1 + src/doc_reform/io_out/rgx_latex.d | 1 + src/doc_reform/io_out/rgx_xhtml.d | 1 + src/doc_reform/io_out/source_pod.d | 1 + src/doc_reform/io_out/xmls.d | 85 ++++++------- src/doc_reform/io_out/xmls_css.d | 5 +- src/doc_reform/meta/conf_make_meta_json.d | 3 +- src/doc_reform/meta/conf_make_meta_structs.d | 5 +- src/doc_reform/meta/conf_make_meta_yaml.d | 1 + src/doc_reform/meta/defaults.d | 21 ++-- src/doc_reform/meta/metadoc.d | 53 ++++---- src/doc_reform/meta/metadoc_curate.d | 3 +- src/doc_reform/meta/metadoc_curate_authors.d | 3 +- src/doc_reform/meta/metadoc_curate_topics.d | 3 +- src/doc_reform/meta/metadoc_from_src.d | 3 +- src/doc_reform/meta/metadoc_from_src_functions.d | 149 ++++++++++++----------- src/doc_reform/meta/metadoc_object_setter.d | 19 +-- src/doc_reform/meta/metadoc_show_config.d | 5 +- src/doc_reform/meta/metadoc_show_make.d | 3 +- src/doc_reform/meta/metadoc_show_metadata.d | 3 +- src/doc_reform/meta/metadoc_show_summary.d | 3 +- src/doc_reform/meta/rgx.d | 1 + src/doc_reform/meta/rgx_files.d | 1 + src/doc_reform/meta/rgx_yaml_tags.d | 1 + src/doc_reform/share/defaults.d | 3 +- src/doc_reform/spine.d | 13 +- 40 files changed, 380 insertions(+), 341 deletions(-) (limited to 'src/doc_reform') diff --git a/src/doc_reform/conf/compile_time_info.d b/src/doc_reform/conf/compile_time_info.d index 481ba4a..79db3f2 100644 --- a/src/doc_reform/conf/compile_time_info.d +++ b/src/doc_reform/conf/compile_time_info.d @@ -51,6 +51,7 @@ compile_time_info +/ module doc_reform.conf.compile_time_info; +@safe: template CompileTimeInfo() { version(Windows) { pragma(msg, "[ Windows compilation ]"); diff --git a/src/doc_reform/io_in/paths_source.d b/src/doc_reform/io_in/paths_source.d index 2bb5c4d..8d12f98 100644 --- a/src/doc_reform/io_in/paths_source.d +++ b/src/doc_reform/io_in/paths_source.d @@ -53,6 +53,7 @@ meta_config_files.d +/ module doc_reform.io_in.paths_source; +@safe: import std.array, std.file, @@ -66,7 +67,7 @@ import template PodManifest() { mixin spineRgxFiles; static auto rgx_files = RgxFiles(); - @safe auto PodManifest(O)( + auto PodManifest(O)( O _opt_action, string _pth="" ) { @@ -74,7 +75,7 @@ template PodManifest() { string pod_manifest_filename() { return "pod.manifest"; } - @safe string pod_manifest_path() { + string pod_manifest_path() { string _manifest_path; if ((isValidPath(_pth) && exists(_pth) != 0 && _pth.isDir) && (exists(_pth.chainPath(pod_manifest_filename).array) != 0 @@ -96,10 +97,10 @@ template PodManifest() { } return _manifest_path; } - @safe string pods_collection_root_path() { + string pods_collection_root_path() { return (pod_manifest_path.length > 0) ? ((chainPath(pod_manifest_path, "..")).asNormalizedPath).array.to!string : ""; } - @safe string pod_manifest_file_with_path() { + string pod_manifest_file_with_path() { string _k; if (exists(pod_manifest_path.chainPath(pod_manifest_filename).array)!=0) { _k = pod_manifest_path.chainPath(pod_manifest_filename).array; @@ -121,14 +122,14 @@ template PathMatters() { mixin spineRgxFiles; static auto rgx_files = RgxFiles(); static auto mkup = InlineMarkup(); - @safe auto PathMatters(O,E)( + auto PathMatters(O,E)( O _opt_action, E _env, string _pth, string _fns = "", char[][] _manifest_fn_list = [[]], ) { - @safe auto _manifested = PodManifest!()(_opt_action, _pth); + auto _manifested = PodManifest!()(_opt_action, _pth); struct ManifestMatters_ { auto env() { auto _env = _env; @@ -142,7 +143,7 @@ template PathMatters() { } return Env_(); } - @safe auto opt() { + auto opt() { struct Opt_ { auto action() { return _opt_action; @@ -150,45 +151,45 @@ template PathMatters() { } return Opt_(); } - @safe bool src_is_pod() { + bool src_is_pod() { return (_manifested.pod_manifest_path.length > 0) ? true : false; } - @safe auto pod() { + auto pod() { struct Pod_ { - @safe bool src_is_pod() { + bool src_is_pod() { return (_manifested.pod_manifest_path.length > 0) ? true : false; } - @safe string collection_root() { + string collection_root() { return _manifested.pods_collection_root_path; } - @safe string manifest_filename() { + string manifest_filename() { return _manifested.pod_manifest_filename; } - @safe string manifest_path() { + string manifest_path() { return _manifested.pod_manifest_path; } - @safe string pod_name_with_path() { + string pod_name_with_path() { return _manifested.pod_manifest_path.baseName; } - @safe string manifest_file_with_path() { + string manifest_file_with_path() { return _manifested.pod_manifest_file_with_path; } - @safe string[] config_dr_document_make_dirs() { + string[] config_dr_document_make_dirs() { string[] _config_dirs; return _config_dirs; } - @safe string[] config_local_site_dirs() { + string[] config_local_site_dirs() { string[] _config_dirs; return _config_dirs; } - @safe string[] image_dirs() { + string[] image_dirs() { string[] _image_dirs; return _image_dirs; } - @safe auto manifest_list_of_filenames() { + auto manifest_list_of_filenames() { return _manifest_fn_list; } - @safe string[] manifest_list_of_languages() { + string[] manifest_list_of_languages() { string[] _lngs; foreach (filename_; manifest_list_of_filenames) { string _k = "en"; @@ -202,43 +203,43 @@ template PathMatters() { } return Pod_(); } - @safe auto src() { + auto src() { string _fns = _fns; // required here by dmd & not by ldc (for D:2078) auto _opt_action = _opt_action; auto _env = _env; struct SRC_ { - @safe bool is_pod() { + bool is_pod() { return (_manifested.pod_manifest_path.length > 0) ? true : false; } - @safe string path_and_fn() { + string path_and_fn() { return _fns; } - @safe string pod_name_with_path() { + string pod_name_with_path() { return (is_pod) ? _manifested.pod_manifest_path : ""; } - @safe string pods_collection_root_path() { + string pods_collection_root_path() { return (is_pod) ? _manifested.pods_collection_root_path : ""; } - @safe string pod_name() { + string pod_name() { return pod_name_with_path.baseName; } - @safe string filename() { + string filename() { return path_and_fn.baseName; } - @safe string filename_base() { + string filename_base() { return filename.stripExtension; } - @safe string filename_extension() { + string filename_extension() { return filename.match(rgx_files.src_pth_sst_or_ssm).captures["extension"]; } - @safe string lng() { + string lng() { string _k; if (auto m = path_and_fn.match(rgx_files.language_code_and_filename)) { _k = m.captures[1]; } else {_k = "en"; } return _k; } - @safe string doc_uid() { + string doc_uid() { string _uid; if (is_pod && !(pod_name_with_path.empty)) { if (pod_name_with_path.baseName == filename_base) { @@ -251,7 +252,7 @@ template PathMatters() { } return _uid; } - @safe string doc_uid_out() { + string doc_uid_out() { string _uid; if (is_pod && !(pod_name_with_path.empty)) { if (pod_name_with_path.baseName == filename_base) { @@ -264,7 +265,7 @@ template PathMatters() { } return _uid; } - @safe string docname_composite_unique_per_src_doc() { + string docname_composite_unique_per_src_doc() { string _fn; if (pod_name_with_path.baseName == filename_base) { _fn = filename_base ~ mkup.uid_sep ~ filename_extension ~ mkup.uid_sep ~ lng; @@ -275,7 +276,7 @@ template PathMatters() { } return _fn; } - @safe string docname_composite_unique_per_src_pod() { + string docname_composite_unique_per_src_pod() { /+ z pod name if any + src filename (without lng code) filename ~ mkup.uid_sep ~ lng @@ -294,19 +295,19 @@ template PathMatters() { } return _fn; } - @safe string language() { + string language() { return lng(); } - @safe string file_with_absolute_path() { + string file_with_absolute_path() { return _env["pwd"].chainPath(path_and_fn).array; } - @safe string absolute_path_to_src() { + string absolute_path_to_src() { return (_env["pwd"].chainPath(path_and_fn)).dirName.array; } - @safe string path_to_doc_root_path_to_lang_and_filename() { + string path_to_doc_root_path_to_lang_and_filename() { return _env["pwd"].chainPath(path_and_fn).array; } - @safe string base_dir() { + string base_dir() { string _dir; if ( auto m = (absolute_path_to_src) @@ -324,7 +325,7 @@ template PathMatters() { } return _dir; } - @safe string base_parent_dir_path() { + string base_parent_dir_path() { string _dir; if ( auto m = (absolute_path_to_src) @@ -336,7 +337,7 @@ template PathMatters() { } return _dir; } - @safe string base_dir_path() { + string base_dir_path() { string _dir; if ( auto m = (absolute_path_to_src) @@ -356,11 +357,11 @@ template PathMatters() { } return _dir; } - @safe string media_dir_path() { + string media_dir_path() { string _dir = ((base_dir_path.chainPath("media")).asNormalizedPath).array; return _dir; } - @safe string image_dir_path() { + string image_dir_path() { string _paths; string[] _possible_img_pths = [ "./image", "../image", "../../image" ]; string _img_pth_found = ""; @@ -384,10 +385,10 @@ template PathMatters() { } return _img_pth_found; } - @safe auto conf_dir_path() { + auto conf_dir_path() { return ((base_dir_path.chainPath("conf")).asNormalizedPath).array; } - @safe auto base_parent_dir() { + auto base_parent_dir() { string _dir; if ( auto m = (absolute_path_to_src) @@ -402,13 +403,13 @@ template PathMatters() { } return _dir; } - @safe string[] config_dirs() { + string[] config_dirs() { string[] _config_dirs; if (is_pod) { } else {} return _config_dirs; } - @safe string[] image_dirs() { + string[] image_dirs() { string[] _image_dirs; if (is_pod) { } else {} @@ -417,7 +418,7 @@ template PathMatters() { } return SRC_(); } - @safe auto output() { + auto output() { /+ - command line if output path set - config file if found and set set @@ -431,7 +432,7 @@ template PathMatters() { +/ auto _env = _env; struct Out_ { - @safe auto path() { + auto path() { auto _output_path = _env["pwd"]; if ((_opt_action.output_dir_set.length > 0) && isValidPath(_opt_action.output_dir_set) @@ -459,21 +460,21 @@ template PathMatters() { } } template configFilePaths() { - @safe auto configFilePaths(M,E)( + auto configFilePaths(M,E)( M _manifested, E _env, string _cli_config_path_set = "" ) { struct ConfFilePaths { - @safe string config_filename_document() { + string config_filename_document() { return "dr_document_make"; } - @safe string config_filename_site() { + string config_filename_site() { return "config_local_site"; } - @safe auto possible_config_path_locations() { + auto possible_config_path_locations() { struct _ConfFilePaths { - @safe string[] dr_document_make() { + string[] dr_document_make() { /+ FIX clean up conf paths ↓ +/ /+ config local site (file system only, not in pod) +/ /+ return paths +/ @@ -521,7 +522,7 @@ template configFilePaths() { +/ return _possible_config_path_locations; } - @safe string[] config_local_site() { + string[] config_local_site() { /+ FIX clean up conf paths ↓ +/ /+ config local site (file system only, not in pod) +/ string[] _possible_config_path_locations; @@ -580,15 +581,15 @@ template configFilePaths() { template spinePathsSRC() { mixin spineRgxFiles; static auto rgx_files = RgxFiles(); - @safe auto spinePathsSRC(D,Fn)( + auto spinePathsSRC(D,Fn)( D _pwd, Fn _fn_src_and_path, ) { struct drSrcPaths { - @safe auto pwd() { + auto pwd() { return _pwd; } - @safe string language() { + string language() { // use command line info as well? string _k; if (auto m = _fn_src_and_path.match(rgx_files.language_code_and_filename)) { @@ -598,28 +599,28 @@ template spinePathsSRC() { } return _k; } - @safe string doc_root() { + string doc_root() { return "dr_doc"; } - @safe auto media_root() { + auto media_root() { return ((doc_root.chainPath("media")).asNormalizedPath).array; } - @safe auto conf_root() { + auto conf_root() { return ((doc_root.chainPath("conf")).asNormalizedPath).array; } - @safe auto text_root() { + auto text_root() { return ((media_root.chainPath("text")).asNormalizedPath).array; } - @safe auto image_root() { + auto image_root() { return ((media_root.chainPath("image")).asNormalizedPath).array; } - @safe auto doc_src_fn_with_path_for_text_root_and_lng() { + auto doc_src_fn_with_path_for_text_root_and_lng() { return ((text_root.chainPath(language)).asNormalizedPath).array; } - @safe auto doc_src_fn() { + auto doc_src_fn() { return ((_fn_src_and_path.baseName).asNormalizedPath).array; } - @safe auto doc_src_with_path() { + auto doc_src_with_path() { return ((pwd.chainPath(_fn_src_and_path)).asNormalizedPath).array; } } diff --git a/src/doc_reform/io_in/read_config_files.d b/src/doc_reform/io_in/read_config_files.d index 29dce0a..ac34074 100644 --- a/src/doc_reform/io_in/read_config_files.d +++ b/src/doc_reform/io_in/read_config_files.d @@ -53,6 +53,7 @@ meta_config_files.d +/ module doc_reform.io_in.read_config_files; +@safe: import std.file, std.path; @@ -61,7 +62,6 @@ import doc_reform.io_in.paths_source, doc_reform.meta.rgx_files, doc_reform.meta.rgx; - template readConfigSite() { @system final auto readConfigSite(Cf,O,Cfg)(Cf _conf_file_details, O _opt_action, Cfg _cfg) { mixin spineRgxIn; @@ -228,13 +228,13 @@ static template readConfigDoc() { if (config_file_str.length > 0) { break; } } struct _ConfContent { - @safe string filename() { + string filename() { return conf_filename; } - @safe string content() { + string content() { return config_file_str; } - @safe string filetype() { + string filetype() { string _ft = ""; if (content.match(rgx.yaml_config)) { _ft = "yaml"; @@ -254,7 +254,7 @@ static template configReadSiteYAML() { doc_reform.io_in.paths_source, doc_reform.meta.rgx_files, doc_reform.meta.rgx; - @safe final YAMLDocument configReadSiteYAML(M,E)(M _manifested, E _env) { + final YAMLDocument configReadSiteYAML(M,E)(M _manifested, E _env) { string _configuration = configReadInSiteYAML!()(_manifested, _env); auto _conf_file_details = configFilePaths!()(_manifested, _env); string _conf_yaml_fn = _conf_file_details.config_filename_site; @@ -269,7 +269,7 @@ static template configReadDocYAML() { import doc_reform.meta, doc_reform.io_in.paths_source; - @safe final YAMLDocument configReadDocYAML(M,E)(M _manifested, E _env) { + final YAMLDocument configReadDocYAML(M,E)(M _manifested, E _env) { string _configuration = configReadInDocYAML!()(_manifested, _env); auto _conf_file_details = configFilePaths!()(_manifested, _env); string _conf_yaml_fn = _conf_file_details.config_filename_document; diff --git a/src/doc_reform/io_in/read_source_files.d b/src/doc_reform/io_in/read_source_files.d index 36de9f3..73785c0 100644 --- a/src/doc_reform/io_in/read_source_files.d +++ b/src/doc_reform/io_in/read_source_files.d @@ -53,6 +53,7 @@ - if master file scan for addional files to import/insert +/ module doc_reform.io_in.read_source_files; +@safe: template spineRawMarkupContent() { import std.file, @@ -67,7 +68,7 @@ template spineRawMarkupContent() { mixin spineRgxFiles; static auto rgx_files = RgxFiles(); string[] _images=[]; - @safe string[] _extract_images(S)(S content_block) { + string[] _extract_images(S)(S content_block) { string[] images_; string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { @@ -87,19 +88,19 @@ template spineRawMarkupContent() { string[], "insert_files", string[], "images" ); - @safe auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { + auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { auto _0_header_1_body_content_2_insert_filelist_tuple = rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src); return _0_header_1_body_content_2_insert_filelist_tuple; } struct RawMarkupContent { - @safe final sourceContent(in string fn_src) { + final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); string source_txt_str = raw.markupSourceReadIn(fn_src); return source_txt_str; } - @safe final auto sourceContentSplitIntoHeaderAndBody(O)( + final auto sourceContentSplitIntoHeaderAndBody(O)( O _opt_action, in string source_txt_str, in string fn_src="" @@ -136,7 +137,7 @@ template spineRawMarkupContent() { } struct MarkupRawUnit { import std.file; - @safe final private string readInMarkupSource(in char[] fn_src) { + final private string readInMarkupSource(in char[] fn_src) { enforce( exists(fn_src) != 0, "file not found: «" ~ @@ -177,7 +178,7 @@ template spineRawMarkupContent() { = (cast(char[]) src_text).split(rgx.newline_eol_strip_preceding); return source_line_arr; } - @safe string markupSourceReadIn(in string fn_src) { + string markupSourceReadIn(in string fn_src) { static auto rgx_files = RgxFiles(); enforce( fn_src.match(rgx_files.src_pth_sst_or_ssm), @@ -187,7 +188,7 @@ template spineRawMarkupContent() { string source_txt_str = readInMarkupSource(fn_src); return source_txt_str; } - @safe HeaderContentInsertsImages markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { + HeaderContentInsertsImages markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { string[] file_insert_list = []; string[] images_list = []; char[][] hc = header0Content1(source_txt_str); @@ -202,7 +203,7 @@ template spineRawMarkupContent() { ); return t; } - @safe final char[][] getInsertMarkupSourceContentRawLineArray( + final char[][] getInsertMarkupSourceContentRawLineArray( in char[] fn_src_insert, Regex!(char) rgx_file ) { @@ -221,7 +222,7 @@ template spineRawMarkupContent() { char[][], "insert_contents", string[], "images" ); - @safe ContentsAndImages scan_subdoc_source(O)( + ContentsAndImages scan_subdoc_source(O)( O _opt_action, char[][] markup_sourcefile_insert_content, string fn_src @@ -294,7 +295,7 @@ template spineRawMarkupContent() { ); return t; } - @safe ContentsInsertsImages scan_master_src_for_insert_files_and_import_content(O)( + ContentsInsertsImages scan_master_src_for_insert_files_and_import_content(O)( O _opt_action, char[][] sourcefile_body_content, string fn_src diff --git a/src/doc_reform/io_out/create_zip_file.d b/src/doc_reform/io_out/create_zip_file.d index b6feacf..63e243b 100644 --- a/src/doc_reform/io_out/create_zip_file.d +++ b/src/doc_reform/io_out/create_zip_file.d @@ -48,13 +48,14 @@ +/ module doc_reform.io_out.create_zip_file; +@safe: template createZipFile() { import std.file, std.outbuffer, std.string, std.zip; - @safe void createZipFile( + void createZipFile( string zip_file_name, void[] compressed_zip_data, ) { diff --git a/src/doc_reform/io_out/defaults.d b/src/doc_reform/io_out/defaults.d index 0b21d20..2a51625 100644 --- a/src/doc_reform/io_out/defaults.d +++ b/src/doc_reform/io_out/defaults.d @@ -51,6 +51,7 @@ default settings +/ module doc_reform.io_out.defaults; +@safe: template InternalMarkup() { import std.array; @@ -100,7 +101,7 @@ template InternalMarkup() { template spineLanguageCodes() { /+ language codes +/ struct Lang { - @safe static string[string][string] codes() { + static string[string][string] codes() { auto _lang_codes = [ "am": [ "c": "am", "n": "Amharic", "t": "Amharic", "xlp": "amharic" ], "bg": [ "c": "bg", "n": "Bulgarian", "t": "Български (Bəlgarski)", "xlp": "bulgarian" ], @@ -167,15 +168,15 @@ template spineLanguageCodes() { ]; return _lang_codes; } - @safe static string[] code_arr_ptr() { + static string[] code_arr_ptr() { string[] _lang_codes = ["am", "bg", "bn", "br", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hy", "ia", "is", "it", "ja", "ko", "la", "lo", "lt", "lv", "ml", "mr", "nl", "no", "nn", "oc", "pl", "pt", "pt_BR", "ro", "ru", "sa", "se", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "tr", "uk", "ur", "us", "vi", "zh", "en", "xx",]; return _lang_codes; } - @safe static string[] code_arr() { + static string[] code_arr() { string[] _lang_codes = ["am", "bg", "bn", "br", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hy", "ia", "is", "it", "ja", "ko", "la", "lo", "lt", "lv", "ml", "mr", "nl", "no", "nn", "oc", "pl", "pt", "pt_BR", "ro", "ru", "sa", "se", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "tr", "uk", "ur", "vi", "zh"]; return _lang_codes; } - @safe static auto codes_() { + static auto codes_() { return "(" ~ join(code_arr,"|") ~ ")"; } static auto codes_regex() { diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 808d9fb..cffc464 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.epub3; +@safe: template outputEPub3() { import std.file, @@ -66,7 +67,7 @@ template outputEPub3() { mixin outputXHTMLs; static auto rgx = RgxO(); static auto rgx_xhtml = RgxXHTML(); - @safe string special_characters_text(string _txt) { + string special_characters_text(string _txt) { _txt = _txt .replaceAll(rgx_xhtml.ampersand, "&") // "&" .replaceAll(rgx_xhtml.quotation, """) // """ @@ -78,12 +79,12 @@ template outputEPub3() { .replaceAll(rgx.nbsp_char, " "); return _txt; } - @safe string epub3_mimetypes() { + string epub3_mimetypes() { string o; o = format(q"┃application/epub+zip┃") ~ "\n"; return o; } - @safe string epub3_container_xml() { + string epub3_container_xml() { string o; o = format(q"┃┃") ~ "\n"; o ~= format(q"┃┃") ~ "\n\n"; return o; } - @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! @@ -182,7 +183,7 @@ template outputEPub3() { } return content; } - @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(); diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index 397cb95..e7e21c2 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.html; +@safe: template outputHTML() { import std.file, @@ -63,7 +64,7 @@ template outputHTML() { doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; mixin outputXHTMLs; - @safe void scroll(D,M)( + void scroll(D,M)( const D doc_abstraction, M doc_matters, ) { @@ -270,7 +271,7 @@ template outputHTML() { writeln(" ", pth_html.fn_scroll(doc_matters.src.filename)); } } - @safe void seg(D,M)( + void seg(D,M)( const D doc_abstraction, M doc_matters, ) { @@ -557,7 +558,7 @@ template outputHTML() { writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc")); } } - @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 { diff --git a/src/doc_reform/io_out/html_snippet.d b/src/doc_reform/io_out/html_snippet.d index 73d861e..843f541 100644 --- a/src/doc_reform/io_out/html_snippet.d +++ b/src/doc_reform/io_out/html_snippet.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.html_snippet; +@safe: template htmlSnippet() { import std.file, @@ -83,7 +84,7 @@ template htmlSnippet() { ); return html_blank_default; } - @safe string special_characters_text(string _txt) { + string special_characters_text(string _txt) { mixin spineRgxOut; mixin spineRgxXHTML; static auto rgx = RgxO(); diff --git a/src/doc_reform/io_out/hub.d b/src/doc_reform/io_out/hub.d index 16c866e..3be873e 100644 --- a/src/doc_reform/io_out/hub.d +++ b/src/doc_reform/io_out/hub.d @@ -52,6 +52,7 @@ check & generate output types requested +/ module doc_reform.io_out.hub; +@safe: template outputHub() { import doc_reform.io_out, doc_reform.io_out.metadata, diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index a47e81c..8c792ff 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.latex; +@safe: template paperLaTeX() { import std.format, @@ -58,7 +59,7 @@ template paperLaTeX() { return _mm; } struct PaperType { - @safe auto a4() { + auto a4() { struct A4 { auto portrait() { struct V { @@ -109,7 +110,7 @@ template paperLaTeX() { } return A4(); } - @safe auto a5() { + auto a5() { struct A5 { auto portrait() { struct V { @@ -160,7 +161,7 @@ template paperLaTeX() { } return A5(); } - @safe auto b4() { + auto b4() { struct B4 { auto portrait() { struct V { @@ -211,7 +212,7 @@ template paperLaTeX() { } return B4(); } - @safe auto letter() { + auto letter() { struct Letter { auto portrait() { struct V { @@ -262,7 +263,7 @@ template paperLaTeX() { } return Letter(); } - @safe auto legal() { + auto legal() { struct Legal { auto portrait() { struct V { @@ -335,7 +336,7 @@ template outputLaTeX() { mixin spineLanguageCodes; auto lang = Lang(); auto paper = paperLaTeX; - @safe string sp_char_ops()( + string sp_char_ops()( string _txt, ) { string _unescape_sp_char_esc()(string _txt) { @@ -359,7 +360,7 @@ template outputLaTeX() { _txt = replaceAll!(m => _unescape_fontface_esc(m[0]))(_txt, rgx_sc.latex_identify_inline_fontface); return _txt; } - @safe string sp_char_esc(O)( + string sp_char_esc(O)( string _txt, const O obj, ) { @@ -368,20 +369,20 @@ template outputLaTeX() { } return _txt; } - @safe string sp_char_esc_txt()( + string sp_char_esc_txt()( string _txt, ) { _txt = _txt.sp_char_ops; return _txt; } - @safe string marked_linebreaks_newlines()( + string marked_linebreaks_newlines()( string _txt, ) { _txt = _txt.split(rgx.br_linebreaks_newlines).join("\\br\n").strip; // _txt = replaceAll!(m => "\\br " ~ m[1])(_txt, rgx.br_linebreaks_newlines); return _txt; } - @safe string fontface()( + string fontface()( string _txt, ) { _txt = _txt @@ -397,7 +398,7 @@ template outputLaTeX() { .replaceAll(rgx.inline_italics, format(q"┃``%s''┃", "$1")); return _txt; } - @safe string leading_hardspaces()( + string leading_hardspaces()( string _txt, ) { string hardspaces(string _spaces) { @@ -408,7 +409,7 @@ template outputLaTeX() { _txt = replaceAll!(m => hardspaces(m[0]))(_txt, rgx.spaces_line_start); return _txt; } - @safe string nbsp_char()(string _txt) { + string nbsp_char()(string _txt) { if (_txt.match(rgx.nbsp_char)) { foreach (m; _txt.matchAll(rgx.nbsp_chars)) { int spaces_ = 0; @@ -420,7 +421,7 @@ template outputLaTeX() { } return _txt; } - @safe string spaces_to_nbsp()(string _txt) { + string spaces_to_nbsp()(string _txt) { if (_txt.match(rgx.spaces_keep)) { foreach (m; _txt.matchAll(rgx.spaces_keep)) { int spaces_ = 0; @@ -432,13 +433,13 @@ template outputLaTeX() { } return _txt; } - @safe string nbsp_char_to_space()(string _txt) { + string nbsp_char_to_space()(string _txt) { if (_txt.match(rgx.nbsp_char)) { _txt = _txt.replaceAll(rgx.nbsp_char, " "); } return _txt; } - @safe string links_and_images(O,M)( + string links_and_images(O,M)( string _txt, const O obj, M doc_matters, @@ -485,7 +486,7 @@ template outputLaTeX() { } return _txt; } - @safe string footnotes()( + string footnotes()( string _txt, ) { if (_txt.match(rgx.inline_notes_al_gen)) { @@ -500,7 +501,7 @@ template outputLaTeX() { } return _txt; } - @safe string remove_footnotes()( + string remove_footnotes()( string _txt, ) { if (_txt.match(rgx.inline_notes_al_gen)) { @@ -508,7 +509,7 @@ template outputLaTeX() { } return _txt; } - @safe string para(O)( + string para(O)( string _txt, O obj, ) { @@ -522,7 +523,7 @@ template outputLaTeX() { } return _txt; } - @safe string bookindex(O)( + string bookindex(O)( string _txt, O obj, ) { @@ -537,7 +538,7 @@ template outputLaTeX() { } return _txt; } - @safe string heading(O,M)( + string heading(O,M)( string _txt, O obj, M doc_matters, @@ -932,7 +933,7 @@ template outputLaTeX() { } return _txt; } - @safe string bullets_and_indentation(O)( + string bullets_and_indentation(O)( string _txt, O obj, ) { diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d index 029bd28..94bb9a9 100644 --- a/src/doc_reform/io_out/metadata.d +++ b/src/doc_reform/io_out/metadata.d @@ -48,9 +48,10 @@ +/ module doc_reform.io_out.metadata; +@safe: template outputMetadata() { - @safe void outputMetadata(T)( T doc_matters) { - @safe string inline_search_form(M)( + void outputMetadata(T)( T doc_matters) { + string inline_search_form(M)( M doc_matters, ) { string o; @@ -363,7 +364,7 @@ string theme_light_1 = format(q"┃ doc_matters.opt.action.css_theme_default ? theme_light_0 : theme_dark_0, doc_matters.opt.action.css_theme_default ? theme_light_1 : theme_dark_1, ) ~ "\n"; - @safe void metadata_write_output(M)(M doc_matters, string[] metadata_) { + void metadata_write_output(M)(M doc_matters, string[] metadata_) { auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); try { if (!exists(pth_html.base)) { diff --git a/src/doc_reform/io_out/odt.d b/src/doc_reform/io_out/odt.d index 15e7e8e..c17158a 100644 --- a/src/doc_reform/io_out/odt.d +++ b/src/doc_reform/io_out/odt.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.odt; +@safe: template formatODT() { import doc_reform.io_out, @@ -69,7 +70,7 @@ template formatODT() { struct formatODT { static auto rgx = RgxO(); static auto rgx_xhtml = RgxXHTML(); - @safe string _tags(O)(const O obj) { + string _tags(O)(const O obj) { string _tags = ""; if (obj.tags.anchor_tags.length > 0) { foreach (tag_; obj.tags.anchor_tags) { @@ -87,7 +88,7 @@ template formatODT() { } return _tags; } - @safe string _xhtml_anchor_tags(O)(O obj) { + string _xhtml_anchor_tags(O)(O obj) { const(string[]) anchor_tags = obj.tags.anchor_tags; string tags=""; if (anchor_tags.length > 0) { @@ -99,7 +100,7 @@ template formatODT() { } return tags; } - @safe string obj_num(O)(const O obj) { // TODO + string obj_num(O)(const O obj) { // TODO string _on; _on = (obj.metainfo.object_number.empty) ? "" @@ -109,7 +110,7 @@ template formatODT() { )); return _on; } - @safe string _footnotes()(string _txt) { + string _footnotes()(string _txt) { static auto rgx = RgxO(); static auto rgx_xhtml = RgxXHTML(); _txt = _txt.replaceAll( @@ -129,14 +130,14 @@ template formatODT() { ); return _txt; } - @safe string _bullet(O)(const O obj) { + string _bullet(O)(const O obj) { string _b = ""; if (obj.attrib.bullet) { _b = format(q"┃● ┃",); } return _b; } - @safe string _indent(O)(string _txt, const O obj) { // TODO + string _indent(O)(string _txt, const O obj) { // TODO // if (obj.attrib.indent_base > 0 || // obj.attrib.indent_hang > 0 // ) { @@ -244,7 +245,7 @@ template formatODT() { } return _txt; } - @safe string _block_type_delimiters(O)(string[] _block_lines, const O obj) { // TODO + string _block_type_delimiters(O)(string[] _block_lines, const O obj) { // TODO string _block = ""; foreach (i, _line; _block_lines) { _line = _footnotes(_line); @@ -277,7 +278,7 @@ template formatODT() { obj_num(obj)); return _block; } - @safe string _special_characters(O)(string _txt, const O obj) { + string _special_characters(O)(string _txt, const O obj) { _txt = _txt .replaceAll(rgx_xhtml.ampersand, "&") .replaceAll(rgx_xhtml.quotation, """) @@ -286,7 +287,7 @@ template formatODT() { .replaceAll(rgx.nbsp_char, " "); return _txt; } - @safe string _preserve_white_spaces(O)(string _txt, const O obj) { + string _preserve_white_spaces(O)(string _txt, const O obj) { if (obj.metainfo.is_a == "code" || obj.metainfo.is_a == "verse" || obj.metainfo.is_a == "block") { _txt = _txt .replaceAll(rgx.space, " "); @@ -307,9 +308,9 @@ template formatODT() { .replaceAll(rgx.inline_mono, format(q"┃%s┃", "$1")); return _txt; } - @safe auto _obj_num(O)(O obj) { // NOT USED YET + auto _obj_num(O)(O obj) { // NOT USED YET struct objNum { - @safe string reference() { + string reference() { return format(q"┃ @@ -318,7 +319,7 @@ template formatODT() { obj.object_number, ); } - @safe string display() { + string display() { return format(q"┃ %s%s%s ┃", @@ -330,20 +331,20 @@ template formatODT() { } return objNum(); } - @safe string _break_page()() { + string _break_page()() { return format(q"┃ ┃", ); } - @safe string _empty_line_break(O)(string _txt, const O obj) { + string _empty_line_break(O)(string _txt, const O obj) { if (obj.metainfo.is_a == "code" || obj.metainfo.is_a == "verse" || obj.metainfo.is_a == "block") { _txt = _txt .replaceAll(rgx.br_empty_line, "
"); } return _txt; } - @safe string _links(O)(string _txt, const O obj) { + string _links(O)(string _txt, const O obj) { if (obj.metainfo.is_a != "code") { if (obj.metainfo.is_a == "toc") { _txt = replaceAll!(m => @@ -383,7 +384,7 @@ template formatODT() { } return _txt; } - @safe string _images(O)(string _txt, const O obj) { + string _images(O)(string _txt, const O obj) { if (_txt.match(rgx.inline_image)) { _txt = _txt .replaceAll(rgx.inline_image, @@ -394,7 +395,7 @@ template formatODT() { } return _txt; } - @safe string markup(O)(const O obj) { + string markup(O)(const O obj) { /+ markup TODO +/ string _txt = obj.text; _txt = _special_characters(_txt, obj); // TODO & why both obj & obj.text, consider also in output_xmls.org @@ -408,7 +409,7 @@ template formatODT() { _txt = _empty_line_break(_txt, obj); // (obj.metainfo.is_a == "code" || obj.metainfo.is_a == "verse" || obj.metainfo.is_a == "block") return _txt; } - @safe string heading(O,M)( + string heading(O,M)( const O obj, const M doc_matters, ) { @@ -452,7 +453,7 @@ template formatODT() { } return _o_txt_odt; } - @safe string para(O,M)( + string para(O,M)( const O obj, const M doc_matters, ) { @@ -471,7 +472,7 @@ template formatODT() { } return _o_txt_odt; } - @safe string quote(O,M)( + string quote(O,M)( const O obj, const M doc_matters, ) { @@ -483,7 +484,7 @@ template formatODT() { _o_txt_odt = _footnotes(_o_txt_odt); // decide return _o_txt_odt; } - @safe string group(O,M)( + string group(O,M)( const O obj, const M doc_matters, ) { @@ -501,7 +502,7 @@ template formatODT() { _o_txt_odt = _block_type_delimiters(_block_lines, obj); return _o_txt_odt; } - @safe string block(O,M)( + string block(O,M)( const O obj, const M doc_matters, ) { @@ -514,7 +515,7 @@ template formatODT() { _o_txt_odt = _block_type_delimiters(_block_lines, obj); return _o_txt_odt; } - @safe string verse(O,M)( + string verse(O,M)( const O obj, const M doc_matters, ) { @@ -527,7 +528,7 @@ template formatODT() { _o_txt_odt = _block_type_delimiters(_block_lines, obj); return _o_txt_odt; } - @safe string code(O,M)( + string code(O,M)( const O obj, const M doc_matters, ) { @@ -574,7 +575,7 @@ template formatODT() { _o_txt_odt = _block; return _o_txt_odt; } - @safe Tuple!(string, string) tablarize(O)( + Tuple!(string, string) tablarize(O)( const O obj, string _txt, ) { @@ -609,7 +610,7 @@ template formatODT() { return t; } int _table_number = 0; - @safe string table(O,M)( + string table(O,M)( const O obj, const M doc_matters, ) { @@ -666,7 +667,7 @@ template outputODT() { static auto rgx = RgxO(); static auto rgx_xhtml = RgxXHTML(); // mixin outputXmlODT; - @safe string odt_head(I)(I doc_matters) { + string odt_head(I)(I doc_matters) { string _has_tables = format(q"┃ @@ -774,7 +775,7 @@ template outputODT() { ); return _odt_head; } - @safe string odt_body(D,I)( + string odt_body(D,I)( const D doc_abstraction, I doc_matters, ) { @@ -900,12 +901,12 @@ template outputODT() { return doc_odt; } - @safe string odt_tail() { + string odt_tail() { string _odt_tail = format(q"┃spine: <www.doc_reform.org> and <www.sisudoc.org> ┃",); return _odt_tail; } - @safe string content_xml(D,I)( + string content_xml(D,I)( const D doc_abstraction, I doc_matters, ) { @@ -918,7 +919,7 @@ template outputODT() { _content_xml ~= odt_tail; return _content_xml; } - @safe string manifest_xml(M)( + string manifest_xml(M)( auto ref M doc_matters, ) { string _bullet = format(q"┃┃"); @@ -942,7 +943,7 @@ template outputODT() { ); return _manifest_xml; } - @safe void images_cp(M)( + void images_cp(M)( auto ref M doc_matters, ) { { /+ (copy odt images) +/ @@ -963,7 +964,7 @@ template outputODT() { } // return 0; } - @safe string meta_xml(M)( + string meta_xml(M)( auto ref M doc_matters, ) { /+ (meta_xml includes output time-stamp) +/ @@ -1011,11 +1012,11 @@ template outputODT() { } // return 0; } - @safe string mimetype() { + string mimetype() { string mimetype_ = format(q"┃application/vnd.oasis.opendocument.text┃"); return mimetype_; } - @safe string manifest_rdf() { + string manifest_rdf() { string _manifest_rdf = format(q"┃ @@ -1037,7 +1038,7 @@ template outputODT() { ┃"); return _manifest_rdf; } - @safe string settings_xml() { + string settings_xml() { string _settings_xml = format(q"┃ @@ -1137,7 +1138,7 @@ template outputODT() { ┃"); return _settings_xml; } - @safe string styles_xml() { + string styles_xml() { string _styles_xml = format(q"┃ @@ -2033,7 +2034,7 @@ template outputODT() { ┃"); return _styles_xml; } - void writeOutputODT(W,I)( + @trusted void writeOutputODT(W,I)( const W odt_content, I doc_matters, ) { @@ -2092,7 +2093,7 @@ template outputODT() { auto zip_arc_member_file = new ArchiveMember(); zip_arc_member_file.name = fn_out; auto zip_data = new OutBuffer(); - zip_data.write(cast(char[]) ((fn_src).read)); + zip_data.write(cast(char[]) ((fn_src).read)); // trusted? zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); createZipFile!()(fn_odt, zip.build()); diff --git a/src/doc_reform/io_out/paths_output.d b/src/doc_reform/io_out/paths_output.d index b11dbdb..a317896 100644 --- a/src/doc_reform/io_out/paths_output.d +++ b/src/doc_reform/io_out/paths_output.d @@ -51,6 +51,7 @@ default settings +/ module doc_reform.io_out.paths_output; +@safe: import std.array, std.path, diff --git a/src/doc_reform/io_out/rgx.d b/src/doc_reform/io_out/rgx.d index 524415a..212581f 100644 --- a/src/doc_reform/io_out/rgx.d +++ b/src/doc_reform/io_out/rgx.d @@ -51,6 +51,7 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.io_out.rgx; +@safe: static template spineRgxOut() { static struct RgxO { static make_breakpage = ctRegex!(`new=(?P.+?)(?:;|$)`); diff --git a/src/doc_reform/io_out/rgx_latex.d b/src/doc_reform/io_out/rgx_latex.d index a69c903..2d43dc3 100644 --- a/src/doc_reform/io_out/rgx_latex.d +++ b/src/doc_reform/io_out/rgx_latex.d @@ -51,6 +51,7 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.io_out.rgx_latex; +@safe: static template spineRgxLSC() { static struct RgxLSC { static latex_special_char = ctRegex!(`([%${}_#&\\])`); diff --git a/src/doc_reform/io_out/rgx_xhtml.d b/src/doc_reform/io_out/rgx_xhtml.d index 831bfdc..0bf8bb1 100644 --- a/src/doc_reform/io_out/rgx_xhtml.d +++ b/src/doc_reform/io_out/rgx_xhtml.d @@ -51,6 +51,7 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.io_out.rgx_xhtml; +@safe: static template spineRgxXHTML() { static struct RgxXHTML { static ampersand = ctRegex!(`[&]`, "m"); // & diff --git a/src/doc_reform/io_out/source_pod.d b/src/doc_reform/io_out/source_pod.d index 7441f6b..3920d08 100644 --- a/src/doc_reform/io_out/source_pod.d +++ b/src/doc_reform/io_out/source_pod.d @@ -48,6 +48,7 @@ +/ module doc_reform.io_out.source_pod; +@system: // is not @safe: use: @system: or @trusted: template spinePod() { import doc_reform.meta.rgx_files, 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, "
") @@ -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, ("$1")) .replaceAll(rgx.inline_bold, ("$1")) @@ -183,7 +184,7 @@ template outputXHTMLs() { .replaceAll(rgx.inline_cite, ("$1")); 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"┃ @@ -464,12 +465,12 @@ template outputXHTMLs() { ); return o; } -@safe string dom_close() { +string dom_close() { string o; o = format(q"┃┃"); return o; } -@safe string tail(M)(M doc_matters) { +string tail(M)(M doc_matters) { string o; o = format(q"┃
@@ -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 ~= "
\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, diff --git a/src/doc_reform/io_out/xmls_css.d b/src/doc_reform/io_out/xmls_css.d index 831a26d..712d79a 100644 --- a/src/doc_reform/io_out/xmls_css.d +++ b/src/doc_reform/io_out/xmls_css.d @@ -51,9 +51,10 @@ default css settings +/ module doc_reform.io_out.xmls_css; +@safe: template spineCss() { import std.format; - @safe auto spineCss(M)(M doc_matters) { + auto spineCss(M)(M doc_matters) { string _css_indent = format(q"┃ /* indent */ p.norm { } @@ -4427,7 +4428,7 @@ p.form { _css_indent, _color_ocn_dark, ); - @safe auto css_() { + auto css_() { struct _CSS { string html_seg = "/* spine css html seg stylesheet */\n"; string html_scroll = "/* spine css html scroll stylesheet */\n"; diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d index b76f603..3a423ed 100644 --- a/src/doc_reform/meta/conf_make_meta_json.d +++ b/src/doc_reform/meta/conf_make_meta_json.d @@ -52,6 +52,7 @@ extract json header return json +/ module doc_reform.meta.conf_make_meta_json; +@safe: static template contentJSONtoSpineStruct() { import std.algorithm, @@ -69,7 +70,7 @@ static template contentJSONtoSpineStruct() { doc_reform.meta.defaults, doc_reform.meta.rgx; ConfComposite _struct_composite; - @safe auto contentJSONtoSpineStruct(C,J,M)(C _struct_composite, J _json, M _manifested, string _identifier) { + auto contentJSONtoSpineStruct(C,J,M)(C _struct_composite, J _json, M _manifested, string _identifier) { mixin spineRgxIn; static auto rgx = RgxI(); debug (json) { diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index 6fdb322..ef39944 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -48,6 +48,7 @@ +/ module doc_reform.meta.conf_make_meta_structs; +@safe: import std.exception, std.json, @@ -68,7 +69,7 @@ mixin spineRgxYamlTags; static auto rgx_y = RgxYaml(); mixin InternalMarkup; static auto mkup = InlineMarkup(); -@safe string url_markup(string line) { +string url_markup(string line) { string line_ = line .replaceAll( rgx.smid_inline_link_markup_regular, @@ -110,7 +111,7 @@ struct ConfCompositeMakeStr { string[][] substitute; string texpdf_font; } -struct confCompositeMakeBuild { +@trusted struct confCompositeMakeBuild { string[] bold(string _mk) { string[] _out; if (_mk) { diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index ed3364f..328ee96 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -52,6 +52,7 @@ extract yaml header return struct +/ module doc_reform.meta.conf_make_meta_yaml; +@safe: template contentYAMLtoSpineStruct() { import std.algorithm, diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index 7abf30a..75fa7d8 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -51,8 +51,9 @@ default settings +/ module doc_reform.meta.defaults; +@safe: template spineNode() { - @safe static string[string] node_metadata_heading_str() { + static string[string] node_metadata_heading_str() { string[string] _node = [ "is" : "", "ocn" : "", @@ -63,7 +64,7 @@ template spineNode() { ]; return _node; } - @safe static int[string] node_metadata_heading_int() { + static int[string] node_metadata_heading_int() { int[string] _node = [ "ocn" : 0, // decide whether to use or keep? "ptr_doc_object" : 0, @@ -76,7 +77,7 @@ template spineNode() { ]; return _node; } - @safe static string[string] node_metadata_para_str() { + static string[string] node_metadata_para_str() { string[string] _node = [ "is" : "", "ocn" : "", @@ -84,7 +85,7 @@ template spineNode() { ]; return _node; } - @safe static int[string] node_metadata_para_int() { + static int[string] node_metadata_para_int() { int[string] _node = [ "ocn" : 0, "indent_base" : 0, @@ -95,7 +96,7 @@ template spineNode() { } } template spineCurateMetadata() { - @safe auto spineCurateMetadata() { + auto spineCurateMetadata() { struct _Curate { struct Curate { string title = ""; @@ -129,7 +130,7 @@ template spineCurateMetadata() { template spineBiblio() { // required: deemed_author (author || editor); year; fulltitle; struct BibJsnStr { - @safe static auto biblio_entry_tags_jsonstr() { + static auto biblio_entry_tags_jsonstr() { string x = `{ "is" : "", "sortby_deemed_author_year_title" : "", @@ -211,7 +212,7 @@ template InternalMarkup() { template spineLanguageCodes() { /+ language codes +/ struct Lang { - @safe static string[string][string] codes() { + static string[string][string] codes() { auto _lang_codes = [ "am": [ "c": "am", "n": "Amharic", "t": "Amharic", "xlp": "amharic" ], "bg": [ "c": "bg", "n": "Bulgarian", "t": "Български (Bəlgarski)", "xlp": "bulgarian" ], @@ -278,15 +279,15 @@ template spineLanguageCodes() { ]; return _lang_codes; } - @safe static string[] code_arr_ptr() { + static string[] code_arr_ptr() { string[] _lang_codes = ["am", "bg", "bn", "br", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hy", "ia", "is", "it", "ja", "ko", "la", "lo", "lt", "lv", "ml", "mr", "nl", "no", "nn", "oc", "pl", "pt", "pt_BR", "ro", "ru", "sa", "se", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "tr", "uk", "ur", "us", "vi", "zh", "en", "xx",]; return _lang_codes; } - @safe static string[] code_arr() { + static string[] code_arr() { string[] _lang_codes = ["am", "bg", "bn", "br", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hy", "ia", "is", "it", "ja", "ko", "la", "lo", "lt", "lv", "ml", "mr", "nl", "no", "nn", "oc", "pl", "pt", "pt_BR", "ro", "ru", "sa", "se", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "tr", "uk", "ur", "vi", "zh"]; return _lang_codes; } - @safe static auto codes_() { + static auto codes_() { return "(" ~ join(code_arr,"|") ~ ")"; } static auto codes_regex() { diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index 75e0b29..cc0726f 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -48,6 +48,7 @@ +/ module doc_reform.meta.metadoc; +@safe: template spineAbstraction() { import std.datetime; @@ -145,15 +146,15 @@ template spineAbstraction() { writeln("step4 commence → (doc_matters) [", _manifest.src.filename, "]"); } struct DocumentMatters { - @safe auto generator_program() { + auto generator_program() { struct Prog_ { - @safe string project_name() { + string project_name() { return "spine"; } - @safe string name() { + string name() { return program_info.name; } - @safe string ver() { + string ver() { return program_info.ver; } @trusted string name_and_version() { @@ -162,22 +163,22 @@ template spineAbstraction() { @trusted string name_version_and_compiler() { return program_info.name_version_and_compiler; } - @safe string url_home() { + string url_home() { return "https://sisudoc.org"; } - @safe string url_git() { + string url_git() { return "https://git.sisudoc.org/projects/"; } - @safe auto compiler() { + auto compiler() { return program_info.compiler; } - @safe auto time_output_generated() { + auto time_output_generated() { return program_info.time_output_generated; } } return Prog_(); } - @safe auto generated_time() { + auto generated_time() { auto _st = Clock.currTime(UTC()); auto _time = _st.year.to!string ~ "-" ~ _st.month.to!int.to!string // prefer as month number @@ -188,26 +189,26 @@ template spineAbstraction() { ~ ":" ~ _st.second.to!string; return _time; } - @safe auto conf_make_meta() { + auto conf_make_meta() { return _make_and_meta_struct; } - @safe auto has() { + auto has() { return _doc_has_struct; } - @safe auto env() { + auto env() { struct Env_ { - @safe auto pwd() { + auto pwd() { return _manifest.env.pwd; } - @safe auto home() { + auto home() { return _manifest.env.home; } } return Env_(); } - @safe auto opt() { + auto opt() { struct Opt_ { - @safe auto action() { + auto action() { /+ getopt options, commandline instructions, raw - processing instructions --epub --html etc. - command line config instructions --output @@ -217,18 +218,18 @@ template spineAbstraction() { } return Opt_(); } - @safe auto src() { + auto src() { return _manifest.src; } - @safe auto src_path_info() { + auto src_path_info() { return spinePathsSRC!()(_manifest.env.pwd, _manifest.src.file_with_absolute_path); // would like (to have and use) relative path } - @safe auto pod() { + auto pod() { return _manifest.pod; } - @safe auto sqlite() { + auto sqlite() { struct SQLite_ { - @safe string filename() { + string filename() { string _fn = ""; string _pth = ""; if (_opt_action.sqliteDB_filename.length > 0) { @@ -238,7 +239,7 @@ template spineAbstraction() { } return _fn; } - @safe string path() { + string path() { string _pth = ""; if (_opt_action.sqliteDB_path.length > 0) { _pth = _opt_action.sqliteDB_path; @@ -247,7 +248,7 @@ template spineAbstraction() { } return _pth; } - @safe string cgi_filename() { + string cgi_filename() { string _fn = ""; if (_opt_action.cgi_sqlite_search_filename.length > 0) { _fn = _opt_action.cgi_sqlite_search_filename; @@ -256,7 +257,7 @@ template spineAbstraction() { } return _fn; } - @safe string cgi_filename_d() { + string cgi_filename_d() { string _fn = ""; if (_opt_action.cgi_sqlite_search_filename_d.length > 0) { _fn = _opt_action.cgi_sqlite_search_filename_d; @@ -268,10 +269,10 @@ template spineAbstraction() { } return SQLite_(); } - @safe auto output_path() { + auto output_path() { return _make_and_meta_struct.conf.output_path; } - @safe auto srcs() { + auto srcs() { struct SRC_ { auto file_insert_list() { return _header_body_insertfilelist_imagelist[headBody.insert_file_list]; diff --git a/src/doc_reform/meta/metadoc_curate.d b/src/doc_reform/meta/metadoc_curate.d index ffaef6f..3263015 100644 --- a/src/doc_reform/meta/metadoc_curate.d +++ b/src/doc_reform/meta/metadoc_curate.d @@ -48,8 +48,9 @@ +/ module doc_reform.meta.metadoc_curate; +@safe: template spineMetaDocCurate() { - @safe auto spineMetaDocCurate(T,H)( + auto spineMetaDocCurate(T,H)( T doc_matters, H hvst, ) { diff --git a/src/doc_reform/meta/metadoc_curate_authors.d b/src/doc_reform/meta/metadoc_curate_authors.d index 589431c..8757b26 100644 --- a/src/doc_reform/meta/metadoc_curate_authors.d +++ b/src/doc_reform/meta/metadoc_curate_authors.d @@ -48,6 +48,7 @@ +/ module doc_reform.meta.metadoc_curate_authors; +@safe: import std.algorithm, std.array, @@ -68,7 +69,7 @@ template spineMetaDocCuratesAuthors() { M _make_and_meta_struct, O _opt_action, ) { - @safe string inline_search_form(M)( + string inline_search_form(M)( M _make_and_meta_truct, ) { string o; diff --git a/src/doc_reform/meta/metadoc_curate_topics.d b/src/doc_reform/meta/metadoc_curate_topics.d index 4cb75d9..9fc7604 100644 --- a/src/doc_reform/meta/metadoc_curate_topics.d +++ b/src/doc_reform/meta/metadoc_curate_topics.d @@ -48,6 +48,7 @@ +/ module doc_reform.meta.metadoc_curate_topics; +@safe: import std.algorithm, std.array, @@ -68,7 +69,7 @@ template spineMetaDocCuratesTopics() { M _make_and_meta_struct, O _opt_action, ) { - @safe string inline_search_form(M)( + string inline_search_form(M)( M _make_and_meta_truct, ) { string o; diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index a05edf4..cf4a7cc 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -51,6 +51,7 @@ // abstraction of sisu markup for downstream processing // metadoc_from_src.d module doc_reform.meta.metadoc_from_src; +@safe: template docAbstraction() { // ↓ abstraction imports import @@ -1490,7 +1491,7 @@ template docAbstraction() { return tag_assoc; } } - @safe auto doc_has() { + auto doc_has() { return DocHas_(); } // the doc to be returned diff --git a/src/doc_reform/meta/metadoc_from_src_functions.d b/src/doc_reform/meta/metadoc_from_src_functions.d index 557bfef..56d5db5 100644 --- a/src/doc_reform/meta/metadoc_from_src_functions.d +++ b/src/doc_reform/meta/metadoc_from_src_functions.d @@ -51,6 +51,7 @@ // abstraction of sisu markup for downstream processing // metadoc_from_src.d module doc_reform.meta.metadoc_from_src_functions; +@safe: template docAbstractionFunctions() { // ↓ abstraction imports import @@ -111,11 +112,11 @@ template docAbstractionFunctions() { auto node_construct = NodeStructureMetadata(); // ↓ abstraction function emitters // ↓ - emitters - @safe pure struct OCNemitter { + pure struct OCNemitter { int ocn_digit, ocn_object_number, ocn_on_, ocn_off_, ocn_bkidx, ocn_bkidx_; string object_identifier; bool ocn_is_off; - @safe auto ocn_emitter(int ocn_status_flag) { + auto ocn_emitter(int ocn_status_flag) { OCNset ocn; assert(ocn_status_flag <= eN.ocn.reset); ocn_object_number = ocn_bkidx = 0; @@ -159,7 +160,7 @@ template docAbstractionFunctions() { invariant() { } } - @safe pure ObjGenericComposite obj_heading_ancestors()( + pure ObjGenericComposite obj_heading_ancestors()( ObjGenericComposite obj, string[] lv_ancestors_txt, ) { @@ -200,10 +201,10 @@ template docAbstractionFunctions() { } return obj; } - @safe static OCNset ocn_emit(int ocn_status_flag) { + static OCNset ocn_emit(int ocn_status_flag) { return object_citation_number.ocn_emitter(ocn_status_flag); } - @safe static uint[string] _check_ocn_status_()( + static uint[string] _check_ocn_status_()( char[] line, uint[string] pith, ) { @@ -272,7 +273,7 @@ template docAbstractionFunctions() { return ret; } // ↓ - reset object - @safe static string[string] object_reset()(string[string] an_object) { + static string[string] object_reset()(string[string] an_object) { an_object.remove("body_nugget"); an_object.remove("substantive"); an_object.remove("is"); @@ -282,7 +283,7 @@ template docAbstractionFunctions() { } // ↑ - resets // ↓ - markup text by line - @safe char[] font_faces_line()(char[] textline) { + char[] font_faces_line()(char[] textline) { static auto rgx = RgxI(); static auto mkup = InlineMarkup(); if (textline.match(rgx.inline_faces_line)) { @@ -302,7 +303,7 @@ template docAbstractionFunctions() { } return textline; } - @safe auto inline_markup_faces(L)(L line) { + auto inline_markup_faces(L)(L line) { static auto rgx = RgxI(); static auto mkup = InlineMarkup(); line = replaceAll!(m => mkup.quote_o ~ m[1] ~ mkup.quote_c)(line, rgx.within_quotes); @@ -313,7 +314,7 @@ template docAbstractionFunctions() { } return line; } - @safe static string links_and_images()(string obj_txt) { + static string links_and_images()(string obj_txt) { static auto rgx = RgxI(); static auto mkup = InlineMarkup(); if (obj_txt.match(rgx.smid_inline_url_generic)) { @@ -353,7 +354,7 @@ template docAbstractionFunctions() { } return obj_txt; } - @safe char[] _doc_header_and_make_substitutions_(CMM)( + char[] _doc_header_and_make_substitutions_(CMM)( char[] line, CMM conf_make_meta, ) { @@ -368,7 +369,7 @@ template docAbstractionFunctions() { } return line; } - @safe char[] _doc_header_and_make_substitutions_fontface_(CMM)( + char[] _doc_header_and_make_substitutions_fontface_(CMM)( char[] line, CMM conf_make_meta, ) { @@ -395,7 +396,7 @@ template docAbstractionFunctions() { } // ↑ - markup by line // ↓ - text by line (blocks etc.) - @safe ST_txt_by_line_block_start txt_by_line_block_start()( + ST_txt_by_line_block_start txt_by_line_block_start()( char[] line, uint[string] pith, uint[string] dochas, @@ -529,7 +530,7 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_txt_by_line_block_generic txt_by_line_block_group()( + ST_txt_by_line_block_generic txt_by_line_block_group()( char[] line, string[string] an_object, uint[string] pith, @@ -567,7 +568,7 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_txt_by_line_block_generic txt_by_line_block_block()( + ST_txt_by_line_block_generic txt_by_line_block_block()( char[] line, string[string] an_object, uint[string] pith, @@ -605,7 +606,7 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( + ST_txt_by_line_block_poem txt_by_line_block_poem(CMM)( char[] line, string[string] an_object, uint[string] pith, @@ -807,7 +808,7 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_txt_by_line_block_generic txt_by_line_block_code()( + ST_txt_by_line_block_generic txt_by_line_block_code()( char[] line, string[string] an_object, uint[string] pith, @@ -920,7 +921,7 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_txt_by_line_block_generic txt_by_line_block_quote()( + ST_txt_by_line_block_generic txt_by_line_block_quote()( char[] line, string[string] an_object, uint[string] pith, @@ -1095,7 +1096,7 @@ template docAbstractionFunctions() { } // ↑ - text by line // ↓ - para - @safe string[string][string] inline_para_link_anchor()( + string[string][string] inline_para_link_anchor()( string[string] an_object, string[string] tag_in_seg, string[string][string] tag_assoc @@ -1111,7 +1112,7 @@ template docAbstractionFunctions() { } return tag_assoc; } - @safe ST_flow_para_match flow_para_match_()( + ST_flow_para_match flow_para_match_()( char[] line, string[string] an_object, string an_object_key, @@ -1167,7 +1168,7 @@ template docAbstractionFunctions() { } // ↑ - para // ↓ - heading - @safe ST_flow_heading_found flow_heading_found_()( + ST_flow_heading_found flow_heading_found_()( char[] line, string[string] heading_match_str, string[] _make_unmarked_headings, @@ -1252,7 +1253,7 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_flow_heading_make_set flow_heading_make_set_()( + ST_flow_heading_make_set flow_heading_make_set_()( char[] line, int[string] line_occur, return ref Regex!(char)[string] heading_match_rgx, @@ -1300,7 +1301,7 @@ template docAbstractionFunctions() { } return ret; } - @safe auto flow_heading_matched_(CMM)( + auto flow_heading_matched_(CMM)( char[] line, string[string] an_object, int[string] line_occur, @@ -1491,7 +1492,7 @@ template docAbstractionFunctions() { } // ↑ - heading // ↓ - table - @safe ObjGenericComposite flow_table_instructions(H)( + ObjGenericComposite flow_table_instructions(H)( ObjGenericComposite table_object, H table_head, ) { @@ -1516,7 +1517,7 @@ template docAbstractionFunctions() { } return table_object; } - @safe ST_flow_table_array_munge flow_table_array_munge()( + ST_flow_table_array_munge flow_table_array_munge()( ObjGenericComposite table_object, string[][] table_array, ) { @@ -2045,7 +2046,7 @@ template docAbstractionFunctions() { return ret; } // ↓ - object set - @safe ObjGenericComposite set_object_heading()( + ObjGenericComposite set_object_heading()( string level, string part, string section, @@ -2076,7 +2077,7 @@ template docAbstractionFunctions() { } return comp_obj; } - @safe ObjGenericComposite set_object_generic()( + ObjGenericComposite set_object_generic()( string part, string section, string type, @@ -2098,7 +2099,7 @@ template docAbstractionFunctions() { } // ↑ - object set // ↓ - object inline munge - @safe static struct ObjInlineMarkupMunge { + static struct ObjInlineMarkupMunge { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; string asterisks_, plus_; @@ -2112,7 +2113,7 @@ template docAbstractionFunctions() { n_foot_sp_asterisk = 0; n_foot_sp_plus = 0; } - @safe static auto images()(string obj_txt_in) { + static auto images()(string obj_txt_in) { static auto mng = InlineMarkup(); // url matched obj_txt_in = obj_txt_in.replaceAll(rgx.inline_notes_al_special, ""); // TODO reinstate when special footnotes are implemented @@ -2136,7 +2137,7 @@ template docAbstractionFunctions() { } return obj_txt_in; } - @safe ST_txtPlusHasFootnotes footnotes_endnotes_markup_and_number_or_stars()(string obj_txt_in, bool reset_note_numbers) { + ST_txtPlusHasFootnotes footnotes_endnotes_markup_and_number_or_stars()(string obj_txt_in, bool reset_note_numbers) { // endnotes (regular) bool flg_notes_reg = false; bool flg_notes_star = false; @@ -2208,7 +2209,7 @@ template docAbstractionFunctions() { } return ret; } - @safe private ST_txtPlusHasFootnotesUrlsImages object_notes_and_links_()( + private ST_txtPlusHasFootnotesUrlsImages object_notes_and_links_()( string obj_txt_in, bool reset_note_numbers = false ) { @@ -2263,7 +2264,7 @@ template docAbstractionFunctions() { } return ret; } - @safe private ST_txtPlusHasFootnotesUrlsImages object_only_()( + private ST_txtPlusHasFootnotesUrlsImages object_only_()( string obj_txt_in, bool reset_note_numbers = false ) { @@ -2284,7 +2285,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_heading()( + ST_txtPlusHasFootnotesUrlsImages munge_heading()( string obj_txt_in, bool reset_note_numbers = false ) { @@ -2299,7 +2300,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_para()(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_para()(string obj_txt_in) { obj_txt["munge"] = (obj_txt_in) .replaceFirst(rgx.para_attribs, "") .replaceFirst(rgx.object_number_off_all, "") @@ -2311,44 +2312,44 @@ template docAbstractionFunctions() { } return ret; } - @safe ST_txtPlusHasFootnotesUrlsImages munge_quote()(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_quote()(string obj_txt_in) { ST_txtPlusHasFootnotesUrlsImages ret = object_notes_and_links_(obj_txt_in.split("\n\n").join(" \\\\\n \\\\\n")); return ret; } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_group(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_group(string obj_txt_in) { ST_txtPlusHasFootnotesUrlsImages ret = object_notes_and_links_(obj_txt_in.split("\n\n").join("\n" ~ mkup.br_line_spaced ~ "\n")); return ret; } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_block()(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_block()(string obj_txt_in) { ST_txtPlusHasFootnotesUrlsImages ret = object_notes_and_links_(obj_txt_in); return ret; } invariant() { } - @safe auto munge_verse()(string obj_txt_in) { + auto munge_verse()(string obj_txt_in) { ST_txtPlusHasFootnotesUrlsImages ret = object_notes_and_links_(obj_txt_in); return ret; } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_code()(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_code()(string obj_txt_in) { obj_txt_in = obj_txt_in.replaceAll(rgx.space, mkup.nbsp); ST_txtPlusHasFootnotesUrlsImages ret = object_only_(obj_txt_in); return ret; } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_table()(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_table()(string obj_txt_in) { ST_txtPlusHasFootnotesUrlsImages ret = object_notes_and_links_(obj_txt_in); return ret; } invariant() { } - @safe ST_txtPlusHasFootnotesUrlsImages munge_comment()(string obj_txt_in) { + ST_txtPlusHasFootnotesUrlsImages munge_comment()(string obj_txt_in) { ST_txtPlusHasFootnotesUrlsImages ret = object_only_(obj_txt_in); return ret; } @@ -2362,7 +2363,7 @@ template docAbstractionFunctions() { static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; string anchor_tag = ""; - @safe ST_txtAndAnchorTagPlusHasFootnotesUrlsImages obj_inline_markup_and_anchor_tags_and_misc(CMM)( + ST_txtAndAnchorTagPlusHasFootnotesUrlsImages obj_inline_markup_and_anchor_tags_and_misc(CMM)( string[string] obj_, string obj_key_, CMM conf_make_meta, @@ -2451,14 +2452,14 @@ template docAbstractionFunctions() { } invariant() { } - @safe auto _clean_heading_toc_()( + auto _clean_heading_toc_()( char[] heading_toc_, ) { auto m = (cast(char[]) heading_toc_).matchFirst(rgx.heading); heading_toc_ = (m.post).replaceAll(rgx.inline_notes_curly_gen, ""); return heading_toc_; }; - @safe ST_flow_table_of_contents_gather_headings flow_table_of_contents_gather_headings(CMM)( // + ST_flow_table_of_contents_gather_headings flow_table_of_contents_gather_headings(CMM)( // string[string] obj_, CMM conf_make_meta, string[string] tag_in_seg, @@ -2549,7 +2550,7 @@ template docAbstractionFunctions() { static string heading_number_auto_composite = ""; static string heading_number_auto_composite_segname = ""; static bool[] auto_heading_numbering = [ true, true, true, true]; - @safe static string _configured_auto_heading_numbering_and_segment_anchor_tags(CMM)( + static string _configured_auto_heading_numbering_and_segment_anchor_tags(CMM)( string munge_, string[string] obj_, CMM conf_make_meta, @@ -2691,7 +2692,7 @@ template docAbstractionFunctions() { return munge_; } static int heading_num_lev1 = 0; - @safe static string _make_segment_anchor_tags_if_none_provided()( + static string _make_segment_anchor_tags_if_none_provided()( string munge_, string lev_, bool _new_doc @@ -2729,7 +2730,7 @@ template docAbstractionFunctions() { // ↓ - object attributes struct ObjAttributes { string[string] _obj_attrib; - @safe string obj_attributes()( + string obj_attributes()( string obj_is_, string obj_raw, ObjGenericComposite comp_obj_, @@ -2792,7 +2793,7 @@ template docAbstractionFunctions() { } private: string _obj_attributes; - @safe string txt_para_and_blocks()(string obj_txt_in) { + string txt_para_and_blocks()(string obj_txt_in) { if (obj_txt_in.matchFirst(rgx.para_bullet)) { _obj_attributes =" \"bullet\": \"true\"," ~ " \"indent_hang\": 0," @@ -2816,7 +2817,7 @@ template docAbstractionFunctions() { } return _obj_attributes; } - @safe string txt_heading()(string obj_txt_in) { + string txt_heading()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"para\"," ~ " \"is\": \"heading\""; @@ -2824,7 +2825,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_para()(string obj_txt_in) { + string txt_para()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"para\"," ~ " \"is\": \"para\""; @@ -2832,7 +2833,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_quote()(string obj_txt_in) { + string txt_quote()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," ~ " \"is\": \"quote\""; @@ -2840,7 +2841,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_group()(string obj_txt_in) { + string txt_group()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," ~ " \"is\": \"group\""; @@ -2848,7 +2849,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_block()(string obj_txt_in) { + string txt_block()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," ~ " \"is\": \"block\""; @@ -2856,7 +2857,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_verse()(string obj_txt_in) { + string txt_verse()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," ~ " \"is\": \"verse\""; @@ -2864,7 +2865,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_code()(string obj_txt_in) { + string txt_code()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," ~ " \"is\": \"code\""; @@ -2872,7 +2873,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_table()(string obj_txt_in) { + string txt_table()(string obj_txt_in) { _obj_attributes = " \"use\": \"content\"," ~ " \"of\": \"block\"," ~ " \"is\": \"table\""; @@ -2880,7 +2881,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string txt_comment()(string obj_txt_in) { + string txt_comment()(string obj_txt_in) { _obj_attributes = " \"use\": \"comment\"," ~ " \"of\": \"comment\"," ~ " \"is\": \"comment\""; @@ -2888,7 +2889,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe string _set_additional_values_parse_as_json()( + string _set_additional_values_parse_as_json()( string _obj_attrib, string obj_is_, ObjGenericComposite comp_obj_, @@ -2912,7 +2913,7 @@ template docAbstractionFunctions() { } // ↑ - object attributes // ↓ - object tags - @safe pure ObjGenericComposite obj_dom_structure_set_markup_tags()( + pure ObjGenericComposite obj_dom_structure_set_markup_tags()( ObjGenericComposite obj, int[] dom, int lev @@ -2954,7 +2955,7 @@ template docAbstractionFunctions() { obj.metainfo.dom_structure_markedup_tags_status = dom.dup; return obj; } - @safe pure ObjGenericComposite obj_dom_set_collapsed_tags()( + pure ObjGenericComposite obj_dom_set_collapsed_tags()( ObjGenericComposite obj, int[] dom, int lev @@ -3105,7 +3106,7 @@ template docAbstractionFunctions() { int previous_count; int mkn; static auto rgx = RgxI(); - @safe private auto gather_notes_for_endnote_section( + private auto gather_notes_for_endnote_section( ObjGenericComposite[] contents_am, string[string] tag_in_seg, int cntr, @@ -3183,7 +3184,7 @@ template docAbstractionFunctions() { } return object_notes; } - @safe private auto gathered_notes() { + private auto gathered_notes() { string[][string] endnotes_; if (object_notes.length > 1) { endnotes_["notes"] = (object_notes["notes"].split(rgx.break_string))[0..$-1]; @@ -3194,7 +3195,7 @@ template docAbstractionFunctions() { } return endnotes_; } - @safe private ST_endnotes backmatter_endnote_objects(O)( + private ST_endnotes backmatter_endnote_objects(O)( OCNset obj_cite_digits, O opt_action, ) { @@ -3327,7 +3328,7 @@ template docAbstractionFunctions() { string[] object_numbers; string[][string][string] bi_hash_nugget; string[] bi_main_terms_split_arr; - @safe string[][string][string] bookindex_nugget_hash(S)( + string[][string][string] bookindex_nugget_hash(S)( string bookindex_section, OCNset obj_cite_digits, S tag_in_seg, @@ -3395,7 +3396,7 @@ template docAbstractionFunctions() { } struct BookIndexReportIndent { int mkn, skn; - @safe void bookindex_report_indented()( + void bookindex_report_indented()( string[][string][string] bookindex_unordered_hashes ) { auto mainkeys @@ -3421,7 +3422,7 @@ template docAbstractionFunctions() { int mkn, skn; static auto rgx = RgxI(); static auto munge = ObjInlineMarkupMunge(); - @safe void bookindex_write_section()( + void bookindex_write_section()( string[][string][string] bookindex_unordered_hashes ) { auto mainkeys = @@ -3957,7 +3958,7 @@ template docAbstractionFunctions() { } // ↑ - section blurb // ↓ - images - @safe string[] extract_images()(string content_block) { + string[] extract_images()(string content_block) { static auto rgx = RgxI(); string[] images_; if (auto m = content_block.matchAll(rgx.image)) { @@ -4005,7 +4006,7 @@ template docAbstractionFunctions() { } // ↑ - images // ↓ - links - @safe auto _links(O)(O obj) { + auto _links(O)(O obj) { static auto rgx = RgxI(); if (auto m = obj.text.match(rgx.inline_link_stow_uri)) { debug(links) { @@ -4126,7 +4127,7 @@ template docAbstractionFunctions() { int obj_cite_digit; int[string] p_; // p_ parent_ static auto rgx = RgxI(); - @safe ObjGenericComposite node_location_emitter(La,Ta)( + ObjGenericComposite node_location_emitter(La,Ta)( string lev_markup_number, string[string] tag_in_seg, La lev_anchor_tag, @@ -4175,7 +4176,7 @@ template docAbstractionFunctions() { } invariant() { } - @safe ObjGenericComposite node_emitter_heading(O,TaL,TA,SOAT)( + ObjGenericComposite node_emitter_heading(O,TaL,TA,SOAT)( O an_object, string[string] tag_in_seg, TaL lev_anchor_tag, @@ -4374,7 +4375,7 @@ template docAbstractionFunctions() { ObjGenericComposite[] the_document_bookindex_section, ObjGenericComposite[] the_document_blurb_section, ) { - @safe int[] _get_ancestors_markup(ObjGenericComposite obj, int[] _ancestors_markup) { + int[] _get_ancestors_markup(ObjGenericComposite obj, int[] _ancestors_markup) { if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); } if (obj.metainfo.heading_lev_markup == 1) { @@ -4457,7 +4458,7 @@ template docAbstractionFunctions() { debug(ancestor_markup) { writeln("marked up: ", _ancestors_markup); } return _ancestors_markup; } - @safe int[] _get_ancestors_collapsed(ObjGenericComposite obj, int[] _ancestors_collapsed) { + int[] _get_ancestors_collapsed(ObjGenericComposite obj, int[] _ancestors_collapsed) { if (obj.metainfo.is_a == "heading") { if (obj.metainfo.heading_lev_collapsed == 1) { _ancestors_collapsed = [ @@ -4573,7 +4574,7 @@ template docAbstractionFunctions() { // ↑ - ancestors // ↓ - descendants // descendants - @safe auto after_doc_get_descendants()(ObjGenericComposite[] document_sections) { + auto after_doc_get_descendants()(ObjGenericComposite[] document_sections) { int[string] _heading_ocn_descendants; string[] _ocn_open_key = ["","","","","","","",""]; auto _doc_sect_length = document_sections.length - 1; @@ -4622,7 +4623,7 @@ template docAbstractionFunctions() { } // ↑ - descendants // ↓ - assertions - @safe pure void assertions_doc_structure()( + pure void assertions_doc_structure()( string[string] an_object, string an_object_key, int[string] lv @@ -5195,7 +5196,7 @@ template docAbstractionFunctions() { // ↑ - assertions } template docSectKeysSeq() { - @safe auto docSectKeysSeq(string[][string] document_section_keys_sequenced) { + auto docSectKeysSeq(string[][string] document_section_keys_sequenced) { struct doc_sect_keys_seq { string[] scroll() { return document_section_keys_sequenced["scroll"]; diff --git a/src/doc_reform/meta/metadoc_object_setter.d b/src/doc_reform/meta/metadoc_object_setter.d index 29d527b..7bfaebf 100644 --- a/src/doc_reform/meta/metadoc_object_setter.d +++ b/src/doc_reform/meta/metadoc_object_setter.d @@ -53,6 +53,7 @@ metadoc_object_setter.d +/ module doc_reform.meta.metadoc_object_setter; +@safe: template ObjectSetter() { /+ structs +/ struct DocObj_TxtAttrib_ { @@ -118,25 +119,25 @@ template ObjectSetter() { int o_n_bibliography = 0; int o_n_book_index = 0; int o_n_blurb = 0; - @safe string object_number_substantive() const @property { + string object_number_substantive() const @property { return (o_n_substantive == 0) ? "" : o_n_substantive.to!string; } - @safe string object_number_non_substantive() const @property { + string object_number_non_substantive() const @property { return (o_n_non_substantive == 0) ? "" : o_n_non_substantive.to!string; } - @safe string object_number_glossary() const @property { + string object_number_glossary() const @property { return (o_n_glossary == 0) ? "" : o_n_glossary.to!string; } - @safe string object_number_bibliography() const @property { + string object_number_bibliography() const @property { return (o_n_bibliography == 0) ? "" : o_n_bibliography.to!string; } - @safe string object_number_book_index() const @property { + string object_number_book_index() const @property { return (o_n_book_index == 0) ? "" : o_n_book_index.to!string; } - @safe string object_number_blurb() const @property { + string object_number_blurb() const @property { return (o_n_blurb == 0) ? "" : o_n_blurb.to!string; } - @safe string marked_up_level() const @property { + string marked_up_level() const @property { string _out; switch (heading_lev_markup) { case 0 : _out = "A"; break; @@ -151,7 +152,7 @@ template ObjectSetter() { } return _out; } - @safe string object_number() const @property { + string object_number() const @property { return (ocn == 0) ? "" : ocn.to!string; } bool object_number_off = false; @@ -370,7 +371,7 @@ template ObjectSetter() { enum OCNtype { ocn, non, bkidx, } enum DomTags { none, open, close, close_and_open, open_still, } enum Substitute { match, markup, } - @safe static auto eN() { + static auto eN() { struct _e { enum bi { off, diff --git a/src/doc_reform/meta/metadoc_show_config.d b/src/doc_reform/meta/metadoc_show_config.d index ed3afe0..b75bd2b 100644 --- a/src/doc_reform/meta/metadoc_show_config.d +++ b/src/doc_reform/meta/metadoc_show_config.d @@ -48,8 +48,9 @@ +/ module doc_reform.meta.metadoc_show_config; +@safe: template spineShowSiteConfig() { - @safe void spineShowSiteConfig(O,T)( + void spineShowSiteConfig(O,T)( O opt_action, T config, ) { @@ -136,7 +137,7 @@ template spineShowSiteConfig() { } } template spineShowConfig() { - @safe void spineShowConfig(T)( + void spineShowConfig(T)( T doc_matters, ) { import diff --git a/src/doc_reform/meta/metadoc_show_make.d b/src/doc_reform/meta/metadoc_show_make.d index 3a7b67a..516bc65 100644 --- a/src/doc_reform/meta/metadoc_show_make.d +++ b/src/doc_reform/meta/metadoc_show_make.d @@ -48,8 +48,9 @@ +/ module doc_reform.meta.metadoc_show_make; +@safe: template spineShowMake() { - @safe void spineShowMake(T)( + void spineShowMake(T)( T doc_matters, ) { import diff --git a/src/doc_reform/meta/metadoc_show_metadata.d b/src/doc_reform/meta/metadoc_show_metadata.d index 0804a6d..1c95c12 100644 --- a/src/doc_reform/meta/metadoc_show_metadata.d +++ b/src/doc_reform/meta/metadoc_show_metadata.d @@ -48,8 +48,9 @@ +/ module doc_reform.meta.metadoc_show_metadata; +@safe: template spineShowMetaData() { - @safe void spineShowMetaData(T)( + void spineShowMetaData(T)( T doc_matters, ) { import diff --git a/src/doc_reform/meta/metadoc_show_summary.d b/src/doc_reform/meta/metadoc_show_summary.d index aea875a..54c3f8c 100644 --- a/src/doc_reform/meta/metadoc_show_summary.d +++ b/src/doc_reform/meta/metadoc_show_summary.d @@ -48,8 +48,9 @@ +/ module doc_reform.meta.metadoc_show_summary; +@safe: template spineMetaDocSummary() { - @safe void spineMetaDocSummary(S,T)( + void spineMetaDocSummary(S,T)( const S doc_abstraction, T doc_matters, ) { diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d index aace769..e00867a 100644 --- a/src/doc_reform/meta/rgx.d +++ b/src/doc_reform/meta/rgx.d @@ -51,6 +51,7 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.meta.rgx; +@safe: static template spineRgxIn() { static struct RgxI { /+ misc +/ diff --git a/src/doc_reform/meta/rgx_files.d b/src/doc_reform/meta/rgx_files.d index 46d0d7f..98dcbd2 100644 --- a/src/doc_reform/meta/rgx_files.d +++ b/src/doc_reform/meta/rgx_files.d @@ -51,6 +51,7 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.meta.rgx_files; +@safe: static template spineRgxFiles() { static struct RgxFiles { static src_pth_sst_or_ssm = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.](?Pss[tm]))$`); diff --git a/src/doc_reform/meta/rgx_yaml_tags.d b/src/doc_reform/meta/rgx_yaml_tags.d index d2f21da..86f3e99 100644 --- a/src/doc_reform/meta/rgx_yaml_tags.d +++ b/src/doc_reform/meta/rgx_yaml_tags.d @@ -51,6 +51,7 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.meta.rgx_yaml; +@safe: static template spineRgxYamlTags() { static struct RgxYaml { static yaml_tag_is_str = ctRegex!(`:str$`); diff --git a/src/doc_reform/share/defaults.d b/src/doc_reform/share/defaults.d index 13cf69f..e3f0a0c 100644 --- a/src/doc_reform/share/defaults.d +++ b/src/doc_reform/share/defaults.d @@ -51,9 +51,10 @@ shared default settings +/ module doc_reform.share.defaults; +@safe: template Msg() { import std.stdio; - @safe auto Msg(I)(I doc_matters) { + auto Msg(I)(I doc_matters) { struct Msg_ { void v()(string message) { if (doc_matters.opt.action.vox_gt1) { diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index fc9d903..ef1a484 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -54,6 +54,7 @@ name "spine" description "A SiSU inspired document parser written in D." homepage "https://sisudoc.org" +/ +@safe: import std.algorithm, std.datetime, @@ -768,20 +769,20 @@ string program_name = "spine"; } } OptActions _opt_action = OptActions(); - @safe auto program_info() { + auto program_info() { struct ProgramInfo { - @safe string project() { + string project() { return project_name; } - @safe string name() { + string name() { return program_name; } - @safe string ver() { + string ver() { return format("%s.%s.%s", _ver.major, _ver.minor, _ver.patch, ); } - @safe string compiler() { + string compiler() { return format ("%s D:%s, %s %s", __VENDOR__, __VERSION__, bits, os, @@ -793,7 +794,7 @@ string program_name = "spine"; @trusted string name_version_and_compiler() { return format("%s-%s (%s)", name, ver, compiler); } - @safe auto time_output_generated() { + auto time_output_generated() { auto _st = Clock.currTime(UTC()); auto _t = TimeOfDay(_st.hour, _st.minute, _st.second); auto _time = _st.year.to!string -- cgit v1.2.3