From 24c9ed3645178a6ee2abbd9201fa4643dba068e2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 14 May 2019 11:35:24 -0400 Subject: review, reduce use of auto --- org/default_misc.org | 72 +-- org/doc_reform.org | 86 +-- org/meta_abstraction.org | 768 ++++++++++----------------- org/meta_conf_make_meta.org | 66 +-- org/output_hub.org | 2 +- org/output_sqlite.org | 162 +++--- org/output_xmls.org | 68 ++- org/source_files_read.org | 32 +- src/doc_reform/doc_reform.d | 80 +-- src/doc_reform/meta/conf_make_meta_json.d | 2 +- src/doc_reform/meta/conf_make_meta_structs.d | 58 +- src/doc_reform/meta/conf_make_meta_toml.d | 6 +- src/doc_reform/meta/defaults.d | 72 +-- src/doc_reform/meta/metadoc_from_src.d | 761 +++++++++----------------- src/doc_reform/meta/metadoc_summary.d | 6 +- src/doc_reform/output/defaults.d | 64 +-- src/doc_reform/output/html.d | 4 +- src/doc_reform/output/hub.d | 2 +- src/doc_reform/output/sqlite.d | 156 +++--- src/doc_reform/output/xmls.d | 64 +-- src/doc_reform/source/read_config_files.d | 26 +- src/doc_reform/source/read_source_files.d | 6 +- 22 files changed, 1041 insertions(+), 1522 deletions(-) diff --git a/org/default_misc.org b/org/default_misc.org index 6866c85..8c901ca 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -86,7 +86,7 @@ template DocReformRgxInitFlags() { #+BEGIN_SRC d template DocReformNode() { static string[string] node_metadata_heading_str() { - auto _node = [ + string[string] _node = [ "is" : "", "ocn" : "", "marked_up_lev" : "", @@ -97,7 +97,7 @@ template DocReformNode() { return _node; } static int[string] node_metadata_heading_int() { - auto _node = [ + int[string] _node = [ "ocn" : 0, // decide whether to use or keep? "ptr_doc_object" : 0, "ptr_html_segnames" : 0, @@ -110,7 +110,7 @@ template DocReformNode() { return _node; } static string[string] node_metadata_para_str() { - auto _node = [ + string[string] _node = [ "is" : "", "ocn" : "", "attrib" : "", @@ -118,7 +118,7 @@ template DocReformNode() { return _node; } static int[string] node_metadata_para_int() { - auto _node = [ + int[string] _node = [ "ocn" : 0, "indent_base" : 0, "indent_hang" : 0, @@ -225,36 +225,36 @@ import template InternalMarkup() { import std.array; static struct InlineMarkup { - auto en_a_o = "【"; auto en_a_c = "】"; - auto en_b_o = "〖"; auto en_b_c = "〗"; - auto quote_o = "“"; auto quote_c = "”"; - auto ff_o = "┨"; auto ff_c = "┣"; // fontface - auto lnk_o = "┥"; auto lnk_c = "┝"; - auto url_o = "┤"; auto url_c = "├"; - auto emph = "*"; - auto bold = "!"; - auto italic = "/"; - auto underscore = "_"; - auto superscript = "^"; - auto subscript = ","; - auto mono = "■"; - auto cite = "‖"; - auto mark_internal_site_lnk = "¤"; - auto nbsp = "░"; - auto br_line = "┘"; - auto br_nl = "┙"; - auto br_paragraph = "┚"; - auto br_obj = "break_obj"; - auto br_page_line = "┼"; - auto br_page = "┿"; - auto br_page_new = "╂"; - auto tc_s = "┊"; - auto tc_o = "┏"; - auto tc_c = "┚"; - auto tc_p = "┆"; - auto img = "☼"; - auto on_o = "「"; auto on_c = "」"; - auto mk_bullet = "● "; + string en_a_o = "【"; string en_a_c = "】"; + string en_b_o = "〖"; string en_b_c = "〗"; + string quote_o = "“"; string quote_c = "”"; + string ff_o = "┨"; string ff_c = "┣"; // fontface + string lnk_o = "┥"; string lnk_c = "┝"; + string url_o = "┤"; string url_c = "├"; + string emph = "*"; + string bold = "!"; + string italic = "/"; + string underscore = "_"; + string superscript = "^"; + string subscript = ","; + string mono = "■"; + string cite = "‖"; + string mark_internal_site_lnk = "¤"; + string nbsp = "░"; + string br_line = "┘"; + string br_nl = "┙"; + string br_paragraph = "┚"; + string br_obj = "break_obj"; + string br_page_line = "┼"; + string br_page = "┿"; + string br_page_new = "╂"; + string tc_s = "┊"; + string tc_o = "┏"; + string tc_c = "┚"; + string tc_p = "┆"; + string img = "☼"; + string on_o = "「"; auto on_c = "」"; + string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); return _indent_spaces; @@ -342,11 +342,11 @@ template DocReformLanguageCodes() { return _lang_codes; } static string[] code_arr_ptr() { - auto _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",]; + 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; } static string[] code_arr() { - auto _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"]; + 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; } static auto codes_() { diff --git a/org/doc_reform.org b/org/doc_reform.org index 5b1fc23..d805744 100644 --- a/org/doc_reform.org +++ b/org/doc_reform.org @@ -415,13 +415,13 @@ if (helpInfo.helpWanted) { #+BEGIN_SRC d enum outTask { pod, source, sqlite, sqlite_multi, epub, html_scroll, html_seg, html_stuff } struct OptActions { - auto assertions() { + bool assertions() { return opts["assertions"]; } - auto concordance() { + bool concordance() { return opts["concordance"]; } - auto css_theme_default() { + bool css_theme_default() { bool _is_light; if (opts["light"] || opts["theme-light"]) { _is_light = true; @@ -432,79 +432,79 @@ struct OptActions { } return _is_light; } - auto debug_do() { + bool debug_do() { return opts["debug"]; } - auto digest() { + bool digest() { return opts["digest"]; } - auto epub() { + bool epub() { return opts["epub"]; } - auto html() { + bool html() { bool _is; if ( opts["html"] || opts["html-seg"] || opts["html-scroll"]) { _is = true; } else { _is = false; } return _is; } - auto html_seg() { + bool html_seg() { bool _is; if ( opts["html"] || opts["html-seg"]) { _is = true; } else { _is = false; } return _is; } - auto html_scroll() { + bool html_scroll() { bool _is; if ( opts["html"] || opts["html-scroll"]) { _is = true; } else { _is = false; } return _is; } - auto html_stuff() { + bool html_stuff() { bool _is; if (opts["html"] || opts["html-scroll"] || opts["html-seg"]) { _is = true; } else { _is = false; } return _is; } - auto manifest() { + bool manifest() { return opts["manifest"]; } - auto ocn() { + bool ocn() { return opts["ocn"]; } - auto quiet() { + bool quiet() { return opts["quiet"]; } - auto pod() { + bool pod() { return opts["pod"]; } - auto source() { + bool source() { return opts["source"]; } - auto sqlite_discrete() { + bool sqlite_discrete() { return opts["sqlite-discrete"]; } - auto sqlite_db_drop() { + bool sqlite_db_drop() { bool _is; if ( opts["sqlite-db-recreate"] || opts["sqlite-db-drop"]) { _is = true; } else { _is = false; } return _is; } - auto sqlite_db_create() { + bool sqlite_db_create() { bool _is; if ( opts["sqlite-db-recreate"] || opts["sqlite-db-create"]) { _is = true; } else { _is = false; } return _is; } - auto sqlite_delete() { + bool sqlite_delete() { return opts["sqlite-delete"]; } - auto sqlite_update() { + bool sqlite_update() { bool _is; if (opts["sqlite-update"] || opts["sqlite-insert"]) { _is = true; } else { _is = false; } return _is; } - auto sqlite_shared_db_action() { + bool sqlite_shared_db_action() { bool _is; if (opts["sqlite-db-recreate"] || opts["sqlite-db-create"] @@ -514,49 +514,49 @@ struct OptActions { ) { _is = true; } else { _is = false; } return _is; } - auto text() { + bool text() { return opts["text"]; } - auto verbose() { + bool verbose() { bool _is; if (opts["verbose"] || opts["very-verbose"]) { _is = true; } else { _is = false; } return _is; } - auto very_verbose() { + bool very_verbose() { return opts["very-verbose"]; } - auto xhtml() { + bool xhtml() { return opts["xhtml"]; } - auto section_toc() { + bool section_toc() { return opts["section_toc"]; } - auto section_body() { + bool section_body() { return opts["section_body"]; } - auto section_endnotes() { + bool section_endnotes() { return opts["section_endnotes"]; } - auto section_glossary() { + bool section_glossary() { return opts["section_glossary"]; } - auto section_biblio() { + bool section_biblio() { return opts["section_biblio"]; } - auto section_bookindex() { + bool section_bookindex() { return opts["section_bookindex"]; } - auto section_blurb() { + bool section_blurb() { return opts["section_blurb"]; } - auto backmatter() { + bool backmatter() { return opts["backmatter"]; } - auto skip_output() { + bool skip_output() { return opts["skip-output"]; } - auto workon() { + bool workon() { return opts["workon"]; } auto languages_set() { @@ -568,7 +568,7 @@ struct OptActions { auto sqlite_filename() { return settings["sqlite-filename"]; } - auto parallelise() { + bool parallelise() { bool _is; if (opts["parallel"] == true) { _is = true; @@ -589,7 +589,7 @@ struct OptActions { } else { _is = false; } return _is; } - auto parallelise_subprocesses() { + bool parallelise_subprocesses() { return opts["parallel-subprocesses"]; } auto output_task_scheduler() { @@ -617,7 +617,7 @@ struct OptActions { } return schedule.sort().uniq; } - auto abstraction() { + bool abstraction() { bool _is; if (opts["abstraction"] || concordance @@ -646,7 +646,7 @@ auto program_info() { string name() { return program_name; } - auto ver() { + string ver() { string ver_ = format( "%s.%s.%s", _ver.major, _ver.minor, _ver.patch, @@ -716,7 +716,7 @@ foreach(arg; args[1..$]) { contents_location ~ "»" ); auto contents_location_pth_ = (contents_location).to!string; - auto lang_rgx_ = regex(r"/(" ~ _opt_action.languages_set.join("|") ~ ")/"); + Regex!(char) lang_rgx_ = regex(r"/(" ~ _opt_action.languages_set.join("|") ~ ")/"); if (_opt_action.languages_set[0] == "all" || (contents_location_pth_).match(lang_rgx_) ) { @@ -1247,9 +1247,9 @@ if ((_opt_action.debug_do) #+BEGIN_SRC d :tangle "../src/doc_reform/meta/metadoc_summary.d" module doc_reform.meta.metadoc_summary; template DocReformAbstractionSummary() { - auto DocReformAbstractionSummary(S,T)( - auto ref const S doc_abstraction, - auto ref T doc_matters, + void DocReformAbstractionSummary(S,T)( + const S doc_abstraction, + T doc_matters, ) { <> mixin InternalMarkup; diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 8f2b76a..35d443f 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -29,64 +29,61 @@ Process markup document, create document abstraction. +/ module doc_reform.meta.metadoc_from_src; template DocReformDocAbstraction() { - /+ ↓ abstraction imports +/ + /+ ↓ abstraction imports +/ <> - /+ ↓ abstraction mixins +/ + /+ ↓ abstraction mixins +/ <> - /+ ↓ abstraction struct init +/ + /+ ↓ abstraction struct init +/ <> <> - /+ ↓ abstract marked up document +/ - auto DocReformDocAbstraction(Src,CMM,Opt,Mfst)( - Src markup_sourcefile_content, - CMM conf_make_meta, - Opt opt_action, - Mfst manifest_matter, - bool _new_doc + /+ ↓ abstract marked up document +/ + auto DocReformDocAbstraction(CMM,Opt,Mf)( + char[][] markup_sourcefile_content, + CMM conf_make_meta, + Opt opt_action, + Mf manifest_matter, + bool _new_doc ) { static auto rgx = Rgx(); - debug(asserts) { - static assert(is(typeof(markup_sourcefile_content) == char[][])); - } - /+ ↓ abstraction init +/ + /+ ↓ abstraction init +/ <> - /+ abstraction init ↑ +/ + /+ abstraction init ↑ +/ <> - /+ ↓ ↻ loop markup document/text line by line +/ + /+ ↓ ↻ loop markup document/text line by line +/ srcDocLoop: - foreach (line; markup_sourcefile_content) { /+ ↓ markup document/text line by line +/ - // "line" variable can be empty but should never be null + foreach (line; markup_sourcefile_content) { /+ ↓ markup document/text line by line +/ + // "line" variable can be empty but should never be null <> if (obj_type_status["code"] == TriState.on) { <> - } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { /+ object other than "code block" object +/ - /+ (includes regular text paragraph, headings & blocks other than code) +/ - /+ heading, glossary, blurb, poem, group, block, quote, table +/ + } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { /+ object other than "code block" object +/ + /+ (includes regular text paragraph, headings & blocks other than code) +/ + /+ heading, glossary, blurb, poem, group, block, quote, table +/ <> - } else { /+ not within a block group +/ + } else { /+ not within a block group +/ <> if (line.matchFirst(rgx.block_open)) { <> - } else if (!line.empty) { /+ line not empty +/ - /+ non blocks (headings, paragraphs) & closed blocks +/ + } else if (!line.empty) { /+ line not empty +/ + /+ non blocks (headings, paragraphs) & closed blocks +/ <> - } else if (obj_type_status["blocks"] == TriState.closing) { /+ line empty, with blocks flag +/ + } else if (obj_type_status["blocks"] == TriState.closing) { /+ line empty, with blocks flag +/ <> - } else { /+ line.empty, post contents, empty variables: +/ + } else { /+ line.empty, post contents, empty variables: +/ <> - } // close else for line empty - } // close else for not the above - } // close after non code, other blocks or regular text + } // close else for line empty + } // close else for not the above + } // close after non code, other blocks or regular text <> - } /+ ← srcDocLoop closed: loop markup document/text line by line +/ - /+ ↓ post loop markup document/text +/ + } /+ ← srcDocLoop closed: loop markup document/text line by line +/ + /+ ↓ post loop markup document/text +/ <> <> <> <> - /+ post loop markup document/text ↑ +/ - } /+ ← closed: abstract doc source +/ - /+ ↓ abstraction functions +/ + /+ post loop markup document/text ↑ +/ + } /+ ← closed: abstract doc source +/ + /+ ↓ abstraction functions +/ <> <> <> @@ -104,10 +101,10 @@ template DocReformDocAbstraction() { <> <> <> - /+ abstraction functions ↑ +/ - /+ ↓ abstraction function emitters +/ + /+ abstraction functions ↑ +/ + /+ ↓ abstraction function emitters +/ <> - /+ +/ + /+ +/ <> <> <> @@ -115,28 +112,28 @@ template DocReformDocAbstraction() { <> <> <> - /+ +/ + /+ +/ <> <> <> <> <> <> - /+ +/ + /+ +/ <> <> <> - /+ +/ + /+ +/ <> - /+ +/ + /+ +/ <> - /+ +/ + /+ +/ <> - /+ abstraction functions emitters ↑ +/ - /+ ↓ abstraction functions assertions +/ + /+ abstraction functions emitters ↑ +/ + /+ ↓ abstraction functions assertions +/ <> - /+ abstraction functions assertions ↑ +/ -} /+ ← closed: template DocReformDocAbstraction +/ + /+ abstraction functions assertions ↑ +/ +} /+ ← closed: template DocReformDocAbstraction +/ <> #+END_SRC @@ -247,9 +244,9 @@ enum DomTags { none, open, close, close_and_open, open_still, } #+name: abs_top_init_struct #+BEGIN_SRC d -pure auto obj_heading_ancestors(O)( - O obj, - string[] lv_ancestors_txt, +pure ObjGenericComposite obj_heading_ancestors()( + ObjGenericComposite obj, + string[] lv_ancestors_txt, ) { switch (obj.metainfo.heading_lev_markup) { case 0: @@ -306,10 +303,10 @@ pure auto obj_heading_ancestors(O)( #+name: abs_top_init_struct #+BEGIN_SRC d -pure auto obj_dom_structure_set_markup_tags(O)( - O obj, - int[] dom, - int lev +pure ObjGenericComposite obj_dom_structure_set_markup_tags()( + ObjGenericComposite obj, + int[] dom, + int lev ) { foreach (i; 0 .. 8) { if (i < lev) { @@ -356,10 +353,10 @@ pure auto obj_dom_structure_set_markup_tags(O)( #+name: abs_top_init_struct #+BEGIN_SRC d -pure auto obj_dom_set_collapsed_tags(O)( - O obj, - int[] dom, - int lev +pure ObjGenericComposite obj_dom_set_collapsed_tags()( + ObjGenericComposite obj, + int[] dom, + int lev ) { foreach (i; 0 .. 8) { if (i < lev) { @@ -420,7 +417,7 @@ static auto inline_markup_faces(L)(L line) { } return line; } -static auto links_and_images(L)(L obj_txt) { +static string links_and_images()(string obj_txt) { static auto rgx = Rgx(); static auto mkup = InlineMarkup(); if (obj_txt.match(rgx.smid_inline_url_generic)) { @@ -473,10 +470,10 @@ enum sObj { content, anchor_tag, notes_reg, notes_star, links, image_no_dimensio #+name: abs_inline_para_tag_associations #+BEGIN_SRC d -auto inline_para_link_anchor(O,St,TA)( - O an_object, - St tag_in_seg, - TA tag_assoc +string[string][string] inline_para_link_anchor()( + string[string] an_object, + string[string] tag_in_seg, + string[string][string] tag_assoc ) { static auto rgx = Rgx(); if (auto m = an_object["substantive"].match(rgx.inline_link_anchor)) { @@ -577,7 +574,7 @@ string[string] heading_match_str = [ "h_3": "^(none)", "h_4": "^(none)" ]; -auto heading_match_rgx = [ +Regex!char[string] heading_match_rgx = [ "h_A": regex(r"^(none)"), "h_B": regex(r"^(none)"), "h_C": regex(r"^(none)"), @@ -1711,7 +1708,7 @@ debug(bibliosection) { ***** bibliography components -auto biblio_entry_tags_jsonstr = `{ +JSONValue biblio_entry_tags_jsonstr = `{ "is" : "", "sortby_deemed_author_year_title" : "", "deemed_author" : "", @@ -2266,7 +2263,7 @@ Build here: #+name: abs_post #+BEGIN_SRC d -auto get_decendants(S)(S document_sections) { +auto get_decendants()(ObjGenericComposite[] document_sections) { int[string] _heading_ocn_decendants; string[] _ocn_open_key = ["","","","","","","",""]; auto _doc_sect_length = document_sections.length - 1; @@ -2320,7 +2317,7 @@ auto get_decendants(S)(S document_sections) { #+name: abs_post #+BEGIN_SRC d string[] _images; -auto extract_images(S)(S content_block) { +string[] extract_images()(string content_block) { string[] images_; if (auto m = content_block.matchAll(rgx.image)) { images_ ~= m.captures[1]; @@ -2923,7 +2920,7 @@ comp_obj_heading_ = comp_obj_heading_.obj_heading_ancestors(lv_ancestors_txt); #+name: abs_post #+BEGIN_SRC d -auto document_the = [ +ObjGenericComposite[][string] document_the = [ "head": the_document_head_section, "toc": the_table_of_contents_section, /+ substantive/body: +/ @@ -2985,8 +2982,8 @@ if ((opt_action.html) #+name: abs_post #+BEGIN_SRC d -auto segnames_4 = segnames["html"].dup; -auto segnames_lv1_to_4 = segnames["epub"].dup; +string[] segnames_4 = segnames["html"].dup; +string[] segnames_lv1_to_4 = segnames["epub"].dup; debug(segnames) { writeln("segnames_lv4: ", segnames_4); writeln("segnames_lv1_to_4: ", segnames_lv1_to_4); @@ -3096,10 +3093,7 @@ functions used in document abstraction #+name: abs_functions_object_reset #+BEGIN_SRC d -static auto object_reset(O)(O an_object) { - debug(asserts) { - static assert(is(typeof(an_object) == string[string])); - } +static string[string] object_reset()(string[string] an_object) { an_object.remove("body_nugget"); an_object.remove("substantive"); an_object.remove("is"); @@ -3113,16 +3107,11 @@ static auto object_reset(O)(O an_object) { #+name: abs_functions_header_set_common #+BEGIN_SRC d -auto flow_common_reset_(L,O,T)( - return ref L line_occur, - return ref O an_object, - return ref T obj_type_status +void flow_common_reset_()( + return ref int[string] line_occur, + return ref string[string] an_object, + return ref int[string] obj_type_status, ) { - debug(asserts) { - static assert(is(typeof(line_occur) == int[string])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } line_occur["heading"] = State.off; line_occur["para"] = State.off; obj_type_status["heading"] = State.off; @@ -3135,14 +3124,10 @@ auto flow_common_reset_(L,O,T)( #+name: abs_functions_ocn_status #+BEGIN_SRC d -static auto _check_ocn_status_(L,T)( - L line, - T obj_type_status +static int[string] _check_ocn_status_()( + char[] line, + int[string] obj_type_status, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (!(line.empty) && (obj_type_status["ocn_status_off_for_multiple_objects"] == OCN_off_block_status.off) @@ -3205,13 +3190,10 @@ static auto _check_ocn_status_(L,T)( #+name: abs_functions_substitutions #+BEGIN_SRC d -auto _doc_header_and_make_substitutions_(L,CMM)( - L line, - CMM conf_make_meta, +char[] _doc_header_and_make_substitutions_(CMM)( + char[] line, + CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - } enum Substitute { match, markup, } if (conf_make_meta.make.substitute) { foreach(substitution_pair; conf_make_meta.make.substitute) { @@ -3229,13 +3211,10 @@ auto _doc_header_and_make_substitutions_(L,CMM)( #+name: abs_functions_substitutions #+BEGIN_SRC d -auto _doc_header_and_make_substitutions_fontface_(L,CMM)( - L line, - CMM conf_make_meta, +char[] _doc_header_and_make_substitutions_fontface_(CMM)( + char[] line, + CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - } enum Substitute { match, markup, } if ( conf_make_meta.make.bold) { line = line.replaceAll( @@ -3265,17 +3244,12 @@ auto _doc_header_and_make_substitutions_fontface_(L,CMM)( #+name: abs_functions_block #+BEGIN_SRC d -void flow_txt_block_start(L,T,N)( - L line, - return ref T obj_type_status, +void flow_txt_block_start()( + char[] line, + return ref int[string] obj_type_status, return ref uint[string] dochas, - return ref N object_number_poem + return ref string[string] object_number_poem ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(obj_type_status) == int[string])); - static assert(is(typeof(object_number_poem) == string[string])); - } #+END_SRC ****** block (various) curly open :curly: @@ -3554,16 +3528,11 @@ void flow_txt_block_start(L,T,N)( #+name: abs_functions_block_code #+BEGIN_SRC d -void flow_txt_block_code(L,O,T)( - L line, - return ref O an_object, - return ref T obj_type_status +void flow_txt_block_code()( + char[] line, + return ref string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_code"] == TriState.on) { if (line.matchFirst(rgx.block_curly_code_close)) { @@ -3608,10 +3577,7 @@ void flow_txt_block_code(L,O,T)( #+name: abs_functions_block_biblio #+BEGIN_SRC d -final string biblio_tag_map(A)(A abr) { - debug(asserts) { - static assert(is(typeof(abr) == string)); - } +final string biblio_tag_map()(string abr) { auto btm = [ "au" : "author_raw", "ed" : "editor_raw", @@ -3636,10 +3602,7 @@ final string biblio_tag_map(A)(A abr) { #+name: none #+BEGIN_SRC d -final string biblio_tag_map_(A)(A abr) { - debug(asserts) { - static assert(is(typeof(abr) == string)); - } +final string biblio_tag_map_()(string abr) { string name; switch (abr) { case "au": name="author_raw"; break; @@ -3801,16 +3764,11 @@ void flow_txt_block_biblio( #+name: abs_functions_block_quote #+BEGIN_SRC d -auto flow_txt_block_quote(L,O,T)( - L line, - O an_object, - return ref T obj_type_status +string[string] flow_txt_block_quote()( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_quote"] == TriState.on) { if (line.matchFirst(rgx.block_curly_quote_close)) { @@ -3854,16 +3812,11 @@ auto flow_txt_block_quote(L,O,T)( #+name: abs_functions_block_group #+BEGIN_SRC d -auto flow_txt_block_group(L,O,T)( - L line, - O an_object, - return ref T obj_type_status +string[string] flow_txt_block_group()( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_group"] == State.on) { if (line.matchFirst(rgx.block_curly_group_close)) { @@ -3908,16 +3861,11 @@ auto flow_txt_block_group(L,O,T)( #+name: abs_functions_block_block #+BEGIN_SRC d -auto flow_txt_block_block(L,O,T)( - L line, - O an_object, - return ref T obj_type_status +string[string] flow_txt_block_block()( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_block"] == TriState.on) { if (line.matchFirst(rgx.block_curly_block_close)) { @@ -3960,22 +3908,15 @@ why extra object stuff only in poem/verse? #+name: abs_functions_block_poem #+BEGIN_SRC d -auto flow_txt_block_poem(L,O,T,C,N,CMM,Ts)( - L line, - O an_object, - return ref T obj_type_status, - return ref C cntr, - N object_number_poem, - CMM conf_make_meta, - Ts tag_in_seg, +string[string] flow_txt_block_poem(CMM)( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status, + return ref int cntr, + string[string] object_number_poem, + CMM conf_make_meta, + string[string] tag_in_seg, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - static assert(is(typeof(cntr) == int)); - static assert(is(typeof(object_number_poem) == string[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_poem"] == TriState.on) { if (line.matchFirst(rgx.block_curly_poem_close)) { @@ -4231,17 +4172,12 @@ you need: #+name: abs_functions_block_table #+BEGIN_SRC d -auto flow_txt_block_table(L,O,T,CMM)( - L line, - O an_object, - return ref T obj_type_status, - return ref CMM conf_make_meta, +string[string] flow_txt_block_table(CMM)( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status, + return ref CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_table"] == TriState.on) { if (line.matchFirst(rgx.block_curly_table_close)) { @@ -4355,7 +4291,7 @@ void flow_table_closed_make_special_notation_table_(N,CMM)( #+name: abs_functions_block_line_status_empty #+BEGIN_SRC d -auto flow_block_flag_line_empty_(B,N,CMM,Ts)( +string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( char[] line, string[string] an_object, B bookindex_extract_hash, @@ -4711,19 +4647,13 @@ auto flow_block_flag_line_empty_(B,N,CMM,Ts)( #+name: abs_functions_book_index #+BEGIN_SRC d -auto flow_book_index_(L,I,O,T,B)( - L line, - O an_object, - I book_idx_tmp, - return ref T obj_type_status, - B opt_action, +string[string] flow_book_index_(B)( + char[] line, + string[string] an_object, + return ref string book_idx_tmp, + return ref int[string] obj_type_status, + B opt_action, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(book_idx_tmp) == string)); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (auto m = line.match(rgx.book_index)) { /+ match book_index +/ debug(bookindexmatch) { @@ -4774,20 +4704,13 @@ auto flow_book_index_(L,I,O,T,B)( #+name: abs_functions_heading #+BEGIN_SRC d -auto flow_heading_found_(L,H,X,R,T)( - L line, - H heading_match_str, - X _make_unmarked_headings, - return ref R heading_match_rgx, - return ref T obj_type_status +string[string] flow_heading_found_()( + char[] line, + string[string] heading_match_str, + string[] _make_unmarked_headings, + return ref Regex!(char)[string] heading_match_rgx, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(_make_unmarked_headings) == string[])); - static assert(is(typeof(heading_match_str) == string[string])); - static assert(is(typeof(heading_match_rgx) == Regex!(char)[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if ((_make_unmarked_headings.length > 2) && (obj_type_status["make_headings"] == State.off)) { /+ headings found +/ @@ -4868,18 +4791,12 @@ auto flow_heading_found_(L,H,X,R,T)( #+name: abs_functions_heading #+BEGIN_SRC d -auto flow_heading_make_set_(L,C,R,T)( - L line, - C line_occur, - return ref R heading_match_rgx, - return ref T obj_type_status +char[] flow_heading_make_set_()( + char[] line, + int[string] line_occur, + return ref Regex!(char)[string] heading_match_rgx, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(line_occur) == int[string])); - static assert(is(typeof(heading_match_rgx) == Regex!(char)[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } if ((obj_type_status["make_headings"] == State.on) && ((line_occur["para"] == State.off) && (line_occur["heading"] == State.off)) @@ -4936,25 +4853,16 @@ auto flow_heading_make_set_(L,C,R,T)( #+name: abs_functions_heading #+BEGIN_SRC d -auto flow_heading_matched_(L,C,O,K,Lv,Lc,T,CMM)( - L line, - O an_object, - return ref C line_occur, - return ref K an_object_key, - return ref Lv lv, - return ref Lc collapsed_lev, - return ref T obj_type_status, - return ref CMM conf_make_meta, +string[string] flow_heading_matched_(CMM)( + char[] line, + string[string] an_object, + return ref int[string] line_occur, + return ref string an_object_key, + return ref int[string] lv, + return ref int[string] collapsed_lev, + return ref int[string] obj_type_status, + return ref CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(line_occur) == int[string])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(an_object_key) == string)); - static assert(is(typeof(lv) == int[string])); - static assert(is(typeof(collapsed_lev) == int[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (auto m = line.match(rgx.heading)) { /+ heading match +/ ++line_occur["heading"]; @@ -5097,24 +5005,15 @@ auto flow_heading_matched_(L,C,O,K,Lv,Lc,T,CMM)( #+name: abs_functions_para #+BEGIN_SRC d -auto flow_para_match_(L,O,K,I,B,T,C)( - L line, - O an_object, - return ref K an_object_key, - return ref I indent, - return ref B bullet, - return ref T obj_type_status, - return ref C line_occur, +string[string] flow_para_match_()( + char[] line, + string[string] an_object, + return ref string an_object_key, + return ref int[string] indent, + return ref bool bullet, + return ref int[string] obj_type_status, + return ref int[string] line_occur, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(an_object_key) == string)); - static assert(is(typeof(indent) == int[string])); - static assert(is(typeof(bullet) == bool)); - static assert(is(typeof(obj_type_status) == int[string])); - static assert(is(typeof(line_occur) == int[string])); - } static auto rgx = Rgx(); if (line_occur["para"] == State.off) { line = font_faces_line(line); @@ -5165,8 +5064,8 @@ auto flow_para_match_(L,O,K,I,B,T,C)( #+name: abs_functions_para #+BEGIN_SRC d -auto font_faces_line(T)( - T textline, +char[] font_faces_line()( + char[] textline, ) { static auto rgx = Rgx(); static auto mkup = InlineMarkup(); @@ -5194,9 +5093,9 @@ auto font_faces_line(T)( #+name: abs_functions_table #+BEGIN_SRC d -auto flow_table_instructions(O,H)( - return ref O table_object, - return ref H table_head, +ObjGenericComposite flow_table_instructions(H)( + return ref ObjGenericComposite table_object, + H table_head, ) { static auto rgx = Rgx(); table_object.metainfo.is_of_part = "body"; @@ -5225,9 +5124,9 @@ auto flow_table_instructions(O,H)( #+name: abs_functions_table #+BEGIN_SRC d -auto flow_table_array_munge(O,T)( - return ref O table_object, - return ref T table_array, +ObjGenericComposite flow_table_array_munge(T)( + return ref ObjGenericComposite table_object, + return ref T table_array, ) { static auto rgx = Rgx(); static auto mng = InlineMarkup(); @@ -5355,9 +5254,9 @@ auto flow_table_array_munge(O,T)( #+name: abs_functions_table #+BEGIN_SRC d -auto flow_table_substantive_munge(O,T)( - return ref O table_object, - return ref T table_substantive, +ObjGenericComposite flow_table_substantive_munge(T)( + return ref ObjGenericComposite table_object, + return ref T table_substantive, ) { static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); @@ -5377,9 +5276,9 @@ auto flow_table_substantive_munge(O,T)( #+name: abs_functions_table #+BEGIN_SRC d -auto flow_table_substantive_munge_special(O,T)( - return ref O table_object, - return ref T table_substantive, +ObjGenericComposite flow_table_substantive_munge_special(T)( + return ref ObjGenericComposite table_object, + return ref T table_substantive, ) { static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); @@ -5475,10 +5374,7 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - static auto images(Ot)(Ot obj_txt_in) { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } + 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 @@ -5514,10 +5410,7 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in, bool reset_note_numbers) { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } + auto 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; @@ -5587,11 +5480,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - private auto object_notes_and_links_(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) + private auto object_notes_and_links_()(string obj_txt_in, bool reset_note_numbers=false) in { - debug(asserts) { - assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt_out = ""; @@ -5663,11 +5553,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto munge_heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) + auto munge_heading()(string obj_txt_in, bool reset_note_numbers=false) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"] = obj_txt_in @@ -5697,11 +5584,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto munge_para(Ot)(Ot obj_txt_in) + auto munge_para()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=(obj_txt_in) @@ -5722,11 +5606,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string munge_quote(Ot)(Ot obj_txt_in) + string munge_quote()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -5769,11 +5650,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto munge_block(Ot)(Ot obj_txt_in) + auto munge_block()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -5795,11 +5673,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - auto munge_verse(Ot)(Ot obj_txt_in) + auto munge_verse()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -5820,11 +5695,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string munge_code(Ot)(Ot obj_txt_in) + string munge_code()(string obj_txt_in) in { - debug(asserts) { - assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt_in = obj_txt_in.replaceAll(rgx.space, mkup.nbsp); @@ -5841,11 +5713,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string munge_table(Ot)(Ot obj_txt_in) + string munge_table()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -5859,11 +5728,8 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - string munge_comment(Ot)(Ot obj_txt_in) + string munge_comment()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -5896,17 +5762,13 @@ static struct ObjInlineMarkup { #+name: meta_emitters_obj_inline_markup_and_anchor_tags_and_misc #+BEGIN_SRC d - auto obj_inline_markup_and_anchor_tags_and_misc(O,K,CMM)( - O obj_, - K obj_key_, - CMM conf_make_meta, - Flag!"_new_doc" _new_doc + auto obj_inline_markup_and_anchor_tags_and_misc(CMM)( + string[string] obj_, + string obj_key_, + CMM conf_make_meta, + Flag!"_new_doc" _new_doc ) in { - debug(asserts) { - static assert(is(typeof(obj_) == string[string])); - static assert(is(typeof(obj_key_) == string)); - } } body { obj_txt["munge"] = obj_[obj_key_].dup; @@ -6002,34 +5864,24 @@ static struct ObjInlineMarkup { #+name: meta_emitters_obj_inline_markup_table_of_contents #+BEGIN_SRC d - auto _clean_heading_toc_(Toc)( - Toc heading_toc_, + auto _clean_heading_toc_()( + char[] heading_toc_, ) { - debug(asserts) { - static assert(is(typeof(heading_toc_) == char[])); - } auto m = (cast(char[]) heading_toc_).matchFirst(rgx.heading); heading_toc_ = (m.post).replaceAll( rgx.inline_notes_curly_gen, ""); return heading_toc_; }; - auto flow_table_of_contents_gather_headings(O,CMM,Ts,Ta,X,Toc)( - O obj_, - CMM conf_make_meta, - Ts tag_in_seg, - Ta _anchor_tag, - return ref X lev4_subtoc, - Toc the_table_of_contents_section, + ObjGenericComposite[] flow_table_of_contents_gather_headings(CMM)( + string[string] obj_, + CMM conf_make_meta, + string[string] tag_in_seg, + string _anchor_tag, + return ref string[][string] lev4_subtoc, + ObjGenericComposite[] the_table_of_contents_section, ) in { - debug(asserts) { - static assert(is(typeof(obj_) == string[string])); - static assert(is(typeof(tag_in_seg) == string[string])); - static assert(is(typeof(_anchor_tag) == string)); - static assert(is(typeof(lev4_subtoc) == string[][string])); - static assert(is(typeof(the_table_of_contents_section) == ObjGenericComposite[])); - } } body { ObjGenericComposite comp_obj_toc; @@ -6121,16 +5973,12 @@ private: static string heading_number_auto_composite = ""; static string heading_number_auto_composite_segname = ""; static bool[] auto_heading_numbering = [ true, true, true, true]; - static string _configured_auto_heading_numbering_and_segment_anchor_tags(M,O,CMM)( - M munge_, - O obj_, - CMM conf_make_meta, - bool _new_doc, + static string _configured_auto_heading_numbering_and_segment_anchor_tags(CMM)( + string munge_, + string[string] obj_, + CMM conf_make_meta, + bool _new_doc, ) { - debug(asserts) { - static assert(is(typeof(munge_) == string)); - static assert(is(typeof(obj_) == string[string])); - } if (_new_doc) { heading_num = [ 0, 0, 0, 0 ]; heading_number_auto_composite = ""; @@ -6275,15 +6123,11 @@ private: #+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d static int heading_num_lev1 = 0; - static string _make_segment_anchor_tags_if_none_provided(M,Lv)( - M munge_, - Lv lev_, - bool _new_doc + static string _make_segment_anchor_tags_if_none_provided()( + string munge_, + string lev_, + bool _new_doc ) { - debug(asserts) { - static assert(is(typeof(munge_) == string)); - static assert(is(typeof(lev_) == string)); - } if (!(munge_.match(rgx.heading_anchor_tag))) { if (munge_.match(rgx.heading_identify_anchor_tag)) { if (auto m = munge_.match(rgx.heading_extract_named_anchor_tag)) { @@ -6334,17 +6178,12 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_public #+BEGIN_SRC d - string obj_attributes(Oi,OR,OH)( - Oi obj_is_, - OR obj_raw, - OH _comp_obj_heading, + string obj_attributes()( + string obj_is_, + string obj_raw, + ObjGenericComposite _comp_obj_heading, ) in { - debug(asserts) { - static assert(is(typeof(obj_is_) == string)); - static assert(is(typeof(obj_raw) == string)); - static assert(is(typeof(_comp_obj_heading) == ObjGenericComposite)); - } } body { scope(exit) { @@ -6417,11 +6256,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_para_and_blocks(Ot)(Ot obj_txt_in) + string txt_para_and_blocks()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { if (obj_txt_in.matchFirst(rgx.para_bullet)) { @@ -6453,11 +6289,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_heading(Ot)(Ot obj_txt_in) + string txt_heading()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6473,11 +6306,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_para(Ot)(Ot obj_txt_in) + string txt_para()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6493,11 +6323,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_quote(Ot)(Ot obj_txt_in) + string txt_quote()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6513,11 +6340,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_group(Ot)(Ot obj_txt_in) + string txt_group()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6533,11 +6357,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_block(Ot)(Ot obj_txt_in) + string txt_block()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6553,11 +6374,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_verse(Ot)(Ot obj_txt_in) + string txt_verse()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6573,11 +6391,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_code(Ot)(Ot obj_txt_in) + string txt_code()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6593,11 +6408,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_table(Ot)(Ot obj_txt_in) + string txt_table()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -6613,11 +6425,8 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_an_attribute #+BEGIN_SRC d - string txt_comment(Ot)(Ot obj_txt_in) + string txt_comment()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"comment\"," @@ -6633,16 +6442,11 @@ struct ObjAttributes { #+name: meta_emitters_obj_attributes_private_json #+BEGIN_SRC d - string _set_additional_values_parse_as_json(OA,Oi,OH)( - OA _obj_attrib, - Oi obj_is_, - OH _comp_obj_heading, + string _set_additional_values_parse_as_json()( + string _obj_attrib, + string obj_is_, + ObjGenericComposite _comp_obj_heading, ) { - debug(asserts) { - static assert(is(typeof(_obj_attrib) == string)); - static assert(is(typeof(obj_is_) == string)); - static assert(is(typeof(_comp_obj_heading) == ObjGenericComposite)); - } JSONValue oa_j = parseJSON(_obj_attrib); assert( (oa_j.type == JSON_TYPE.OBJECT) @@ -6682,14 +6486,13 @@ struct BookIndexNuggetHash { string[][string][string] bi; string[][string][string] hash_nugget; string[] bi_main_terms_split_arr; - string[][string][string] bookindex_nugget_hash(BI,N,S)( - BI bookindex_section, - N obj_cite_digits, - S tag_in_seg, + string[][string][string] bookindex_nugget_hash(N,S)( + string bookindex_section, + N obj_cite_digits, + S tag_in_seg, ) in { debug(asserts) { - static assert(is(typeof(bookindex_section) == string)); static assert(is(typeof(obj_cite_digits.object_number) == int)); } debug(bookindexraw) { @@ -6763,12 +6566,9 @@ struct BookIndexNuggetHash { #+BEGIN_SRC d struct BookIndexReportIndent { int mkn, skn; - void bookindex_report_indented(BI)( - BI bookindex_unordered_hashes + void bookindex_report_indented()( + string[][string][string] bookindex_unordered_hashes ) { - debug(asserts) { - static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); - } auto mainkeys = bookindex_unordered_hashes.byKey.array.sort().release; foreach (mainkey; mainkeys) { @@ -6807,8 +6607,8 @@ struct BookIndexReportSection { #+name: meta_emitters_book_index_report_section #+BEGIN_SRC d - void bookindex_write_section(BI)( - BI bookindex_unordered_hashes + void bookindex_write_section()( + string[][string][string] bookindex_unordered_hashes ) { auto mainkeys = bookindex_unordered_hashes.byKey.array @@ -6842,13 +6642,12 @@ struct BookIndexReportSection { #+name: meta_emitters_book_index_report_section #+BEGIN_SRC d - auto bookindex_build_abstraction_section(BI,N,B)( - BI bookindex_unordered_hashes, - N obj_cite_digits, - B opt_action, + auto bookindex_build_abstraction_section(N,B)( + string[][string][string] bookindex_unordered_hashes, + N obj_cite_digits, + B opt_action, ) { debug(asserts) { - static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); static assert(is(typeof(obj_cite_digits.object_number) == int)); } mixin DocReformNode; @@ -7228,15 +7027,11 @@ struct Bibliography { #+name: meta_emitters_bibliography #+BEGIN_SRC d - public JSONValue[] flow_bibliography_(Bi,BJ)( - return ref Bi biblio_unsorted_incomplete, - return ref BJ bib_arr_json + public JSONValue[] flow_bibliography_()( + return ref string[] biblio_unsorted_incomplete, + return ref JSONValue[] bib_arr_json ) in { - debug(asserts) { - static assert(is(typeof(biblio_unsorted_incomplete) == string[])); - static assert(is(typeof(bib_arr_json) == JSONValue[])); - } } body { JSONValue[] biblio_unsorted @@ -7266,14 +7061,10 @@ struct Bibliography { #+name: meta_emitters_bibliography #+BEGIN_SRC d - final private JSONValue[] biblio_make_unsorted_array_of_json_objects(Bi,BJ)( - Bi biblio_unordered, - BJ bib_arr_json + final private JSONValue[] biblio_make_unsorted_array_of_json_objects()( + string[] biblio_unordered, + JSONValue[] bib_arr_json ) { - debug(asserts) { - static assert(is(typeof(biblio_unordered) == string[])); - static assert(is(typeof(bib_arr_json) == JSONValue[])); - } foreach (bibent; biblio_unordered) { /+ update bib to include deemed_author, needed for: sort_bibliography_array_by_deemed_author_year_title @@ -7304,10 +7095,7 @@ struct Bibliography { #+name: meta_emitters_bibliography #+BEGIN_SRC d - final private JSONValue[] biblio_sort(BJ)(BJ biblio_unordered) { - debug(asserts) { - static assert(is(typeof(biblio_unordered) == JSONValue[])); - } + final private JSONValue[] biblio_sort()(JSONValue[] biblio_unordered) { JSONValue[] biblio_sorted_; biblio_sorted_ = sort!((a, b){ @@ -7328,10 +7116,7 @@ struct Bibliography { #+name: meta_emitters_bibliography #+BEGIN_SRC d - void biblio_debug(BJ)(BJ biblio_sorted) { - debug(asserts) { - static assert(is(typeof(biblio_sorted) == JSONValue[])); - } + void biblio_debug()(JSONValue[] biblio_sorted) { debug(biblio0) { foreach (j; biblio_sorted) { if (!empty(j["fulltitle"].str)) { @@ -7365,24 +7150,19 @@ struct NodeStructureMetadata { #+name: meta_emitters_metadata #+BEGIN_SRC d - ObjGenericComposite node_location_emitter(Lv,Tg,La,Ta,N,C,P,I)( - Lv lev_markup_number, - Tg tag_in_seg, - La lev_anchor_tag, - Ta tag_assoc, - N obj_cite_digits, - C cntr_, - P ptr_, - I is_ + ObjGenericComposite node_location_emitter(La,Ta,N)( + string lev_markup_number, + string[string] tag_in_seg, + La lev_anchor_tag, + Ta tag_assoc, + N obj_cite_digits, + int cntr_, + int ptr_, + string is_ ) in { debug(asserts) { - static assert(is(typeof(lev_markup_number) == string)); - static assert(is(typeof(tag_in_seg) == string[string])); static assert(is(typeof(obj_cite_digits.object_number) == int)); - static assert(is(typeof(cntr_) == int)); - static assert(is(typeof(ptr_) == int)); - static assert(is(typeof(is_) == string)); } assert(is_ != "heading"); assert(obj_cite_digits.object_number.to!int >= 0); @@ -7433,37 +7213,28 @@ struct NodeStructureMetadata { #+name: meta_emitters_metadata #+BEGIN_SRC d - ObjGenericComposite node_emitter_heading(T,Lm,Lc,Hd,TaB,TaL,TA,N,C,P,LA,I,PSn,fNr,fNs,fL)( - T _text, - Lm lev_markup_number, - Lc lev_collapsed_number, - Hd dummy_heading_status, - TaB tag_in_seg, - TaL lev_anchor_tag, - TA tag_assoc, - N obj_cite_digits, - C cntr_, - P ptr_, - LA lv_ancestors_txt, - I is_, - PSn html_segnames_ptr, - fNr flag_notes_reg, - fNs flag_notes_star, - fL flag_links, + ObjGenericComposite node_emitter_heading(Hd,TaL,TA,N,fNr,fNs,fL)( + string _text, + string lev_markup_number, + string lev_collapsed_number, + Hd dummy_heading_status, + string[string] tag_in_seg, + TaL lev_anchor_tag, + TA tag_assoc, + N obj_cite_digits, + int cntr_, + int ptr_, + string[] lv_ancestors_txt, + string is_, + int html_segnames_ptr, + fNr flag_notes_reg, + fNs flag_notes_star, + fL flag_links, ) in { debug(asserts) { - static assert(is(typeof(_text) == string)); static assert(is(typeof(lev) == string)); - static assert(is(typeof(lev_markup_number) == string)); - static assert(is(typeof(lev_collapsed_number) == string)); - static assert(is(typeof(tag_in_seg) == string[string])); static assert(is(typeof(obj_cite_digits.object_number) == int)); - static assert(is(typeof(cntr_) == int)); - static assert(is(typeof(ptr_) == int)); - static assert(is(typeof(lv_ancestors_txt) == string[])); - static assert(is(typeof(is_) == string)); - static assert(is(typeof(html_segnames_ptr) == int)); } assert(is_ == "heading"); assert((obj_cite_digits.object_number).to!int >= 0); @@ -7655,14 +7426,10 @@ struct NodeStructureMetadata { #+name: abs_functions_assertions #+BEGIN_SRC d -pure void assertions_doc_structure(O,Lv)( - O an_object, - Lv lv +pure void assertions_doc_structure()( + string[string] an_object, + int[string] lv ) { - debug(asserts) { - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(lv) == int[string])); - } if (lv["h3"] > State.off) { assert(lv["h0"] > State.off); assert(lv["h1"] > State.off); @@ -7840,10 +7607,7 @@ pure void assertions_doc_structure(O,Lv)( #+name: abs_functions_assertions #+BEGIN_SRC d -pure void assertions_flag_types_block_status_none_or_closed(T)(T obj_type_status) { - debug(asserts) { - static assert(is(typeof(obj_type_status) == int[string])); - } +pure void assertions_flag_types_block_status_none_or_closed()(int[string] obj_type_status) { assert( (obj_type_status["code"] == TriState.off) || (obj_type_status["code"] == TriState.closing), diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index a0440e3..a27a18a 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -76,8 +76,8 @@ auto _mkup = InlineMarkup(); #+name: meta_defaults_template_structs #+BEGIN_SRC d -auto url_markup(string line) { - auto line_ = line +string url_markup(string line) { + string line_ = line .replaceAll( _rgx.smid_inline_link_markup_regular, ("$1" @@ -118,30 +118,30 @@ struct ConfCompositeMakeStr { string texpdf_font; } struct confCompositeMakeBuild { - auto bold(string _mk) { + string[] bold(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "*{$1}*", "$1"]; } return _out; } - auto breaks(string _mk) { + string breaks(string _mk) { return _mk; } - auto cover_image(string _mk) { + string cover_image(string _mk) { return _mk; } - auto css(string _mk) { + string css(string _mk) { return _mk; } - auto emphasis(string _mk) { + string[] emphasis(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "!{$1}!", "$1" ]; } return _out; } - auto footer(string[] _mk) { + string[] footer(string[] _mk) { string line_; string[] _mk2; foreach (line; _mk) { @@ -149,35 +149,35 @@ struct confCompositeMakeBuild { } return _mk2; } - auto headings(string[] _mk) { + string[] headings(string[] _mk) { return _mk; } - auto home_button_image(string[] _mk) { + string[] home_button_image(string[] _mk) { return _mk; } - auto home_button_text(string _mk) { + string home_button_text(string _mk) { return url_markup(_mk); } - auto italics(string _mk) { + string[] italics(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "/{$1}/", "$1" ]; } return _out; } - auto auto_num_top_at_level(string _mk) { + string auto_num_top_at_level(string _mk) { return _mk; } - auto auto_num_top_lv(int _mk) { + int auto_num_top_lv(int _mk) { return _mk; } - auto auto_num_depth(int _mk) { + int auto_num_depth(int _mk) { return _mk; } - auto substitute(string[][] _mk) { + string[][] substitute(string[][] _mk) { return _mk; } - auto texpdf_font(string _mk) { + string texpdf_font(string _mk) { return _mk; } } @@ -326,7 +326,7 @@ struct ConfCompositePlus { #+name: meta_defaults_template_structs #+BEGIN_SRC d -static auto ptr_head_main +static string[] ptr_head_main = [ "classify", "creator", @@ -339,7 +339,7 @@ static auto ptr_head_main "rights", "title" ]; -static auto ptr_head_sub_classify +static string[] ptr_head_sub_classify = [ "dewey", "keywords", @@ -347,7 +347,7 @@ static auto ptr_head_sub_classify "subject", "topic_register" ]; -static auto ptr_head_sub_creator +static string[] ptr_head_sub_creator = [ "author", "author_email", @@ -355,7 +355,7 @@ static auto ptr_head_sub_creator "illustrator", "translator" ]; -static auto ptr_head_sub_date +static string[] ptr_head_sub_date = [ "added_to_site", "available", @@ -365,14 +365,14 @@ static auto ptr_head_sub_date "published", "valid" ]; -static auto ptr_head_sub_identifier +static string[] ptr_head_sub_identifier = [ "isbn", "oclc", "pg" ]; /+ make +/ -static auto ptr_head_sub_make +static string[] ptr_head_sub_make = [ "cover_image", "home_button_image", @@ -387,27 +387,27 @@ static auto ptr_head_sub_make "texpdf_font", "css" ]; -static auto ptr_head_sub_notes +static string[] ptr_head_sub_notes = [ "abstract", "description" ]; -static auto ptr_head_sub_original +static string[] ptr_head_sub_original = [ "language", "source", "title" ]; -static auto ptr_head_sub_publisher +static string[] ptr_head_sub_publisher = [ "name" ]; -static auto ptr_head_sub_rights +static string[] ptr_head_sub_rights = [ "copyright", "cover", "illustrations", "license" ]; -static auto ptr_head_sub_title +static string[] ptr_head_sub_title = [ "edition", "full", @@ -416,7 +416,7 @@ static auto ptr_head_sub_title "note", "sub" ]; -auto config_jsonstr = `{ +JSONValue config_jsonstr = `{ }`; #+END_SRC @@ -980,7 +980,7 @@ if (_struct_composite.meta.creator_author.empty) { } } string[] authors_arr; - auto authors_raw_arr + string[] authors_raw_arr = _struct_composite.meta.creator_author.split(_rgx.arr_delimiter); foreach (author_raw; authors_raw_arr) { authors_arr ~= author_raw.replace(_rgx.raw_author_munge, "$2 $1"); @@ -1069,7 +1069,7 @@ static template configParseTOMLreturnJSON() { ){ TOMLDocument _doc; _doc = parseTOML(cast(string)(_text.content)); - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; return _doc_json; } } @@ -1091,7 +1091,7 @@ static template configParseTOMLreturnDocReformStruct() { T _document_struct ){ TOMLDocument _doc = parseTOML(cast(string)(_document_struct.content)); - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; _make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, _document_struct.filename); // struct from json return _make_and_meta_struct; @@ -1132,7 +1132,7 @@ static template docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct() { } _doc = parseTOML(cast(string)(header_src)); } - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; auto _header_and_make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, "header"); return _header_and_make_and_meta_struct; diff --git a/org/output_hub.org b/org/output_hub.org index 0d709ab..21f5b9d 100644 --- a/org/output_hub.org +++ b/org/output_hub.org @@ -28,7 +28,7 @@ module doc_reform.output.hub; template outputHub() { <> import std.parallelism; - void outputHub(D,I)(D doc_abstraction, I doc_matters) { + void outputHub(D,I)(const D doc_abstraction, I doc_matters) { mixin DocReformOutputRgxInit; mixin Msg; auto msg = Msg!()(doc_matters); diff --git a/org/output_sqlite.org b/org/output_sqlite.org index c9123d3..2dc29f7 100644 --- a/org/output_sqlite.org +++ b/org/output_sqlite.org @@ -33,17 +33,17 @@ static auto rgx = Rgx(); long _metadata_tid_lastrowid; template SQLiteHubBuildTablesAndPopulate() { void SQLiteHubBuildTablesAndPopulate(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { auto pth_sqlite = DocReformPathsSQLite!()(doc_matters.sqlite.filename, doc_matters.output_path); pth_sqlite.base.mkdirRecurse; auto db = Database(pth_sqlite.sqlite_file); template SQLiteDbStatementComposite() { void SQLiteDbStatementComposite(Db,D,M)( - Db db, - D doc_abstraction, - M doc_matters, + Db db, + const D doc_abstraction, + M doc_matters, ) { <> if (!(doc_matters.opt.action.quiet)) { @@ -61,17 +61,17 @@ template SQLiteHubBuildTablesAndPopulate() { #+BEGIN_SRC d :tangle "../src/doc_reform/output/sqlite.d" template SQLiteHubDiscreteBuildTablesAndPopulate() { void SQLiteHubDiscreteBuildTablesAndPopulate(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { auto pth_sqlite = DocReformPathsSQLiteDiscrete!()(doc_matters.output_path, doc_matters.src.language); pth_sqlite.base.mkdirRecurse; auto db = Database(pth_sqlite.sqlite_file(doc_matters.src.filename)); template SQLiteDiscreteDbStatementComposite() { void SQLiteDiscreteDbStatementComposite(Db,D,M)( - Db db, - D doc_abstraction, - M doc_matters, + Db db, + const D doc_abstraction, + M doc_matters, ) { <> if (!(doc_matters.opt.action.quiet)) { @@ -202,8 +202,8 @@ template SQLiteInsertMetadata() { #+BEGIN_SRC d :tangle "../src/doc_reform/output/sqlite.d" template SQLiteInsertDocObjectsLoop() { string SQLiteInsertDocObjectsLoop(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { string _uid = SQLinsertDelimiter!()(doc_matters.src.doc_uid); auto site_url = DocReformPathsUrl!()(doc_matters); @@ -343,7 +343,7 @@ import #+name: sanitize_text_for_search #+BEGIN_SRC d -auto generic_munge_sanitize_text_for_search( +string generic_munge_sanitize_text_for_search( string _txt, ) { string _notes; @@ -392,9 +392,9 @@ light html objects #+name: sanitize_and_munge_inline_html #+BEGIN_SRC d -auto munge_html(M,O)( - M doc_matters, - auto ref const O obj, +string munge_html(M,O)( + M doc_matters, + const O obj, ) { string _html_special_characters(string _txt){ _txt = _txt @@ -498,7 +498,7 @@ string html_font_face(string _txt){ #+name: sanitize_and_munge_inline_html #+BEGIN_SRC d -auto inline_images(M,O)( +string inline_images(M,O)( M doc_matters, const O obj, string _txt, @@ -529,7 +529,7 @@ auto inline_images(M,O)( #+name: sanitize_and_munge_inline_html #+BEGIN_SRC d -auto inline_links(M,O)( +string inline_links(M,O)( M doc_matters, const O obj, string _txt, @@ -637,7 +637,7 @@ auto inline_links(M,O)( #+name: sanitize_and_munge_inline_html #+BEGIN_SRC d -auto inline_notes_scroll(M,O)( +string inline_notes_scroll(M,O)( M doc_matters, const O obj, string _txt, @@ -713,7 +713,7 @@ auto inline_notes_seg(M,O)( #+name: sanitize_and_munge_inline_html #+BEGIN_SRC d string xml_type="seg"; /+ set html document type to be linked to here (seg|scroll) +/ -auto inline_markup(M,O)( +string inline_markup(M,O)( M doc_matters, const O obj, string _txt, @@ -730,9 +730,9 @@ auto inline_markup(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_heading(M,O)( - M doc_matters, - auto ref const O obj, +string html_heading(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -754,9 +754,9 @@ auto html_heading(M,O)( ##+name: prepare_objects_html #+BEGIN_SRC d -auto html_heading(M,O)( - M doc_matters, - auto ref const O obj, +string html_heading(M,O)( + M doc_matters, + const O obj, ) { string o; string _txt = munge_html(doc_matters, obj); @@ -776,9 +776,9 @@ auto html_heading(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_para(M,O)( - M doc_matters, - auto ref const O obj, +string html_para(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -803,9 +803,9 @@ auto html_para(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_quote(M,O)( - M doc_matters, - auto ref const O obj, +string html_quote(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -826,9 +826,9 @@ auto html_quote(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_group(M,O)( - M doc_matters, - auto ref const O obj, +string html_group(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -849,9 +849,9 @@ auto html_group(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_block(M,O)( - M doc_matters, - auto ref const O obj, +string html_block(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -871,9 +871,9 @@ auto html_block(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_verse(M,O)( - M doc_matters, - auto ref const O obj, +string html_verse(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -892,8 +892,8 @@ auto html_verse(M,O)( #+name: html_objects #+BEGIN_SRC d -auto html_code(O)( - auto ref const O obj, +string html_code(O)( + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -912,17 +912,17 @@ auto html_code(O)( #+name: html_objects #+BEGIN_SRC d -auto html_table(M,O)( - M doc_matters, - auto ref const O obj, +string html_table(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); auto _tablarize(O)( - auto ref const O obj, - string _txt, + const O obj, + string _txt, ) { string[] _table_rows = _txt.split(rgx.table_delimiter_row); string[] _table_cols; @@ -984,9 +984,9 @@ auto html_table(M,O)( #+name: sqlite_load_object #+BEGIN_SRC d -auto sqlite_load_string(M,O)( - auto ref M doc_matters, - auto ref const O obj, +string sqlite_load_string(M,O)( + M doc_matters, + const O obj, ) { string o; return o; @@ -995,9 +995,9 @@ auto sqlite_load_string(M,O)( #+name: sqlite_load_object #+BEGIN_SRC d -auto postgresql_load_string(M,O)( - auto ref M doc_matters, - auto ref const O obj, +string postgresql_load_string(M,O)( + M doc_matters, + const O obj, ) { string o; return o; @@ -1007,9 +1007,9 @@ auto postgresql_load_string(M,O)( #+name: sqlite_load_object #+BEGIN_SRC d string sqlite_statement(O)( - auto ref const O obj, - string _txt, - string _html, + const O obj, + string _txt, + string _html, ) { void _sql_exe(O)( string _sql, @@ -1026,9 +1026,9 @@ string sqlite_statement(O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto heading(M,O)( - M doc_matters, - auto ref const O obj, +string[string] heading(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1055,9 +1055,9 @@ auto heading(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto para(M,O)( - M doc_matters, - auto ref const O obj, +string[string] para(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1084,9 +1084,9 @@ auto para(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto quote(M,O)( - M doc_matters, - auto ref const O obj, +string[string] quote(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1112,9 +1112,9 @@ auto quote(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto group(M,O)( - M doc_matters, - auto ref const O obj, +string[string] group(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1141,9 +1141,9 @@ auto group(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto block(M,O)( - M doc_matters, - auto ref const O obj, +string[string] block(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1170,9 +1170,9 @@ auto block(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto verse(M,O)( - M doc_matters, - auto ref const O obj, +string[string] verse(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1199,9 +1199,9 @@ auto verse(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto code(M,O)( - M doc_matters, - auto ref const O obj, +string[string] code(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1228,9 +1228,9 @@ auto code(M,O)( #+name: hub_format_and_sqlite_load_objects #+BEGIN_SRC d -auto table(M,O)( - M doc_matters, - auto ref const O obj, +string[string] table(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), diff --git a/org/output_xmls.org b/org/output_xmls.org index 14d4f24..2eb0e48 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -58,8 +58,8 @@ import #+name: xhtml_format_objects #+BEGIN_SRC d string div_delimit( - string part, - return ref string previous_part + string part, + return ref string previous_part ){ string delimit = ""; string delimit_ = ""; @@ -163,7 +163,7 @@ string _xhtml_anchor_tags(O)(O obj) { #+name: xhtml_format_objects #+BEGIN_SRC d -auto header_metadata(M)( +string header_metadata(M)( M doc_matters, ) { string _publisher="Publisher"; // TODO @@ -206,7 +206,7 @@ auto header_metadata(M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto site_info_button(M)( +string site_info_button(M)( M doc_matters, ) { string _locations; @@ -236,7 +236,7 @@ auto site_info_button(M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_search_form(M)( +string inline_search_form(M)( M doc_matters, ) { string _action="http://www.sisudoc.org/cgi-bin/search.cgi"; @@ -277,7 +277,7 @@ auto inline_search_form(M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto html_head(M)( +string html_head(M)( M doc_matters, string type, ) { @@ -338,7 +338,7 @@ if (doc_matters.opt.action.workon) { #+name: xhtml_format_objects #+BEGIN_SRC d -auto epub3_seg_head(M)( +string epub3_seg_head(M)( M doc_matters, ) { string html_base = format(q"┃ @@ -412,7 +412,7 @@ auto epub3_seg_head(M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto tail() { +string tail() { string o; o = format(q"┃ @@ -428,7 +428,7 @@ auto tail() { #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_images(O,M)( +string inline_images(O,M)( string _txt, const O obj, M doc_matters, @@ -462,7 +462,7 @@ auto inline_images(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_links(O,M)( +string inline_links(O,M)( string _txt, const O obj, M doc_matters, @@ -560,7 +560,7 @@ auto inline_links(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_notes_scroll(O,M)( +string inline_notes_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -637,7 +637,7 @@ auto inline_notes_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto inline_markup_scroll(O,M)( +string inline_markup_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -804,7 +804,7 @@ auto nav_pre_next_svg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto heading(O)( +string heading(O)( string _txt, const O obj, string _xml_type = "html", @@ -813,7 +813,7 @@ auto heading(O)( assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "para"); assert(obj.metainfo.is_a == "heading"); - auto tags = _xhtml_anchor_tags(obj); + string tags = _xhtml_anchor_tags(obj); string heading_lev_anchor_tag; string _horizontal_rule = "
"; if ((_xml_type != "html") @@ -874,13 +874,12 @@ auto heading(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto heading_scroll(O,M)( +string heading_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = heading(_txt, obj); return o; @@ -915,7 +914,7 @@ auto heading_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto para(O)( +string para(O)( string _txt, const O obj, ) { @@ -923,7 +922,7 @@ auto para(O)( assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "para"); assert(obj.metainfo.is_a == "para" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); - auto tags = _xhtml_anchor_tags(obj); + string tags = _xhtml_anchor_tags(obj); _txt = font_face(_txt); string o; _txt = (obj.attrib.bullet) ? ("●  " ~ _txt) : _txt; @@ -966,13 +965,12 @@ auto para(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto para_scroll(O,M)( +string para_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = para(_txt, obj); return o; @@ -1007,7 +1005,7 @@ auto para_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto quote(O)( +string quote(O)( string _txt, const O obj, ) { @@ -1048,13 +1046,12 @@ auto quote(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto quote_scroll(O,M)( +string quote_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = quote(_txt, obj); return o; @@ -1089,7 +1086,7 @@ auto quote_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto group(O)( +string group(O)( string _txt, const O obj, ) { @@ -1130,14 +1127,13 @@ auto group(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto group_scroll(O,M)( +string group_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = group(_txt, obj); return o; @@ -1172,7 +1168,7 @@ auto group_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto block(O)( +string block(O)( string _txt, const O obj, ) { @@ -1209,14 +1205,13 @@ auto block(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto block_scroll(O,M)( +string block_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = block(_txt, obj); return o; @@ -1251,7 +1246,7 @@ auto block_seg(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto verse(O)( +string verse(O)( string _txt, const O obj, ) { @@ -1288,14 +1283,13 @@ auto verse(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto verse_scroll(O,M)( +string verse_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = verse(_txt, obj); return o; @@ -1329,7 +1323,7 @@ auto verse_seg(O,M)( #+name: xhtml_format_objects_code #+BEGIN_SRC d -auto code(O)( +string code(O)( string _txt, const O obj, ) { @@ -1413,7 +1407,7 @@ auto tablarize(O)( #+name: xhtml_format_objects #+BEGIN_SRC d -auto table(O)( +string table(O)( string _txt, const O obj, ) { @@ -1421,7 +1415,7 @@ auto table(O)( assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); - auto tags = _xhtml_anchor_tags(obj); + string tags = _xhtml_anchor_tags(obj); _txt = font_face(_txt); auto t = tablarize(_txt, obj); _txt = t[0]; @@ -2046,7 +2040,7 @@ void seg_write_output(M,D,E)( #+name: output_html_css #+BEGIN_SRC d void css(M)( - auto ref M doc_matters, + M doc_matters, ) { auto css = DocReformCss(); auto pth_html = DocReformPathsHTML!()(doc_matters.output_path, doc_matters.src.language); @@ -2073,7 +2067,7 @@ void css(M)( #+name: copy_html_images #+BEGIN_SRC d void images_cp(M)( - auto ref M doc_matters, + M doc_matters, ) { { /+ (copy html images) +/ diff --git a/org/source_files_read.org b/org/source_files_read.org index a7e5b1c..4a02baa 100644 --- a/org/source_files_read.org +++ b/org/source_files_read.org @@ -52,10 +52,10 @@ static template readConfigSite() { string config_file_str; string conf_filename = "NONE"; auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); - auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.config_local_site; + string[] possible_config_path_locations = _conf_file_details.possible_config_path_locations.config_local_site; foreach(conf_fn; [_conf_file_details.config_filename_site_toml]) { foreach(pth; possible_config_path_locations) { - auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array; + char[] conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array; conf_filename = conf_fn; if (config_file_str.length > 0) { // conf_filename = conf_fn; @@ -82,7 +82,7 @@ static template readConfigSite() { string filetype() { return conf_filename.extension.chompPrefix("."); } - auto content() { + string content() { return config_file_str; } } @@ -101,7 +101,7 @@ static template readConfigDoc() { string config_file_str; string conf_filename = "NONE"; auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); - auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.sisu_document_make; + string[] possible_config_path_locations = _conf_file_details.possible_config_path_locations.sisu_document_make; foreach(conf_fn; [_conf_file_details.config_filename_document_toml]) { foreach(pth; possible_config_path_locations) { auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array; @@ -151,7 +151,7 @@ static template configReadInSiteTOML() { final string configReadInSiteTOML(M,E)(M manifest, E env) { auto conf_file_details = ConfigFilePaths!()(manifest, env); string conf_toml = conf_file_details.config_filename_site_toml; - auto possible_config_path_locations = conf_file_details.possible_config_path_locations.config_local_site; + string[] possible_config_path_locations = conf_file_details.possible_config_path_locations.config_local_site; string config_file_str; debug(io) { writeln("WARNING (io debug) in config filename: ", conf_toml); @@ -188,7 +188,7 @@ static template configReadInDocTOML() { final string configReadInDocTOML(M,E)(M manifest, E env) { auto conf_file_details = ConfigFilePaths!()(manifest, env); string conf_toml = conf_file_details.config_filename_document_toml; - auto possible_config_path_locations = conf_file_details.possible_config_path_locations.sisu_document_make; + string[] possible_config_path_locations = conf_file_details.possible_config_path_locations.sisu_document_make; string config_file_str; debug(io) { writeln("WARNING (io debug) in config filename: ", conf_toml); @@ -223,7 +223,7 @@ static template configReadInDocTOML() { static template configTOML() { import toml; // <> - auto configTOML(string configuration, string conf_toml_filename) { + TOMLDocument configTOML(string configuration, string conf_toml_filename) { TOMLDocument _toml_conf; try { _toml_conf = parseTOML(configuration); // parseTOML(cast(string)(configuration)); @@ -243,22 +243,22 @@ static template configTOML() { static template configReadSiteTOML() { <> import toml; - final auto configReadSiteTOML(M,E)(M _manifest, E _env) { - auto _configuration = configReadInSiteTOML!()(_manifest, _env); + final TOMLDocument configReadSiteTOML(M,E)(M _manifest, E _env) { + string _configuration = configReadInSiteTOML!()(_manifest, _env); auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); string _conf_toml = _conf_file_details.config_filename_site_toml; - auto _toml_conf = configTOML!()(_configuration, _conf_toml); + TOMLDocument _toml_conf = configTOML!()(_configuration, _conf_toml); return _toml_conf; } } static template configReadDocTOML() { <> import toml; - final auto configReadDocTOML(M,E)(M _manifest, E _env) { - auto _configuration = configReadInDocTOML!()(_manifest, _env); + final TOMLDocument configReadDocTOML(M,E)(M _manifest, E _env) { + string _configuration = configReadInDocTOML!()(_manifest, _env); auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); string _conf_toml = _conf_file_details.config_filename_document_toml; - auto _toml_conf = configTOML!()(_configuration, _conf_toml); + TOMLDocument _toml_conf = configTOML!()(_configuration, _conf_toml); return _toml_conf; } } @@ -283,7 +283,7 @@ static template DocReformRawMarkupContent() { string[] _images=[]; auto _extract_images(S)(S content_block) { string[] images_; - auto _content_block = content_block.to!string; + string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { images_ ~= m.captures[1].to!string; } @@ -511,7 +511,7 @@ final char[][] getInsertMarkupSourceContentRawLineArray( #+name: meta_inserts_scan #+BEGIN_SRC d char[][] contents_insert; -auto type1 = flags_type_init; +int[string] type1 = flags_type_init; auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm); auto markup_src_file_path = fn_pth_full.captures[1]; #+END_SRC @@ -606,7 +606,7 @@ return t; #+name: meta_master_doc_scan_for_insert_filenames #+BEGIN_SRC d char[][] contents; -auto type = flags_type_init; +int[string] type = flags_type_init; auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm); auto markup_src_file_path = fn_pth_full.captures[1]; char[][] contents_insert; diff --git a/src/doc_reform/doc_reform.d b/src/doc_reform/doc_reform.d index ae92a97..2c63dcb 100755 --- a/src/doc_reform/doc_reform.d +++ b/src/doc_reform/doc_reform.d @@ -216,13 +216,13 @@ void main(string[] args) { } enum outTask { pod, source, sqlite, sqlite_multi, epub, html_scroll, html_seg, html_stuff } struct OptActions { - auto assertions() { + bool assertions() { return opts["assertions"]; } - auto concordance() { + bool concordance() { return opts["concordance"]; } - auto css_theme_default() { + bool css_theme_default() { bool _is_light; if (opts["light"] || opts["theme-light"]) { _is_light = true; @@ -233,79 +233,79 @@ void main(string[] args) { } return _is_light; } - auto debug_do() { + bool debug_do() { return opts["debug"]; } - auto digest() { + bool digest() { return opts["digest"]; } - auto epub() { + bool epub() { return opts["epub"]; } - auto html() { + bool html() { bool _is; if ( opts["html"] || opts["html-seg"] || opts["html-scroll"]) { _is = true; } else { _is = false; } return _is; } - auto html_seg() { + bool html_seg() { bool _is; if ( opts["html"] || opts["html-seg"]) { _is = true; } else { _is = false; } return _is; } - auto html_scroll() { + bool html_scroll() { bool _is; if ( opts["html"] || opts["html-scroll"]) { _is = true; } else { _is = false; } return _is; } - auto html_stuff() { + bool html_stuff() { bool _is; if (opts["html"] || opts["html-scroll"] || opts["html-seg"]) { _is = true; } else { _is = false; } return _is; } - auto manifest() { + bool manifest() { return opts["manifest"]; } - auto ocn() { + bool ocn() { return opts["ocn"]; } - auto quiet() { + bool quiet() { return opts["quiet"]; } - auto pod() { + bool pod() { return opts["pod"]; } - auto source() { + bool source() { return opts["source"]; } - auto sqlite_discrete() { + bool sqlite_discrete() { return opts["sqlite-discrete"]; } - auto sqlite_db_drop() { + bool sqlite_db_drop() { bool _is; if ( opts["sqlite-db-recreate"] || opts["sqlite-db-drop"]) { _is = true; } else { _is = false; } return _is; } - auto sqlite_db_create() { + bool sqlite_db_create() { bool _is; if ( opts["sqlite-db-recreate"] || opts["sqlite-db-create"]) { _is = true; } else { _is = false; } return _is; } - auto sqlite_delete() { + bool sqlite_delete() { return opts["sqlite-delete"]; } - auto sqlite_update() { + bool sqlite_update() { bool _is; if (opts["sqlite-update"] || opts["sqlite-insert"]) { _is = true; } else { _is = false; } return _is; } - auto sqlite_shared_db_action() { + bool sqlite_shared_db_action() { bool _is; if (opts["sqlite-db-recreate"] || opts["sqlite-db-create"] @@ -315,49 +315,49 @@ void main(string[] args) { ) { _is = true; } else { _is = false; } return _is; } - auto text() { + bool text() { return opts["text"]; } - auto verbose() { + bool verbose() { bool _is; if (opts["verbose"] || opts["very-verbose"]) { _is = true; } else { _is = false; } return _is; } - auto very_verbose() { + bool very_verbose() { return opts["very-verbose"]; } - auto xhtml() { + bool xhtml() { return opts["xhtml"]; } - auto section_toc() { + bool section_toc() { return opts["section_toc"]; } - auto section_body() { + bool section_body() { return opts["section_body"]; } - auto section_endnotes() { + bool section_endnotes() { return opts["section_endnotes"]; } - auto section_glossary() { + bool section_glossary() { return opts["section_glossary"]; } - auto section_biblio() { + bool section_biblio() { return opts["section_biblio"]; } - auto section_bookindex() { + bool section_bookindex() { return opts["section_bookindex"]; } - auto section_blurb() { + bool section_blurb() { return opts["section_blurb"]; } - auto backmatter() { + bool backmatter() { return opts["backmatter"]; } - auto skip_output() { + bool skip_output() { return opts["skip-output"]; } - auto workon() { + bool workon() { return opts["workon"]; } auto languages_set() { @@ -369,7 +369,7 @@ void main(string[] args) { auto sqlite_filename() { return settings["sqlite-filename"]; } - auto parallelise() { + bool parallelise() { bool _is; if (opts["parallel"] == true) { _is = true; @@ -390,7 +390,7 @@ void main(string[] args) { } else { _is = false; } return _is; } - auto parallelise_subprocesses() { + bool parallelise_subprocesses() { return opts["parallel-subprocesses"]; } auto output_task_scheduler() { @@ -418,7 +418,7 @@ void main(string[] args) { } return schedule.sort().uniq; } - auto abstraction() { + bool abstraction() { bool _is; if (opts["abstraction"] || concordance @@ -440,7 +440,7 @@ void main(string[] args) { string name() { return program_name; } - auto ver() { + string ver() { string ver_ = format( "%s.%s.%s", _ver.major, _ver.minor, _ver.patch, @@ -504,7 +504,7 @@ void main(string[] args) { contents_location ~ "»" ); auto contents_location_pth_ = (contents_location).to!string; - auto lang_rgx_ = regex(r"/(" ~ _opt_action.languages_set.join("|") ~ ")/"); + Regex!(char) lang_rgx_ = regex(r"/(" ~ _opt_action.languages_set.join("|") ~ ")/"); if (_opt_action.languages_set[0] == "all" || (contents_location_pth_).match(lang_rgx_) ) { diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d index 980a802..d7ab551 100644 --- a/src/doc_reform/meta/conf_make_meta_json.d +++ b/src/doc_reform/meta/conf_make_meta_json.d @@ -532,7 +532,7 @@ static template contentJSONtoDocReformStruct() { } } string[] authors_arr; - auto authors_raw_arr + string[] authors_raw_arr = _struct_composite.meta.creator_author.split(_rgx.arr_delimiter); foreach (author_raw; authors_raw_arr) { authors_arr ~= author_raw.replace(_rgx.raw_author_munge, "$2 $1"); diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index e7b9a5b..e214565 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -16,8 +16,8 @@ mixin DocReformRgxInit; static auto _rgx = Rgx(); mixin InternalMarkup; auto _mkup = InlineMarkup(); -auto url_markup(string line) { - auto line_ = line +string url_markup(string line) { + string line_ = line .replaceAll( _rgx.smid_inline_link_markup_regular, ("$1" @@ -58,30 +58,30 @@ struct ConfCompositeMakeStr { string texpdf_font; } struct confCompositeMakeBuild { - auto bold(string _mk) { + string[] bold(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "*{$1}*", "$1"]; } return _out; } - auto breaks(string _mk) { + string breaks(string _mk) { return _mk; } - auto cover_image(string _mk) { + string cover_image(string _mk) { return _mk; } - auto css(string _mk) { + string css(string _mk) { return _mk; } - auto emphasis(string _mk) { + string[] emphasis(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "!{$1}!", "$1" ]; } return _out; } - auto footer(string[] _mk) { + string[] footer(string[] _mk) { string line_; string[] _mk2; foreach (line; _mk) { @@ -89,35 +89,35 @@ struct confCompositeMakeBuild { } return _mk2; } - auto headings(string[] _mk) { + string[] headings(string[] _mk) { return _mk; } - auto home_button_image(string[] _mk) { + string[] home_button_image(string[] _mk) { return _mk; } - auto home_button_text(string _mk) { + string home_button_text(string _mk) { return url_markup(_mk); } - auto italics(string _mk) { + string[] italics(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "/{$1}/", "$1" ]; } return _out; } - auto auto_num_top_at_level(string _mk) { + string auto_num_top_at_level(string _mk) { return _mk; } - auto auto_num_top_lv(int _mk) { + int auto_num_top_lv(int _mk) { return _mk; } - auto auto_num_depth(int _mk) { + int auto_num_depth(int _mk) { return _mk; } - auto substitute(string[][] _mk) { + string[][] substitute(string[][] _mk) { return _mk; } - auto texpdf_font(string _mk) { + string texpdf_font(string _mk) { return _mk; } } @@ -235,7 +235,7 @@ struct ConfCompositePlus { ConfCompositeMakeStr make_str; ConfCompositeSiteLocal conf; } -static auto ptr_head_main +static string[] ptr_head_main = [ "classify", "creator", @@ -248,7 +248,7 @@ static auto ptr_head_main "rights", "title" ]; -static auto ptr_head_sub_classify +static string[] ptr_head_sub_classify = [ "dewey", "keywords", @@ -256,7 +256,7 @@ static auto ptr_head_sub_classify "subject", "topic_register" ]; -static auto ptr_head_sub_creator +static string[] ptr_head_sub_creator = [ "author", "author_email", @@ -264,7 +264,7 @@ static auto ptr_head_sub_creator "illustrator", "translator" ]; -static auto ptr_head_sub_date +static string[] ptr_head_sub_date = [ "added_to_site", "available", @@ -274,14 +274,14 @@ static auto ptr_head_sub_date "published", "valid" ]; -static auto ptr_head_sub_identifier +static string[] ptr_head_sub_identifier = [ "isbn", "oclc", "pg" ]; /+ make +/ -static auto ptr_head_sub_make +static string[] ptr_head_sub_make = [ "cover_image", "home_button_image", @@ -296,27 +296,27 @@ static auto ptr_head_sub_make "texpdf_font", "css" ]; -static auto ptr_head_sub_notes +static string[] ptr_head_sub_notes = [ "abstract", "description" ]; -static auto ptr_head_sub_original +static string[] ptr_head_sub_original = [ "language", "source", "title" ]; -static auto ptr_head_sub_publisher +static string[] ptr_head_sub_publisher = [ "name" ]; -static auto ptr_head_sub_rights +static string[] ptr_head_sub_rights = [ "copyright", "cover", "illustrations", "license" ]; -static auto ptr_head_sub_title +static string[] ptr_head_sub_title = [ "edition", "full", @@ -325,5 +325,5 @@ static auto ptr_head_sub_title "note", "sub" ]; -auto config_jsonstr = `{ +JSONValue config_jsonstr = `{ }`; diff --git a/src/doc_reform/meta/conf_make_meta_toml.d b/src/doc_reform/meta/conf_make_meta_toml.d index 46bd6a3..f047c5d 100644 --- a/src/doc_reform/meta/conf_make_meta_toml.d +++ b/src/doc_reform/meta/conf_make_meta_toml.d @@ -18,7 +18,7 @@ static template configParseTOMLreturnJSON() { ){ TOMLDocument _doc; _doc = parseTOML(cast(string)(_text.content)); - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; return _doc_json; } } @@ -35,7 +35,7 @@ static template configParseTOMLreturnDocReformStruct() { T _document_struct ){ TOMLDocument _doc = parseTOML(cast(string)(_document_struct.content)); - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; _make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, _document_struct.filename); // struct from json return _make_and_meta_struct; @@ -71,7 +71,7 @@ static template docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct() { } _doc = parseTOML(cast(string)(header_src)); } - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; auto _header_and_make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, "header"); return _header_and_make_and_meta_struct; diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index 8fb9b89..3df8816 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -46,7 +46,7 @@ template DocReformRgxInitFlags() { } template DocReformNode() { static string[string] node_metadata_heading_str() { - auto _node = [ + string[string] _node = [ "is" : "", "ocn" : "", "marked_up_lev" : "", @@ -57,7 +57,7 @@ template DocReformNode() { return _node; } static int[string] node_metadata_heading_int() { - auto _node = [ + int[string] _node = [ "ocn" : 0, // decide whether to use or keep? "ptr_doc_object" : 0, "ptr_html_segnames" : 0, @@ -70,7 +70,7 @@ template DocReformNode() { return _node; } static string[string] node_metadata_para_str() { - auto _node = [ + string[string] _node = [ "is" : "", "ocn" : "", "attrib" : "", @@ -78,7 +78,7 @@ template DocReformNode() { return _node; } static int[string] node_metadata_para_int() { - auto _node = [ + int[string] _node = [ "ocn" : 0, "indent_base" : 0, "indent_hang" : 0, @@ -127,36 +127,36 @@ template DocReformBiblio() { template InternalMarkup() { import std.array; static struct InlineMarkup { - auto en_a_o = "【"; auto en_a_c = "】"; - auto en_b_o = "〖"; auto en_b_c = "〗"; - auto quote_o = "“"; auto quote_c = "”"; - auto ff_o = "┨"; auto ff_c = "┣"; // fontface - auto lnk_o = "┥"; auto lnk_c = "┝"; - auto url_o = "┤"; auto url_c = "├"; - auto emph = "*"; - auto bold = "!"; - auto italic = "/"; - auto underscore = "_"; - auto superscript = "^"; - auto subscript = ","; - auto mono = "■"; - auto cite = "‖"; - auto mark_internal_site_lnk = "¤"; - auto nbsp = "░"; - auto br_line = "┘"; - auto br_nl = "┙"; - auto br_paragraph = "┚"; - auto br_obj = "break_obj"; - auto br_page_line = "┼"; - auto br_page = "┿"; - auto br_page_new = "╂"; - auto tc_s = "┊"; - auto tc_o = "┏"; - auto tc_c = "┚"; - auto tc_p = "┆"; - auto img = "☼"; - auto on_o = "「"; auto on_c = "」"; - auto mk_bullet = "● "; + string en_a_o = "【"; string en_a_c = "】"; + string en_b_o = "〖"; string en_b_c = "〗"; + string quote_o = "“"; string quote_c = "”"; + string ff_o = "┨"; string ff_c = "┣"; // fontface + string lnk_o = "┥"; string lnk_c = "┝"; + string url_o = "┤"; string url_c = "├"; + string emph = "*"; + string bold = "!"; + string italic = "/"; + string underscore = "_"; + string superscript = "^"; + string subscript = ","; + string mono = "■"; + string cite = "‖"; + string mark_internal_site_lnk = "¤"; + string nbsp = "░"; + string br_line = "┘"; + string br_nl = "┙"; + string br_paragraph = "┚"; + string br_obj = "break_obj"; + string br_page_line = "┼"; + string br_page = "┿"; + string br_page_new = "╂"; + string tc_s = "┊"; + string tc_o = "┏"; + string tc_c = "┚"; + string tc_p = "┆"; + string img = "☼"; + string on_o = "「"; auto on_c = "」"; + string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); return _indent_spaces; @@ -238,11 +238,11 @@ template DocReformLanguageCodes() { return _lang_codes; } static string[] code_arr_ptr() { - auto _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",]; + 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; } static string[] code_arr() { - auto _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"]; + 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; } static auto codes_() { diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 99e834d..6b6714d 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -5,7 +5,7 @@ +/ module doc_reform.meta.metadoc_from_src; template DocReformDocAbstraction() { - /+ ↓ abstraction imports +/ + /+ ↓ abstraction imports +/ import doc_reform.meta; import std.algorithm, @@ -17,11 +17,11 @@ template DocReformDocAbstraction() { doc_reform.meta.defaults, doc_reform.meta.object_setter, doc_reform.meta.rgx; - /+ ↓ abstraction mixins +/ + /+ ↓ abstraction mixins +/ mixin ObjectSetter; mixin InternalMarkup; mixin DocReformRgxInit; - /+ ↓ abstraction struct init +/ + /+ ↓ abstraction struct init +/ /+ initialize +/ ObjGenericComposite[] the_table_of_contents_section; ObjGenericComposite[] the_document_head_section, the_document_body_section, the_bibliography_section, the_glossary_section, the_blurb_section; @@ -90,9 +90,9 @@ template DocReformDocAbstraction() { int[] dom_structure_collapsed_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_structure_collapsed_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; enum DomTags { none, open, close, close_and_open, open_still, } - pure auto obj_heading_ancestors(O)( - O obj, - string[] lv_ancestors_txt, + pure ObjGenericComposite obj_heading_ancestors()( + ObjGenericComposite obj, + string[] lv_ancestors_txt, ) { switch (obj.metainfo.heading_lev_markup) { case 0: @@ -143,10 +143,10 @@ template DocReformDocAbstraction() { } return obj; } - pure auto obj_dom_structure_set_markup_tags(O)( - O obj, - int[] dom, - int lev + pure ObjGenericComposite obj_dom_structure_set_markup_tags()( + ObjGenericComposite obj, + int[] dom, + int lev ) { foreach (i; 0 .. 8) { if (i < lev) { @@ -187,10 +187,10 @@ template DocReformDocAbstraction() { obj.metainfo.dom_structure_markedup_tags_status = dom.dup; return obj; } - pure auto obj_dom_set_collapsed_tags(O)( - O obj, - int[] dom, - int lev + pure ObjGenericComposite obj_dom_set_collapsed_tags()( + ObjGenericComposite obj, + int[] dom, + int lev ) { foreach (i; 0 .. 8) { if (i < lev) { @@ -245,7 +245,7 @@ template DocReformDocAbstraction() { } return line; } - static auto links_and_images(L)(L obj_txt) { + static string links_and_images()(string obj_txt) { static auto rgx = Rgx(); static auto mkup = InlineMarkup(); if (obj_txt.match(rgx.smid_inline_url_generic)) { @@ -292,10 +292,10 @@ template DocReformDocAbstraction() { ObjGenericComposite comp_obj_heading, comp_obj_location, comp_obj_block, comp_obj_code, comp_obj_poem_ocn, comp_obj_comment; auto node_construct = NodeStructureMetadata(); enum sObj { content, anchor_tag, notes_reg, notes_star, links, image_no_dimensions } - auto inline_para_link_anchor(O,St,TA)( - O an_object, - St tag_in_seg, - TA tag_assoc + string[string][string] inline_para_link_anchor()( + string[string] an_object, + string[string] tag_in_seg, + string[string][string] tag_assoc ) { static auto rgx = Rgx(); if (auto m = an_object["substantive"].match(rgx.inline_link_anchor)) { @@ -308,19 +308,16 @@ template DocReformDocAbstraction() { } return tag_assoc; } - /+ ↓ abstract marked up document +/ - auto DocReformDocAbstraction(Src,CMM,Opt,Mfst)( - Src markup_sourcefile_content, - CMM conf_make_meta, - Opt opt_action, - Mfst manifest_matter, - bool _new_doc + /+ ↓ abstract marked up document +/ + auto DocReformDocAbstraction(CMM,Opt,Mf)( + char[][] markup_sourcefile_content, + CMM conf_make_meta, + Opt opt_action, + Mf manifest_matter, + bool _new_doc ) { static auto rgx = Rgx(); - debug(asserts) { - static assert(is(typeof(markup_sourcefile_content) == char[][])); - } - /+ ↓ abstraction init +/ + /+ ↓ abstraction init +/ scope(success) { } scope(failure) { @@ -397,7 +394,7 @@ template DocReformDocAbstraction() { "h_3": "^(none)", "h_4": "^(none)" ]; - auto heading_match_rgx = [ + Regex!char[string] heading_match_rgx = [ "h_A": regex(r"^(none)"), "h_B": regex(r"^(none)"), "h_C": regex(r"^(none)"), @@ -445,7 +442,7 @@ template DocReformDocAbstraction() { string[][string] lev4_subtoc; string[][string] segnames = ["html": ["toc"], "epub": ["toc"]]; int cnt1 = 1; int cnt2 = 1; int cnt3 = 1; - /+ abstraction init ↑ +/ + /+ abstraction init ↑ +/ enum Substitute { match, markup, } debug (substitutions) { writeln(__LINE__, ":", __FILE__, ": DEBUG substitutions:"); @@ -471,10 +468,10 @@ template DocReformDocAbstraction() { writeln("substitution to make: ", conf_make_meta.make.italics[Substitute.markup]); } } - /+ ↓ ↻ loop markup document/text line by line +/ + /+ ↓ ↻ loop markup document/text line by line +/ srcDocLoop: - foreach (line; markup_sourcefile_content) { /+ ↓ markup document/text line by line +/ - // "line" variable can be empty but should never be null + foreach (line; markup_sourcefile_content) { /+ ↓ markup document/text line by line +/ + // "line" variable can be empty but should never be null /+ scope +/ scope(exit) { } @@ -504,9 +501,9 @@ template DocReformDocAbstraction() { /+ block object: code +/ line.flow_txt_block_code(an_object, obj_type_status); continue; - } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { /+ object other than "code block" object +/ - /+ (includes regular text paragraph, headings & blocks other than code) +/ - /+ heading, glossary, blurb, poem, group, block, quote, table +/ + } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { /+ object other than "code block" object +/ + /+ (includes regular text paragraph, headings & blocks other than code) +/ + /+ heading, glossary, blurb, poem, group, block, quote, table +/ line = line.inline_markup_faces; // by text line (rather than by text object), linebreaks in para problematic if ((line.matchFirst(rgx.heading_biblio) && obj_type_status["para"] != State.on @@ -806,7 +803,7 @@ template DocReformDocAbstraction() { } else if (obj_type_status["table"] == TriState.on) { /+ within block object: table +/ an_object = line.flow_txt_block_table(an_object, obj_type_status, conf_make_meta); continue; - } else { /+ not within a block group +/ + } else { /+ not within a block group +/ assert( (obj_type_status["blocks"] == TriState.off) || (obj_type_status["blocks"] == TriState.closing), @@ -821,8 +818,8 @@ template DocReformDocAbstraction() { } line.flow_txt_block_start(obj_type_status, dochas, object_number_poem); continue; - } else if (!line.empty) { /+ line not empty +/ - /+ non blocks (headings, paragraphs) & closed blocks +/ + } else if (!line.empty) { /+ line not empty +/ + /+ non blocks (headings, paragraphs) & closed blocks +/ assert( !line.empty, "line tested, line not empty surely:\n \"" ~ line ~ "\"" @@ -914,7 +911,7 @@ template DocReformDocAbstraction() { ++line_occur["para"]; } } - } else if (obj_type_status["blocks"] == TriState.closing) { /+ line empty, with blocks flag +/ + } else if (obj_type_status["blocks"] == TriState.closing) { /+ line empty, with blocks flag +/ an_object = line.flow_block_flag_line_empty_( an_object, bookindex_extract_hash, @@ -928,7 +925,7 @@ template DocReformDocAbstraction() { conf_make_meta, tag_in_seg, ); - } else { /+ line.empty, post contents, empty variables: +/ + } else { /+ line.empty, post contents, empty variables: +/ assert( line.empty, "\nline should be empty:\n \"" @@ -1127,9 +1124,9 @@ template DocReformDocAbstraction() { } else { // could be useful to test line variable should be empty and never null } - } // close else for line empty - } // close else for not the above - } // close after non code, other blocks or regular text + } // close else for line empty + } // close else for not the above + } // close after non code, other blocks or regular text /+ unless (the_document_body_section.length == 0) ? +/ if (the_document_body_section.length > 0) { if (((the_document_body_section[$-1].metainfo.is_a == "para") @@ -1175,8 +1172,8 @@ template DocReformDocAbstraction() { previous_length = the_document_body_section.length.to!int; } } - } /+ ← srcDocLoop closed: loop markup document/text line by line +/ - /+ ↓ post loop markup document/text +/ + } /+ ← srcDocLoop closed: loop markup document/text line by line +/ + /+ ↓ post loop markup document/text +/ auto en_tuple = note_section.endnote_objects(obj_cite_digits, opt_action); static assert(!isTypeTuple!(en_tuple)); @@ -1709,7 +1706,7 @@ template DocReformDocAbstraction() { } html_segnames_ptr_cntr++; } - auto get_decendants(S)(S document_sections) { + auto get_decendants()(ObjGenericComposite[] document_sections) { int[string] _heading_ocn_decendants; string[] _ocn_open_key = ["","","","","","","",""]; auto _doc_sect_length = document_sections.length - 1; @@ -1757,7 +1754,7 @@ template DocReformDocAbstraction() { return pairs.sort; } string[] _images; - auto extract_images(S)(S content_block) { + string[] extract_images()(string content_block) { string[] images_; if (auto m = content_block.matchAll(rgx.image)) { images_ ~= m.captures[1]; @@ -2267,7 +2264,7 @@ template DocReformDocAbstraction() { comp_obj_heading_ = comp_obj_heading_.obj_dom_set_collapsed_tags(dom_structure_collapsed_tags_status, 0); comp_obj_heading_ = comp_obj_heading_.obj_heading_ancestors(lv_ancestors_txt); // the_dom_tail_section ~= comp_obj_heading_; // remove tail for now, decide on later - auto document_the = [ + ObjGenericComposite[][string] document_the = [ "head": the_document_head_section, "toc": the_table_of_contents_section, /+ substantive/body: +/ @@ -2317,8 +2314,8 @@ template DocReformDocAbstraction() { document_section_keys_sequenced["scroll"] ~= "tail"; document_section_keys_sequenced["seg"] ~= "tail"; } - auto segnames_4 = segnames["html"].dup; - auto segnames_lv1_to_4 = segnames["epub"].dup; + string[] segnames_4 = segnames["html"].dup; + string[] segnames_lv1_to_4 = segnames["epub"].dup; debug(segnames) { writeln("segnames_lv4: ", segnames_4); writeln("segnames_lv1_to_4: ", segnames_lv1_to_4); @@ -2400,13 +2397,10 @@ template DocReformDocAbstraction() { doc_has, ); return t; - /+ post loop markup document/text ↑ +/ - } /+ ← closed: abstract doc source +/ - /+ ↓ abstraction functions +/ - static auto object_reset(O)(O an_object) { - debug(asserts) { - static assert(is(typeof(an_object) == string[string])); - } + /+ post loop markup document/text ↑ +/ + } /+ ← closed: abstract doc source +/ + /+ ↓ abstraction functions +/ + static string[string] object_reset()(string[string] an_object) { an_object.remove("body_nugget"); an_object.remove("substantive"); an_object.remove("is"); @@ -2414,30 +2408,21 @@ template DocReformDocAbstraction() { an_object.remove("bookindex_nugget"); return an_object; } - auto flow_common_reset_(L,O,T)( - return ref L line_occur, - return ref O an_object, - return ref T obj_type_status + void flow_common_reset_()( + return ref int[string] line_occur, + return ref string[string] an_object, + return ref int[string] obj_type_status, ) { - debug(asserts) { - static assert(is(typeof(line_occur) == int[string])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } line_occur["heading"] = State.off; line_occur["para"] = State.off; obj_type_status["heading"] = State.off; obj_type_status["para"] = State.off; an_object = an_object.object_reset; } - static auto _check_ocn_status_(L,T)( - L line, - T obj_type_status + static int[string] _check_ocn_status_()( + char[] line, + int[string] obj_type_status, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (!(line.empty) && (obj_type_status["ocn_status_off_for_multiple_objects"] == OCN_off_block_status.off) @@ -2493,13 +2478,10 @@ template DocReformDocAbstraction() { } return obj_type_status; } - auto _doc_header_and_make_substitutions_(L,CMM)( - L line, - CMM conf_make_meta, + char[] _doc_header_and_make_substitutions_(CMM)( + char[] line, + CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - } enum Substitute { match, markup, } if (conf_make_meta.make.substitute) { foreach(substitution_pair; conf_make_meta.make.substitute) { @@ -2511,13 +2493,10 @@ template DocReformDocAbstraction() { } return line; } - auto _doc_header_and_make_substitutions_fontface_(L,CMM)( - L line, - CMM conf_make_meta, + char[] _doc_header_and_make_substitutions_fontface_(CMM)( + char[] line, + CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - } enum Substitute { match, markup, } if ( conf_make_meta.make.bold) { line = line.replaceAll( @@ -2539,17 +2518,12 @@ template DocReformDocAbstraction() { } return line; } - void flow_txt_block_start(L,T,N)( - L line, - return ref T obj_type_status, + void flow_txt_block_start()( + char[] line, + return ref int[string] obj_type_status, return ref uint[string] dochas, - return ref N object_number_poem + return ref string[string] object_number_poem ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(obj_type_status) == int[string])); - static assert(is(typeof(object_number_poem) == string[string])); - } static auto rgx = Rgx(); if (auto m = line.matchFirst(rgx.block_curly_code_open)) { dochas["codeblock"]++; @@ -2730,16 +2704,11 @@ template DocReformDocAbstraction() { obj_type_status["tic_table"] = TriState.on; } } - auto flow_txt_block_quote(L,O,T)( - L line, - O an_object, - return ref T obj_type_status + string[string] flow_txt_block_quote()( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_quote"] == TriState.on) { if (line.matchFirst(rgx.block_curly_quote_close)) { @@ -2774,16 +2743,11 @@ template DocReformDocAbstraction() { } return an_object; } - auto flow_txt_block_group(L,O,T)( - L line, - O an_object, - return ref T obj_type_status + string[string] flow_txt_block_group()( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_group"] == State.on) { if (line.matchFirst(rgx.block_curly_group_close)) { @@ -2818,16 +2782,11 @@ template DocReformDocAbstraction() { } return an_object; } - auto flow_txt_block_block(L,O,T)( - L line, - O an_object, - return ref T obj_type_status + string[string] flow_txt_block_block()( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_block"] == TriState.on) { if (line.matchFirst(rgx.block_curly_block_close)) { @@ -2862,22 +2821,15 @@ template DocReformDocAbstraction() { } return an_object; } - auto flow_txt_block_poem(L,O,T,C,N,CMM,Ts)( - L line, - O an_object, - return ref T obj_type_status, - return ref C cntr, - N object_number_poem, - CMM conf_make_meta, - Ts tag_in_seg, + string[string] flow_txt_block_poem(CMM)( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status, + return ref int cntr, + string[string] object_number_poem, + CMM conf_make_meta, + string[string] tag_in_seg, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - static assert(is(typeof(cntr) == int)); - static assert(is(typeof(object_number_poem) == string[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_poem"] == TriState.on) { if (line.matchFirst(rgx.block_curly_poem_close)) { @@ -3111,16 +3063,11 @@ template DocReformDocAbstraction() { } return an_object; } - void flow_txt_block_code(L,O,T)( - L line, - return ref O an_object, - return ref T obj_type_status + void flow_txt_block_code()( + char[] line, + return ref string[string] an_object, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_code"] == TriState.on) { if (line.matchFirst(rgx.block_curly_code_close)) { @@ -3158,17 +3105,12 @@ template DocReformDocAbstraction() { } } } - auto flow_txt_block_table(L,O,T,CMM)( - L line, - O an_object, - return ref T obj_type_status, - return ref CMM conf_make_meta, + string[string] flow_txt_block_table(CMM)( + char[] line, + string[string] an_object, + return ref int[string] obj_type_status, + return ref CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (obj_type_status["curly_table"] == TriState.on) { if (line.matchFirst(rgx.block_curly_table_close)) { @@ -3221,10 +3163,7 @@ template DocReformDocAbstraction() { } return an_object; } - final string biblio_tag_map(A)(A abr) { - debug(asserts) { - static assert(is(typeof(abr) == string)); - } + final string biblio_tag_map()(string abr) { auto btm = [ "au" : "author_raw", "ed" : "editor_raw", @@ -3413,7 +3352,7 @@ template DocReformDocAbstraction() { processing.remove("verse"); ++cntr; } - auto flow_block_flag_line_empty_(B,N,CMM,Ts)( + string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( char[] line, string[string] an_object, B bookindex_extract_hash, @@ -3721,19 +3660,13 @@ template DocReformDocAbstraction() { } return an_object; } - auto flow_book_index_(L,I,O,T,B)( - L line, - O an_object, - I book_idx_tmp, - return ref T obj_type_status, - B opt_action, + string[string] flow_book_index_(B)( + char[] line, + string[string] an_object, + return ref string book_idx_tmp, + return ref int[string] obj_type_status, + B opt_action, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(book_idx_tmp) == string)); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (auto m = line.match(rgx.book_index)) { /+ match book_index +/ debug(bookindexmatch) { @@ -3777,20 +3710,13 @@ template DocReformDocAbstraction() { } return an_object; } - auto flow_heading_found_(L,H,X,R,T)( - L line, - H heading_match_str, - X _make_unmarked_headings, - return ref R heading_match_rgx, - return ref T obj_type_status + string[string] flow_heading_found_()( + char[] line, + string[string] heading_match_str, + string[] _make_unmarked_headings, + return ref Regex!(char)[string] heading_match_rgx, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(_make_unmarked_headings) == string[])); - static assert(is(typeof(heading_match_str) == string[string])); - static assert(is(typeof(heading_match_rgx) == Regex!(char)[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if ((_make_unmarked_headings.length > 2) && (obj_type_status["make_headings"] == State.off)) { /+ headings found +/ @@ -3865,18 +3791,12 @@ template DocReformDocAbstraction() { } return heading_match_str; } - auto flow_heading_make_set_(L,C,R,T)( - L line, - C line_occur, - return ref R heading_match_rgx, - return ref T obj_type_status + char[] flow_heading_make_set_()( + char[] line, + int[string] line_occur, + return ref Regex!(char)[string] heading_match_rgx, + return ref int[string] obj_type_status ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(line_occur) == int[string])); - static assert(is(typeof(heading_match_rgx) == Regex!(char)[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } if ((obj_type_status["make_headings"] == State.on) && ((line_occur["para"] == State.off) && (line_occur["heading"] == State.off)) @@ -3927,25 +3847,16 @@ template DocReformDocAbstraction() { } return line; } - auto flow_heading_matched_(L,C,O,K,Lv,Lc,T,CMM)( - L line, - O an_object, - return ref C line_occur, - return ref K an_object_key, - return ref Lv lv, - return ref Lc collapsed_lev, - return ref T obj_type_status, - return ref CMM conf_make_meta, + string[string] flow_heading_matched_(CMM)( + char[] line, + string[string] an_object, + return ref int[string] line_occur, + return ref string an_object_key, + return ref int[string] lv, + return ref int[string] collapsed_lev, + return ref int[string] obj_type_status, + return ref CMM conf_make_meta, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(line_occur) == int[string])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(an_object_key) == string)); - static assert(is(typeof(lv) == int[string])); - static assert(is(typeof(collapsed_lev) == int[string])); - static assert(is(typeof(obj_type_status) == int[string])); - } static auto rgx = Rgx(); if (auto m = line.match(rgx.heading)) { /+ heading match +/ ++line_occur["heading"]; @@ -4082,24 +3993,15 @@ template DocReformDocAbstraction() { } return an_object; } - auto flow_para_match_(L,O,K,I,B,T,C)( - L line, - O an_object, - return ref K an_object_key, - return ref I indent, - return ref B bullet, - return ref T obj_type_status, - return ref C line_occur, + string[string] flow_para_match_()( + char[] line, + string[string] an_object, + return ref string an_object_key, + return ref int[string] indent, + return ref bool bullet, + return ref int[string] obj_type_status, + return ref int[string] line_occur, ) { - debug(asserts) { - static assert(is(typeof(line) == char[])); - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(an_object_key) == string)); - static assert(is(typeof(indent) == int[string])); - static assert(is(typeof(bullet) == bool)); - static assert(is(typeof(obj_type_status) == int[string])); - static assert(is(typeof(line_occur) == int[string])); - } static auto rgx = Rgx(); if (line_occur["para"] == State.off) { line = font_faces_line(line); @@ -4144,8 +4046,8 @@ template DocReformDocAbstraction() { } return an_object; } - auto font_faces_line(T)( - T textline, + char[] font_faces_line()( + char[] textline, ) { static auto rgx = Rgx(); static auto mkup = InlineMarkup(); @@ -4158,9 +4060,9 @@ template DocReformDocAbstraction() { } return textline; } - auto flow_table_instructions(O,H)( - return ref O table_object, - return ref H table_head, + ObjGenericComposite flow_table_instructions(H)( + return ref ObjGenericComposite table_object, + H table_head, ) { static auto rgx = Rgx(); table_object.metainfo.is_of_part = "body"; @@ -4183,9 +4085,9 @@ template DocReformDocAbstraction() { } return table_object; } - auto flow_table_array_munge(O,T)( - return ref O table_object, - return ref T table_array, + ObjGenericComposite flow_table_array_munge(T)( + return ref ObjGenericComposite table_object, + return ref T table_array, ) { static auto rgx = Rgx(); static auto mng = InlineMarkup(); @@ -4307,9 +4209,9 @@ template DocReformDocAbstraction() { comp_obj_block.text = _table_substantive; return table_object; } - auto flow_table_substantive_munge(O,T)( - return ref O table_object, - return ref T table_substantive, + ObjGenericComposite flow_table_substantive_munge(T)( + return ref ObjGenericComposite table_object, + return ref T table_substantive, ) { static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); @@ -4323,9 +4225,9 @@ template DocReformDocAbstraction() { table_object = table_object.flow_table_array_munge(_table); return table_object; } - auto flow_table_substantive_munge_special(O,T)( - return ref O table_object, - return ref T table_substantive, + ObjGenericComposite flow_table_substantive_munge_special(T)( + return ref ObjGenericComposite table_object, + return ref T table_substantive, ) { static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); @@ -4339,8 +4241,8 @@ template DocReformDocAbstraction() { table_object = table_object.flow_table_array_munge(_table); return table_object; } - /+ abstraction functions ↑ +/ - /+ ↓ abstraction function emitters +/ + /+ abstraction functions ↑ +/ + /+ ↓ abstraction function emitters +/ pure struct OCNemitter { int ocn_digit, ocn_object_number, ocn_on_, ocn_off_, ocn_bkidx, ocn_bkidx_; string object_identifier; @@ -4389,7 +4291,7 @@ template DocReformDocAbstraction() { invariant() { } } - /+ +/ + /+ +/ static struct ObjInlineMarkupMunge { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; @@ -4404,10 +4306,7 @@ template DocReformDocAbstraction() { n_foot_sp_asterisk = 0; n_foot_sp_plus = 0; } - static auto images(Ot)(Ot obj_txt_in) { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } + 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 @@ -4437,10 +4336,7 @@ template DocReformDocAbstraction() { } return obj_txt_in; } - auto footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in, bool reset_note_numbers) { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } + auto 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; @@ -4504,11 +4400,8 @@ template DocReformDocAbstraction() { ); return t; } - private auto object_notes_and_links_(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) + private auto object_notes_and_links_()(string obj_txt_in, bool reset_note_numbers=false) in { - debug(asserts) { - assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt_out = ""; @@ -4572,11 +4465,8 @@ template DocReformDocAbstraction() { } invariant() { } - auto munge_heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false) + auto munge_heading()(string obj_txt_in, bool reset_note_numbers=false) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"] = obj_txt_in @@ -4594,11 +4484,8 @@ template DocReformDocAbstraction() { } invariant() { } - auto munge_para(Ot)(Ot obj_txt_in) + auto munge_para()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=(obj_txt_in) @@ -4613,11 +4500,8 @@ template DocReformDocAbstraction() { } return t; } - string munge_quote(Ot)(Ot obj_txt_in) + string munge_quote()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -4634,11 +4518,8 @@ template DocReformDocAbstraction() { } invariant() { } - auto munge_block(Ot)(Ot obj_txt_in) + auto munge_block()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -4647,11 +4528,8 @@ template DocReformDocAbstraction() { } invariant() { } - auto munge_verse(Ot)(Ot obj_txt_in) + auto munge_verse()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -4660,11 +4538,8 @@ template DocReformDocAbstraction() { } invariant() { } - string munge_code(Ot)(Ot obj_txt_in) + string munge_code()(string obj_txt_in) in { - debug(asserts) { - assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt_in = obj_txt_in.replaceAll(rgx.space, mkup.nbsp); @@ -4673,11 +4548,8 @@ template DocReformDocAbstraction() { } invariant() { } - string munge_table(Ot)(Ot obj_txt_in) + string munge_table()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -4685,11 +4557,8 @@ template DocReformDocAbstraction() { } invariant() { } - string munge_comment(Ot)(Ot obj_txt_in) + string munge_comment()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { obj_txt["munge"]=obj_txt_in; @@ -4703,17 +4572,13 @@ template DocReformDocAbstraction() { static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; static string anchor_tag = ""; - auto obj_inline_markup_and_anchor_tags_and_misc(O,K,CMM)( - O obj_, - K obj_key_, - CMM conf_make_meta, - Flag!"_new_doc" _new_doc + auto obj_inline_markup_and_anchor_tags_and_misc(CMM)( + string[string] obj_, + string obj_key_, + CMM conf_make_meta, + Flag!"_new_doc" _new_doc ) in { - debug(asserts) { - static assert(is(typeof(obj_) == string[string])); - static assert(is(typeof(obj_key_) == string)); - } } body { obj_txt["munge"] = obj_[obj_key_].dup; @@ -4803,34 +4668,24 @@ template DocReformDocAbstraction() { } invariant() { } - auto _clean_heading_toc_(Toc)( - Toc heading_toc_, + auto _clean_heading_toc_()( + char[] heading_toc_, ) { - debug(asserts) { - static assert(is(typeof(heading_toc_) == char[])); - } auto m = (cast(char[]) heading_toc_).matchFirst(rgx.heading); heading_toc_ = (m.post).replaceAll( rgx.inline_notes_curly_gen, ""); return heading_toc_; }; - auto flow_table_of_contents_gather_headings(O,CMM,Ts,Ta,X,Toc)( - O obj_, - CMM conf_make_meta, - Ts tag_in_seg, - Ta _anchor_tag, - return ref X lev4_subtoc, - Toc the_table_of_contents_section, + ObjGenericComposite[] flow_table_of_contents_gather_headings(CMM)( + string[string] obj_, + CMM conf_make_meta, + string[string] tag_in_seg, + string _anchor_tag, + return ref string[][string] lev4_subtoc, + ObjGenericComposite[] the_table_of_contents_section, ) in { - debug(asserts) { - static assert(is(typeof(obj_) == string[string])); - static assert(is(typeof(tag_in_seg) == string[string])); - static assert(is(typeof(_anchor_tag) == string)); - static assert(is(typeof(lev4_subtoc) == string[][string])); - static assert(is(typeof(the_table_of_contents_section) == ObjGenericComposite[])); - } } body { ObjGenericComposite comp_obj_toc; @@ -4910,16 +4765,12 @@ template DocReformDocAbstraction() { static string heading_number_auto_composite = ""; static string heading_number_auto_composite_segname = ""; static bool[] auto_heading_numbering = [ true, true, true, true]; - static string _configured_auto_heading_numbering_and_segment_anchor_tags(M,O,CMM)( - M munge_, - O obj_, - CMM conf_make_meta, - bool _new_doc, + static string _configured_auto_heading_numbering_and_segment_anchor_tags(CMM)( + string munge_, + string[string] obj_, + CMM conf_make_meta, + bool _new_doc, ) { - debug(asserts) { - static assert(is(typeof(munge_) == string)); - static assert(is(typeof(obj_) == string[string])); - } if (_new_doc) { heading_num = [ 0, 0, 0, 0 ]; heading_number_auto_composite = ""; @@ -5058,15 +4909,11 @@ template DocReformDocAbstraction() { return munge_; } static int heading_num_lev1 = 0; - static string _make_segment_anchor_tags_if_none_provided(M,Lv)( - M munge_, - Lv lev_, - bool _new_doc + static string _make_segment_anchor_tags_if_none_provided()( + string munge_, + string lev_, + bool _new_doc ) { - debug(asserts) { - static assert(is(typeof(munge_) == string)); - static assert(is(typeof(lev_) == string)); - } if (!(munge_.match(rgx.heading_anchor_tag))) { if (munge_.match(rgx.heading_identify_anchor_tag)) { if (auto m = munge_.match(rgx.heading_extract_named_anchor_tag)) { @@ -5096,20 +4943,15 @@ template DocReformDocAbstraction() { return munge_; } } - /+ +/ + /+ +/ struct ObjAttributes { string[string] _obj_attrib; - string obj_attributes(Oi,OR,OH)( - Oi obj_is_, - OR obj_raw, - OH _comp_obj_heading, + string obj_attributes()( + string obj_is_, + string obj_raw, + ObjGenericComposite _comp_obj_heading, ) in { - debug(asserts) { - static assert(is(typeof(obj_is_) == string)); - static assert(is(typeof(obj_raw) == string)); - static assert(is(typeof(_comp_obj_heading) == ObjGenericComposite)); - } } body { scope(exit) { @@ -5170,11 +5012,8 @@ template DocReformDocAbstraction() { } private: string _obj_attributes; - string txt_para_and_blocks(Ot)(Ot obj_txt_in) + string txt_para_and_blocks()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { if (obj_txt_in.matchFirst(rgx.para_bullet)) { @@ -5200,11 +5039,8 @@ template DocReformDocAbstraction() { } return _obj_attributes; } - string txt_heading(Ot)(Ot obj_txt_in) + string txt_heading()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5214,11 +5050,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_para(Ot)(Ot obj_txt_in) + string txt_para()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5228,11 +5061,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_quote(Ot)(Ot obj_txt_in) + string txt_quote()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5242,11 +5072,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_group(Ot)(Ot obj_txt_in) + string txt_group()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5256,11 +5083,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_block(Ot)(Ot obj_txt_in) + string txt_block()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5270,11 +5094,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_verse(Ot)(Ot obj_txt_in) + string txt_verse()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5284,11 +5105,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_code(Ot)(Ot obj_txt_in) + string txt_code()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5298,11 +5116,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_table(Ot)(Ot obj_txt_in) + string txt_table()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"content\"," @@ -5312,11 +5127,8 @@ template DocReformDocAbstraction() { } invariant() { } - string txt_comment(Ot)(Ot obj_txt_in) + string txt_comment()(string obj_txt_in) in { - debug(asserts) { - static assert(is(typeof(obj_txt_in) == string)); - } } body { _obj_attributes = " \"use\": \"comment\"," @@ -5326,16 +5138,11 @@ template DocReformDocAbstraction() { } invariant() { } - string _set_additional_values_parse_as_json(OA,Oi,OH)( - OA _obj_attrib, - Oi obj_is_, - OH _comp_obj_heading, + string _set_additional_values_parse_as_json()( + string _obj_attrib, + string obj_is_, + ObjGenericComposite _comp_obj_heading, ) { - debug(asserts) { - static assert(is(typeof(_obj_attrib) == string)); - static assert(is(typeof(obj_is_) == string)); - static assert(is(typeof(_comp_obj_heading) == ObjGenericComposite)); - } JSONValue oa_j = parseJSON(_obj_attrib); assert( (oa_j.type == JSON_TYPE.OBJECT) @@ -5355,7 +5162,7 @@ template DocReformDocAbstraction() { return _obj_attrib; } } - /+ +/ + /+ +/ struct BookIndexNuggetHash { string main_term, sub_term, sub_term_bits; int object_number_offset, object_number_endpoint; @@ -5363,14 +5170,13 @@ template DocReformDocAbstraction() { string[][string][string] bi; string[][string][string] hash_nugget; string[] bi_main_terms_split_arr; - string[][string][string] bookindex_nugget_hash(BI,N,S)( - BI bookindex_section, - N obj_cite_digits, - S tag_in_seg, + string[][string][string] bookindex_nugget_hash(N,S)( + string bookindex_section, + N obj_cite_digits, + S tag_in_seg, ) in { debug(asserts) { - static assert(is(typeof(bookindex_section) == string)); static assert(is(typeof(obj_cite_digits.object_number) == int)); } debug(bookindexraw) { @@ -5438,12 +5244,9 @@ template DocReformDocAbstraction() { } struct BookIndexReportIndent { int mkn, skn; - void bookindex_report_indented(BI)( - BI bookindex_unordered_hashes + void bookindex_report_indented()( + string[][string][string] bookindex_unordered_hashes ) { - debug(asserts) { - static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); - } auto mainkeys = bookindex_unordered_hashes.byKey.array.sort().release; foreach (mainkey; mainkeys) { @@ -5469,8 +5272,8 @@ template DocReformDocAbstraction() { int mkn, skn; static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); - void bookindex_write_section(BI)( - BI bookindex_unordered_hashes + void bookindex_write_section()( + string[][string][string] bookindex_unordered_hashes ) { auto mainkeys = bookindex_unordered_hashes.byKey.array @@ -5498,13 +5301,12 @@ template DocReformDocAbstraction() { ++mkn; } } - auto bookindex_build_abstraction_section(BI,N,B)( - BI bookindex_unordered_hashes, - N obj_cite_digits, - B opt_action, + auto bookindex_build_abstraction_section(N,B)( + string[][string][string] bookindex_unordered_hashes, + N obj_cite_digits, + B opt_action, ) { debug(asserts) { - static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string])); static assert(is(typeof(obj_cite_digits.object_number) == int)); } mixin DocReformNode; @@ -5652,7 +5454,7 @@ template DocReformDocAbstraction() { return t; } } - /+ +/ + /+ +/ struct NotesSection { string[string] object_notes; int previous_count; @@ -5835,17 +5637,13 @@ template DocReformDocAbstraction() { return t; } } - /+ +/ + /+ +/ struct Bibliography { - public JSONValue[] flow_bibliography_(Bi,BJ)( - return ref Bi biblio_unsorted_incomplete, - return ref BJ bib_arr_json + public JSONValue[] flow_bibliography_()( + return ref string[] biblio_unsorted_incomplete, + return ref JSONValue[] bib_arr_json ) in { - debug(asserts) { - static assert(is(typeof(biblio_unsorted_incomplete) == string[])); - static assert(is(typeof(bib_arr_json) == JSONValue[])); - } } body { JSONValue[] biblio_unsorted @@ -5869,14 +5667,10 @@ template DocReformDocAbstraction() { } return biblio_sorted__; } - final private JSONValue[] biblio_make_unsorted_array_of_json_objects(Bi,BJ)( - Bi biblio_unordered, - BJ bib_arr_json + final private JSONValue[] biblio_make_unsorted_array_of_json_objects()( + string[] biblio_unordered, + JSONValue[] bib_arr_json ) { - debug(asserts) { - static assert(is(typeof(biblio_unordered) == string[])); - static assert(is(typeof(bib_arr_json) == JSONValue[])); - } foreach (bibent; biblio_unordered) { /+ update bib to include deemed_author, needed for: sort_bibliography_array_by_deemed_author_year_title @@ -5901,10 +5695,7 @@ template DocReformDocAbstraction() { } return bib_arr_json.dup; } - final private JSONValue[] biblio_sort(BJ)(BJ biblio_unordered) { - debug(asserts) { - static assert(is(typeof(biblio_unordered) == JSONValue[])); - } + final private JSONValue[] biblio_sort()(JSONValue[] biblio_unordered) { JSONValue[] biblio_sorted_; biblio_sorted_ = sort!((a, b){ @@ -5919,10 +5710,7 @@ template DocReformDocAbstraction() { } return biblio_sorted_; } - void biblio_debug(BJ)(BJ biblio_sorted) { - debug(asserts) { - static assert(is(typeof(biblio_sorted) == JSONValue[])); - } + void biblio_debug()(JSONValue[] biblio_sorted) { debug(biblio0) { foreach (j; biblio_sorted) { if (!empty(j["fulltitle"].str)) { @@ -5932,30 +5720,25 @@ template DocReformDocAbstraction() { } } } - /+ +/ + /+ +/ struct NodeStructureMetadata { int lv, lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7; int obj_cite_digit; int[string] p_; // p_ parent_ static auto rgx = Rgx(); - ObjGenericComposite node_location_emitter(Lv,Tg,La,Ta,N,C,P,I)( - Lv lev_markup_number, - Tg tag_in_seg, - La lev_anchor_tag, - Ta tag_assoc, - N obj_cite_digits, - C cntr_, - P ptr_, - I is_ + ObjGenericComposite node_location_emitter(La,Ta,N)( + string lev_markup_number, + string[string] tag_in_seg, + La lev_anchor_tag, + Ta tag_assoc, + N obj_cite_digits, + int cntr_, + int ptr_, + string is_ ) in { debug(asserts) { - static assert(is(typeof(lev_markup_number) == string)); - static assert(is(typeof(tag_in_seg) == string[string])); static assert(is(typeof(obj_cite_digits.object_number) == int)); - static assert(is(typeof(cntr_) == int)); - static assert(is(typeof(ptr_) == int)); - static assert(is(typeof(is_) == string)); } assert(is_ != "heading"); assert(obj_cite_digits.object_number.to!int >= 0); @@ -6000,37 +5783,28 @@ template DocReformDocAbstraction() { } invariant() { } - ObjGenericComposite node_emitter_heading(T,Lm,Lc,Hd,TaB,TaL,TA,N,C,P,LA,I,PSn,fNr,fNs,fL)( - T _text, - Lm lev_markup_number, - Lc lev_collapsed_number, - Hd dummy_heading_status, - TaB tag_in_seg, - TaL lev_anchor_tag, - TA tag_assoc, - N obj_cite_digits, - C cntr_, - P ptr_, - LA lv_ancestors_txt, - I is_, - PSn html_segnames_ptr, - fNr flag_notes_reg, - fNs flag_notes_star, - fL flag_links, + ObjGenericComposite node_emitter_heading(Hd,TaL,TA,N,fNr,fNs,fL)( + string _text, + string lev_markup_number, + string lev_collapsed_number, + Hd dummy_heading_status, + string[string] tag_in_seg, + TaL lev_anchor_tag, + TA tag_assoc, + N obj_cite_digits, + int cntr_, + int ptr_, + string[] lv_ancestors_txt, + string is_, + int html_segnames_ptr, + fNr flag_notes_reg, + fNs flag_notes_star, + fL flag_links, ) in { debug(asserts) { - static assert(is(typeof(_text) == string)); static assert(is(typeof(lev) == string)); - static assert(is(typeof(lev_markup_number) == string)); - static assert(is(typeof(lev_collapsed_number) == string)); - static assert(is(typeof(tag_in_seg) == string[string])); static assert(is(typeof(obj_cite_digits.object_number) == int)); - static assert(is(typeof(cntr_) == int)); - static assert(is(typeof(ptr_) == int)); - static assert(is(typeof(lv_ancestors_txt) == string[])); - static assert(is(typeof(is_) == string)); - static assert(is(typeof(html_segnames_ptr) == int)); } assert(is_ == "heading"); assert((obj_cite_digits.object_number).to!int >= 0); @@ -6209,16 +5983,12 @@ template DocReformDocAbstraction() { invariant() { } } - /+ abstraction functions emitters ↑ +/ - /+ ↓ abstraction functions assertions +/ - pure void assertions_doc_structure(O,Lv)( - O an_object, - Lv lv + /+ abstraction functions emitters ↑ +/ + /+ ↓ abstraction functions assertions +/ + pure void assertions_doc_structure()( + string[string] an_object, + int[string] lv ) { - debug(asserts) { - static assert(is(typeof(an_object) == string[string])); - static assert(is(typeof(lv) == int[string])); - } if (lv["h3"] > State.off) { assert(lv["h0"] > State.off); assert(lv["h1"] > State.off); @@ -6390,10 +6160,7 @@ template DocReformDocAbstraction() { break; } } - pure void assertions_flag_types_block_status_none_or_closed(T)(T obj_type_status) { - debug(asserts) { - static assert(is(typeof(obj_type_status) == int[string])); - } + pure void assertions_flag_types_block_status_none_or_closed()(int[string] obj_type_status) { assert( (obj_type_status["code"] == TriState.off) || (obj_type_status["code"] == TriState.closing), @@ -6415,8 +6182,8 @@ template DocReformDocAbstraction() { || (obj_type_status["block"] == TriState.closing), "block status: off or closing"); } - /+ abstraction functions assertions ↑ +/ -} /+ ← closed: template DocReformDocAbstraction +/ + /+ abstraction functions assertions ↑ +/ +} /+ ← closed: template DocReformDocAbstraction +/ template docSectKeysSeq() { auto docSectKeysSeq(string[][string] document_section_keys_sequenced) { struct doc_sect_keys_seq { diff --git a/src/doc_reform/meta/metadoc_summary.d b/src/doc_reform/meta/metadoc_summary.d index 30f4a83..768cebd 100644 --- a/src/doc_reform/meta/metadoc_summary.d +++ b/src/doc_reform/meta/metadoc_summary.d @@ -1,8 +1,8 @@ module doc_reform.meta.metadoc_summary; template DocReformAbstractionSummary() { - auto DocReformAbstractionSummary(S,T)( - auto ref const S doc_abstraction, - auto ref T doc_matters, + void DocReformAbstractionSummary(S,T)( + const S doc_abstraction, + T doc_matters, ) { import doc_reform.meta.defaults, diff --git a/src/doc_reform/output/defaults.d b/src/doc_reform/output/defaults.d index b8ff322..ef0083a 100644 --- a/src/doc_reform/output/defaults.d +++ b/src/doc_reform/output/defaults.d @@ -6,36 +6,36 @@ module doc_reform.output.defaults; template InternalMarkup() { import std.array; static struct InlineMarkup { - auto en_a_o = "【"; auto en_a_c = "】"; - auto en_b_o = "〖"; auto en_b_c = "〗"; - auto quote_o = "“"; auto quote_c = "”"; - auto ff_o = "┨"; auto ff_c = "┣"; // fontface - auto lnk_o = "┥"; auto lnk_c = "┝"; - auto url_o = "┤"; auto url_c = "├"; - auto emph = "*"; - auto bold = "!"; - auto italic = "/"; - auto underscore = "_"; - auto superscript = "^"; - auto subscript = ","; - auto mono = "■"; - auto cite = "‖"; - auto mark_internal_site_lnk = "¤"; - auto nbsp = "░"; - auto br_line = "┘"; - auto br_nl = "┙"; - auto br_paragraph = "┚"; - auto br_obj = "break_obj"; - auto br_page_line = "┼"; - auto br_page = "┿"; - auto br_page_new = "╂"; - auto tc_s = "┊"; - auto tc_o = "┏"; - auto tc_c = "┚"; - auto tc_p = "┆"; - auto img = "☼"; - auto on_o = "「"; auto on_c = "」"; - auto mk_bullet = "● "; + string en_a_o = "【"; string en_a_c = "】"; + string en_b_o = "〖"; string en_b_c = "〗"; + string quote_o = "“"; string quote_c = "”"; + string ff_o = "┨"; string ff_c = "┣"; // fontface + string lnk_o = "┥"; string lnk_c = "┝"; + string url_o = "┤"; string url_c = "├"; + string emph = "*"; + string bold = "!"; + string italic = "/"; + string underscore = "_"; + string superscript = "^"; + string subscript = ","; + string mono = "■"; + string cite = "‖"; + string mark_internal_site_lnk = "¤"; + string nbsp = "░"; + string br_line = "┘"; + string br_nl = "┙"; + string br_paragraph = "┚"; + string br_obj = "break_obj"; + string br_page_line = "┼"; + string br_page = "┿"; + string br_page_new = "╂"; + string tc_s = "┊"; + string tc_o = "┏"; + string tc_c = "┚"; + string tc_p = "┆"; + string img = "☼"; + string on_o = "「"; auto on_c = "」"; + string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); return _indent_spaces; @@ -117,11 +117,11 @@ template DocReformLanguageCodes() { return _lang_codes; } static string[] code_arr_ptr() { - auto _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",]; + 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; } static string[] code_arr() { - auto _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"]; + 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; } static auto codes_() { diff --git a/src/doc_reform/output/html.d b/src/doc_reform/output/html.d index c9032e5..396f4a0 100644 --- a/src/doc_reform/output/html.d +++ b/src/doc_reform/output/html.d @@ -494,7 +494,7 @@ template outputHTML() { } } void css(M)( - auto ref M doc_matters, + M doc_matters, ) { auto css = DocReformCss(); auto pth_html = DocReformPathsHTML!()(doc_matters.output_path, doc_matters.src.language); @@ -515,7 +515,7 @@ template outputHTML() { } } void images_cp(M)( - auto ref M doc_matters, + M doc_matters, ) { { /+ (copy html images) +/ diff --git a/src/doc_reform/output/hub.d b/src/doc_reform/output/hub.d index a32bd9e..1f01dd6 100644 --- a/src/doc_reform/output/hub.d +++ b/src/doc_reform/output/hub.d @@ -9,7 +9,7 @@ template outputHub() { doc_reform.output.create_zip_file, doc_reform.output.paths_output; import std.parallelism; - void outputHub(D,I)(D doc_abstraction, I doc_matters) { + void outputHub(D,I)(const D doc_abstraction, I doc_matters) { mixin DocReformOutputRgxInit; mixin Msg; auto msg = Msg!()(doc_matters); diff --git a/src/doc_reform/output/sqlite.d b/src/doc_reform/output/sqlite.d index 832e2e7..57c90e0 100644 --- a/src/doc_reform/output/sqlite.d +++ b/src/doc_reform/output/sqlite.d @@ -11,17 +11,17 @@ static auto rgx = Rgx(); long _metadata_tid_lastrowid; template SQLiteHubBuildTablesAndPopulate() { void SQLiteHubBuildTablesAndPopulate(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { auto pth_sqlite = DocReformPathsSQLite!()(doc_matters.sqlite.filename, doc_matters.output_path); pth_sqlite.base.mkdirRecurse; auto db = Database(pth_sqlite.sqlite_file); template SQLiteDbStatementComposite() { void SQLiteDbStatementComposite(Db,D,M)( - Db db, - D doc_abstraction, - M doc_matters, + Db db, + const D doc_abstraction, + M doc_matters, ) { { string _db_statement; @@ -58,17 +58,17 @@ template SQLiteHubBuildTablesAndPopulate() { } template SQLiteHubDiscreteBuildTablesAndPopulate() { void SQLiteHubDiscreteBuildTablesAndPopulate(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { auto pth_sqlite = DocReformPathsSQLiteDiscrete!()(doc_matters.output_path, doc_matters.src.language); pth_sqlite.base.mkdirRecurse; auto db = Database(pth_sqlite.sqlite_file(doc_matters.src.filename)); template SQLiteDiscreteDbStatementComposite() { void SQLiteDiscreteDbStatementComposite(Db,D,M)( - Db db, - D doc_abstraction, - M doc_matters, + Db db, + const D doc_abstraction, + M doc_matters, ) { { string _db_statement; @@ -137,7 +137,7 @@ template SQLiteFormatAndLoadObject() { ) { mixin DocReformOutputRgxInit; struct sqlite_format_and_load_objects { - auto generic_munge_sanitize_text_for_search( + string generic_munge_sanitize_text_for_search( string _txt, ) { string _notes; @@ -173,9 +173,9 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto munge_html(M,O)( - M doc_matters, - auto ref const O obj, + string munge_html(M,O)( + M doc_matters, + const O obj, ) { string _html_special_characters(string _txt){ _txt = _txt @@ -254,7 +254,7 @@ template SQLiteFormatAndLoadObject() { .replaceAll(rgx.inline_cite, "$1"); return _txt; } - auto inline_images(M,O)( + string inline_images(M,O)( M doc_matters, const O obj, string _txt, @@ -278,7 +278,7 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto inline_links(M,O)( + string inline_links(M,O)( M doc_matters, const O obj, string _txt, @@ -379,7 +379,7 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - auto inline_notes_scroll(M,O)( + string inline_notes_scroll(M,O)( M doc_matters, const O obj, string _txt, @@ -443,7 +443,7 @@ template SQLiteFormatAndLoadObject() { return t; } string xml_type="seg"; /+ set html document type to be linked to here (seg|scroll) +/ - auto inline_markup(M,O)( + string inline_markup(M,O)( M doc_matters, const O obj, string _txt, @@ -453,9 +453,9 @@ template SQLiteFormatAndLoadObject() { _txt = inline_notes_scroll(doc_matters, obj, _txt); return _txt; } - auto html_heading(M,O)( - M doc_matters, - auto ref const O obj, + string html_heading(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -471,9 +471,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_para(M,O)( - M doc_matters, - auto ref const O obj, + string html_para(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body" || "frontmatter" || "backmatter"); assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -492,9 +492,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_quote(M,O)( - M doc_matters, - auto ref const O obj, + string html_quote(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -509,9 +509,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_group(M,O)( - M doc_matters, - auto ref const O obj, + string html_group(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -526,9 +526,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_block(M,O)( - M doc_matters, - auto ref const O obj, + string html_block(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -542,9 +542,9 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_verse(M,O)( - M doc_matters, - auto ref const O obj, + string html_verse(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body" || "glossary" || "bibliography" || "bookindex" || "blurb"); @@ -557,8 +557,8 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_code(O)( - auto ref const O obj, + string html_code(O)( + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); @@ -571,17 +571,17 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto html_table(M,O)( - M doc_matters, - auto ref const O obj, + string html_table(M,O)( + M doc_matters, + const O obj, ) { assert(obj.metainfo.is_of_part == "body"); assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); auto _tablarize(O)( - auto ref const O obj, - string _txt, + const O obj, + string _txt, ) { string[] _table_rows = _txt.split(rgx.table_delimiter_row); string[] _table_cols; @@ -636,24 +636,24 @@ template SQLiteFormatAndLoadObject() { ); return o; } - auto sqlite_load_string(M,O)( - auto ref M doc_matters, - auto ref const O obj, + string sqlite_load_string(M,O)( + M doc_matters, + const O obj, ) { string o; return o; } - auto postgresql_load_string(M,O)( - auto ref M doc_matters, - auto ref const O obj, + string postgresql_load_string(M,O)( + M doc_matters, + const O obj, ) { string o; return o; } string sqlite_statement(O)( - auto ref const O obj, - string _txt, - string _html, + const O obj, + string _txt, + string _html, ) { void _sql_exe(O)( string _sql, @@ -664,9 +664,9 @@ template SQLiteFormatAndLoadObject() { string _sql; return _sql; } - auto heading(M,O)( - M doc_matters, - auto ref const O obj, + string[string] heading(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -687,9 +687,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto para(M,O)( - M doc_matters, - auto ref const O obj, + string[string] para(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -710,9 +710,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto quote(M,O)( - M doc_matters, - auto ref const O obj, + string[string] quote(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -733,9 +733,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto group(M,O)( - M doc_matters, - auto ref const O obj, + string[string] group(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -756,9 +756,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto block(M,O)( - M doc_matters, - auto ref const O obj, + string[string] block(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -779,9 +779,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto verse(M,O)( - M doc_matters, - auto ref const O obj, + string[string] verse(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -802,9 +802,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto code(M,O)( - M doc_matters, - auto ref const O obj, + string[string] code(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -825,9 +825,9 @@ template SQLiteFormatAndLoadObject() { } return obj_txt; } - auto table(M,O)( - M doc_matters, - auto ref const O obj, + string[string] table(M,O)( + M doc_matters, + const O obj, ) { string[string] obj_txt = [ "text": generic_munge_sanitize_text_for_search(obj.text), @@ -1166,8 +1166,8 @@ template SQLiteInsertMetadata() { } template SQLiteInsertDocObjectsLoop() { string SQLiteInsertDocObjectsLoop(D,M)( - D doc_abstraction, - M doc_matters, + const D doc_abstraction, + M doc_matters, ) { string _uid = SQLinsertDelimiter!()(doc_matters.src.doc_uid); auto site_url = DocReformPathsUrl!()(doc_matters); diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d index 90f4e7d..25733b1 100644 --- a/src/doc_reform/output/xmls.d +++ b/src/doc_reform/output/xmls.d @@ -16,8 +16,8 @@ template outputXHTMLs() { struct outputXHTMLs { static auto rgx = Rgx(); string div_delimit( - string part, - return ref string previous_part + string part, + return ref string previous_part ){ string delimit = ""; string delimit_ = ""; @@ -90,7 +90,7 @@ template outputXHTMLs() { } return tags; } - auto header_metadata(M)( + string header_metadata(M)( M doc_matters, ) { string _publisher="Publisher"; // TODO @@ -127,7 +127,7 @@ template outputXHTMLs() { ); return o; } - auto site_info_button(M)( + string site_info_button(M)( M doc_matters, ) { string _locations; @@ -151,7 +151,7 @@ template outputXHTMLs() { ); return o; } - auto inline_search_form(M)( + string inline_search_form(M)( M doc_matters, ) { string _action="http://www.sisudoc.org/cgi-bin/search.cgi"; @@ -186,7 +186,7 @@ template outputXHTMLs() { ); return o; } - auto html_head(M)( + string html_head(M)( M doc_matters, string type, ) { @@ -241,7 +241,7 @@ template outputXHTMLs() { ); return o; } - auto epub3_seg_head(M)( + string epub3_seg_head(M)( M doc_matters, ) { string html_base = format(q"┃ @@ -309,7 +309,7 @@ template outputXHTMLs() { ); return o; } - auto tail() { + string tail() { string o; o = format(q"┃ @@ -318,7 +318,7 @@ template outputXHTMLs() { ┃"); return o; } - auto inline_images(O,M)( + string inline_images(O,M)( string _txt, const O obj, M doc_matters, @@ -345,7 +345,7 @@ template outputXHTMLs() { } return _txt; } - auto inline_links(O,M)( + string inline_links(O,M)( string _txt, const O obj, M doc_matters, @@ -436,7 +436,7 @@ template outputXHTMLs() { } return _txt; } - auto inline_notes_scroll(O,M)( + string inline_notes_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -500,7 +500,7 @@ template outputXHTMLs() { ); return t; } - auto inline_markup_scroll(O,M)( + string inline_markup_scroll(O,M)( string _txt, const O obj, M doc_matters, @@ -641,7 +641,7 @@ template outputXHTMLs() { } return bar(); } - auto heading(O)( + string heading(O)( string _txt, const O obj, string _xml_type = "html", @@ -650,7 +650,7 @@ template outputXHTMLs() { assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "para"); assert(obj.metainfo.is_a == "heading"); - auto tags = _xhtml_anchor_tags(obj); + string tags = _xhtml_anchor_tags(obj); string heading_lev_anchor_tag; string _horizontal_rule = "
"; if ((_xml_type != "html") @@ -705,13 +705,12 @@ template outputXHTMLs() { } return o; } - auto heading_scroll(O,M)( + string heading_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = heading(_txt, obj); return o; @@ -733,7 +732,7 @@ template outputXHTMLs() { ); return u; } - auto para(O)( + string para(O)( string _txt, const O obj, ) { @@ -741,7 +740,7 @@ template outputXHTMLs() { assert(obj.metainfo.is_of_section == "body" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); assert(obj.metainfo.is_of_type == "para"); assert(obj.metainfo.is_a == "para" || "toc" || "endnotes" || "glossary" || "bibliography" || "bookindex" || "blurb"); - auto tags = _xhtml_anchor_tags(obj); + string tags = _xhtml_anchor_tags(obj); _txt = font_face(_txt); string o; _txt = (obj.attrib.bullet) ? ("●  " ~ _txt) : _txt; @@ -778,13 +777,12 @@ template outputXHTMLs() { } return o; } - auto para_scroll(O,M)( + string para_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = para(_txt, obj); return o; @@ -806,7 +804,7 @@ template outputXHTMLs() { ); return u; } - auto quote(O)( + string quote(O)( string _txt, const O obj, ) { @@ -841,13 +839,12 @@ template outputXHTMLs() { } return o; } - auto quote_scroll(O,M)( + string quote_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = quote(_txt, obj); return o; @@ -869,7 +866,7 @@ template outputXHTMLs() { ); return u; } - auto group(O)( + string group(O)( string _txt, const O obj, ) { @@ -904,14 +901,13 @@ template outputXHTMLs() { } return o; } - auto group_scroll(O,M)( + string group_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = group(_txt, obj); return o; @@ -933,7 +929,7 @@ template outputXHTMLs() { ); return u; } - auto block(O)( + string block(O)( string _txt, const O obj, ) { @@ -964,14 +960,13 @@ template outputXHTMLs() { } return o; } - auto block_scroll(O,M)( + string block_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = block(_txt, obj); return o; @@ -993,7 +988,7 @@ template outputXHTMLs() { ); return u; } - auto verse(O)( + string verse(O)( string _txt, const O obj, ) { @@ -1024,14 +1019,13 @@ template outputXHTMLs() { } return o; } - auto verse_scroll(O,M)( + string verse_scroll(O,M)( string _txt, const O obj, M doc_matters, string _suffix = ".html", string _xml_type = "html", ) { - auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(_txt, obj, doc_matters, _suffix); string o = verse(_txt, obj); return o; @@ -1086,7 +1080,7 @@ template outputXHTMLs() { ); return t; } - auto table(O)( + string table(O)( string _txt, const O obj, ) { @@ -1094,7 +1088,7 @@ template outputXHTMLs() { assert(obj.metainfo.is_of_section == "body"); assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "table"); - auto tags = _xhtml_anchor_tags(obj); + string tags = _xhtml_anchor_tags(obj); _txt = font_face(_txt); auto t = tablarize(_txt, obj); _txt = t[0]; @@ -1119,7 +1113,7 @@ template outputXHTMLs() { ); return o; } - auto code(O)( + string code(O)( string _txt, const O obj, ) { diff --git a/src/doc_reform/source/read_config_files.d b/src/doc_reform/source/read_config_files.d index fc5ce2f..dbcda7c 100644 --- a/src/doc_reform/source/read_config_files.d +++ b/src/doc_reform/source/read_config_files.d @@ -13,7 +13,7 @@ static template configReadInSiteTOML() { final string configReadInSiteTOML(M,E)(M manifest, E env) { auto conf_file_details = ConfigFilePaths!()(manifest, env); string conf_toml = conf_file_details.config_filename_site_toml; - auto possible_config_path_locations = conf_file_details.possible_config_path_locations.config_local_site; + string[] possible_config_path_locations = conf_file_details.possible_config_path_locations.config_local_site; string config_file_str; debug(io) { writeln("WARNING (io debug) in config filename: ", conf_toml); @@ -48,7 +48,7 @@ static template configReadInDocTOML() { final string configReadInDocTOML(M,E)(M manifest, E env) { auto conf_file_details = ConfigFilePaths!()(manifest, env); string conf_toml = conf_file_details.config_filename_document_toml; - auto possible_config_path_locations = conf_file_details.possible_config_path_locations.sisu_document_make; + string[] possible_config_path_locations = conf_file_details.possible_config_path_locations.sisu_document_make; string config_file_str; debug(io) { writeln("WARNING (io debug) in config filename: ", conf_toml); @@ -81,7 +81,7 @@ static template configTOML() { doc_reform.source.paths_source, std.file, std.path; - auto configTOML(string configuration, string conf_toml_filename) { + TOMLDocument configTOML(string configuration, string conf_toml_filename) { TOMLDocument _toml_conf; try { _toml_conf = parseTOML(configuration); // parseTOML(cast(string)(configuration)); @@ -102,10 +102,10 @@ static template readConfigSite() { string config_file_str; string conf_filename = "NONE"; auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); - auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.config_local_site; + string[] possible_config_path_locations = _conf_file_details.possible_config_path_locations.config_local_site; foreach(conf_fn; [_conf_file_details.config_filename_site_toml]) { foreach(pth; possible_config_path_locations) { - auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array; + char[] conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array; conf_filename = conf_fn; if (config_file_str.length > 0) { // conf_filename = conf_fn; @@ -132,7 +132,7 @@ static template readConfigSite() { string filetype() { return conf_filename.extension.chompPrefix("."); } - auto content() { + string content() { return config_file_str; } } @@ -149,7 +149,7 @@ static template readConfigDoc() { string config_file_str; string conf_filename = "NONE"; auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); - auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.sisu_document_make; + string[] possible_config_path_locations = _conf_file_details.possible_config_path_locations.sisu_document_make; foreach(conf_fn; [_conf_file_details.config_filename_document_toml]) { foreach(pth; possible_config_path_locations) { auto conf_file = asNormalizedPath(chainPath(pth.to!string, conf_fn)).array; @@ -193,11 +193,11 @@ static template configReadSiteTOML() { std.file, std.path; import toml; - final auto configReadSiteTOML(M,E)(M _manifest, E _env) { - auto _configuration = configReadInSiteTOML!()(_manifest, _env); + final TOMLDocument configReadSiteTOML(M,E)(M _manifest, E _env) { + string _configuration = configReadInSiteTOML!()(_manifest, _env); auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); string _conf_toml = _conf_file_details.config_filename_site_toml; - auto _toml_conf = configTOML!()(_configuration, _conf_toml); + TOMLDocument _toml_conf = configTOML!()(_configuration, _conf_toml); return _toml_conf; } } @@ -208,11 +208,11 @@ static template configReadDocTOML() { std.file, std.path; import toml; - final auto configReadDocTOML(M,E)(M _manifest, E _env) { - auto _configuration = configReadInDocTOML!()(_manifest, _env); + final TOMLDocument configReadDocTOML(M,E)(M _manifest, E _env) { + string _configuration = configReadInDocTOML!()(_manifest, _env); auto _conf_file_details = ConfigFilePaths!()(_manifest, _env); string _conf_toml = _conf_file_details.config_filename_document_toml; - auto _toml_conf = configTOML!()(_configuration, _conf_toml); + TOMLDocument _toml_conf = configTOML!()(_configuration, _conf_toml); return _toml_conf; } } diff --git a/src/doc_reform/source/read_source_files.d b/src/doc_reform/source/read_source_files.d index 5c1e6fb..0bd7b8c 100644 --- a/src/doc_reform/source/read_source_files.d +++ b/src/doc_reform/source/read_source_files.d @@ -17,7 +17,7 @@ static template DocReformRawMarkupContent() { string[] _images=[]; auto _extract_images(S)(S content_block) { string[] images_; - auto _content_block = content_block.to!string; + string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { images_ ~= m.captures[1].to!string; } @@ -159,7 +159,7 @@ static template DocReformRawMarkupContent() { ) { mixin DocReformRgxInitFlags; char[][] contents_insert; - auto type1 = flags_type_init; + int[string] type1 = flags_type_init; auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm); auto markup_src_file_path = fn_pth_full.captures[1]; foreach (line; markup_sourcefile_insert_content) { @@ -245,7 +245,7 @@ static template DocReformRawMarkupContent() { import std.algorithm; mixin DocReformRgxInitFlags; char[][] contents; - auto type = flags_type_init; + int[string] type = flags_type_init; auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm); auto markup_src_file_path = fn_pth_full.captures[1]; char[][] contents_insert; -- cgit v1.2.3