From 10ec5e96d65b58dbe915c2d622b0bfb8abbd122b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 21 Dec 2019 11:38:05 -0500 Subject: reduce use of auto, much with tuples --- org/default_misc.org | 2 +- org/in_source_files.org | 64 +++++++++++++-------- org/meta_conf_make_meta.org | 2 +- org/metaverse.org | 80 ++++++++++++++++---------- org/out_harvest_metadata.org | 10 ++-- org/out_latex.org | 6 +- org/out_metadata.org | 6 +- org/out_odt.org | 2 +- org/out_sqlite.org | 6 +- org/out_xmls.org | 20 +++---- src/doc_reform/io_in/read_source_files.d | 64 +++++++++++++-------- src/doc_reform/io_out/defaults.d | 2 +- src/doc_reform/io_out/epub3.d | 6 +- src/doc_reform/io_out/html.d | 6 +- src/doc_reform/io_out/latex.d | 6 +- src/doc_reform/io_out/metadata.d | 4 +- src/doc_reform/io_out/odt.d | 2 +- src/doc_reform/io_out/sqlite.d | 6 +- src/doc_reform/io_out/xmls.d | 8 +-- src/doc_reform/meta/conf_make_meta_structs.d | 2 +- src/doc_reform/meta/defaults.d | 2 +- src/doc_reform/meta/metadoc_from_src.d | 80 ++++++++++++++++---------- src/doc_reform/meta/metadoc_harvest.d | 2 +- src/doc_reform/meta/metadoc_harvests_authors.d | 2 +- src/doc_reform/meta/metadoc_harvests_topics.d | 2 +- 25 files changed, 232 insertions(+), 160 deletions(-) diff --git a/org/default_misc.org b/org/default_misc.org index 8988f3e..5351c30 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -292,7 +292,7 @@ template InternalMarkup() { string tc_p = "┆"; string img = "☼"; string sep = "␣"; - string on_o = "「"; auto on_c = "」"; + string on_o = "「"; string on_c = "」"; string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); diff --git a/org/in_source_files.org b/org/in_source_files.org index cb95fda..7ea9bae 100644 --- a/org/in_source_files.org +++ b/org/in_source_files.org @@ -267,7 +267,7 @@ static template spineRawMarkupContent() { mixin spineRgxInit; static auto rgx = Rgx(); string[] _images=[]; - auto _extract_images(S)(S content_block) @safe { + string[] _extract_images(S)(S content_block) @safe { string[] images_; string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { @@ -276,6 +276,17 @@ static template spineRawMarkupContent() { return images_; } auto rawsrc = RawMarkupContent(); + alias ContentsInsertsImages = Tuple!( + char[][], "contents", + string[], "insert_files", + string[], "images" + ); + alias HeaderContentInsertsImages = Tuple!( + char[], "header", + char[][], "src_txt", + string[], "insert_files", + string[], "images" + ); auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) @safe { auto _0_header_1_body_content_2_insert_filelist_tuple = rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src); @@ -284,7 +295,7 @@ static template spineRawMarkupContent() { struct RawMarkupContent { final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); - auto source_txt_str + string source_txt_str = raw.markupSourceReadIn(fn_src); return source_txt_str; } @@ -296,22 +307,22 @@ static template spineRawMarkupContent() { auto raw = MarkupRawUnit(); string[] insert_file_list; string[] images_list; - Tuple!(char[], char[][], string[], string[]) t + HeaderContentInsertsImages t = raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); - auto header_raw = t[0]; - auto sourcefile_body_content = t[1]; + char[] header_raw = t.header; + char[][] sourcefile_body_content = t.src_txt; if (fn_src.match(rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise auto ins = Inserts(); - Tuple!(char[][], string[], string[]) tu + ContentsInsertsImages tu = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src); - sourcefile_body_content = tu[0]; - insert_file_list = tu[1].dup; - images_list = tu[2].dup; + sourcefile_body_content = tu.contents; + insert_file_list = tu.insert_files.dup; + images_list = tu.images.dup; } else if (_opt_action.source || _opt_action.pod) { auto ins = Inserts(); - Tuple!(char[][], string[], string[]) tu + ContentsInsertsImages tu = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src); - images_list = tu[2].dup; + images_list = tu.images.dup; } string header_type = ""; t = tuple( @@ -320,7 +331,6 @@ static template spineRawMarkupContent() { insert_file_list, images_list ); - static assert(t.length==4); return t; } } @@ -334,7 +344,11 @@ static template spineRawMarkupContent() { <> } struct Inserts { - auto scan_subdoc_source(O)( + alias ContentsAndImages = Tuple!( + char[][], "insert_contents", + string[], "images" + ); + ContentsAndImages scan_subdoc_source(O)( O _opt_action, char[][] markup_sourcefile_insert_content, string fn_src @@ -346,7 +360,7 @@ static template spineRawMarkupContent() { } // end src subdoc (inserts) loop <> } - Tuple!(char[][], string[], string[]) scan_master_src_for_insert_files_and_import_content(O)( + ContentsInsertsImages scan_master_src_for_insert_files_and_import_content(O)( O _opt_action, char[][] sourcefile_body_content, string fn_src @@ -434,14 +448,14 @@ final private char[][] markupSourceLineArray(in char[] src_text) @trusted { // c #+name: meta_markup_source_raw_read_in_file #+BEGIN_SRC d -auto markupSourceReadIn(in string fn_src) { +string markupSourceReadIn(in string fn_src) { static auto rgx = Rgx(); enforce( fn_src.match(rgx.src_pth_sst_or_ssm), "not a dr markup filename: «" ~ fn_src ~ "»" ); - auto source_txt_str = readInMarkupSource(fn_src); + string source_txt_str = readInMarkupSource(fn_src); return source_txt_str; } #+END_SRC @@ -455,14 +469,14 @@ auto markupSourceReadIn(in string fn_src) { #+name: meta_markup_source_raw_tuple_of_header_and_body #+BEGIN_SRC d -Tuple!(char[], char[][], string[], string[]) markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) @safe { +HeaderContentInsertsImages markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) @safe { string[] file_insert_list = []; string[] images_list = []; char[][] hc = header0Content1(source_txt_str); char[] header = hc[0]; char[] source_txt = hc[1]; char[][] source_line_arr = markupSourceLineArray(source_txt); - Tuple!(char[], char[][], string[], string[]) t = tuple( + HeaderContentInsertsImages t = tuple( header, source_line_arr, file_insert_list, @@ -570,7 +584,7 @@ if (type1["curly_code"] == 1) { type1["header_meta"] = 0; contents_insert ~= line; // images to extract for image list? if (_opt_action.source || _opt_action.pod) { - auto _image_linelist = _extract_images(line); + string[] _image_linelist = _extract_images(line); if (_image_linelist.length > 0) { _images ~= _image_linelist; } @@ -582,7 +596,7 @@ if (type1["curly_code"] == 1) { #+name: meta_inserts_scan_post #+BEGIN_SRC d -Tuple!(char[][], string[]) t = tuple( +ContentsAndImages t = tuple( contents_insert, _images ); @@ -642,14 +656,14 @@ if (type["curly_code"] == 1) { ); } auto ins = Inserts(); - auto contents_insert_tu = ins.scan_subdoc_source( + ContentsAndImages contents_insert_tu = ins.scan_subdoc_source( _opt_action, markup_sourcefile_insert_content, fn_src_insert.to!string ); - contents ~= contents_insert_tu[0]; // images to extract for image list? + contents ~= contents_insert_tu.insert_contents; if (_opt_action.source || _opt_action.pod) { - auto _image_linelist = _extract_images(contents_insert_tu[0]); + string[] _image_linelist = _extract_images(contents_insert_tu.images); if (_image_linelist.length > 0) { _images ~= _image_linelist; } @@ -667,7 +681,7 @@ if (type["curly_code"] == 1) { } else { contents ~= line; if (_opt_action.source || _opt_action.pod) { - auto _image_linelist = _extract_images(line); + string[] _image_linelist = _extract_images(line); if (_image_linelist.length > 0) { _images ~= _image_linelist; } @@ -687,7 +701,7 @@ debug(insert_file) { writeln(__LINE__); writeln(contents.length); } -Tuple!(char[][], string[], string[]) t = tuple( +ContentsInsertsImages t = tuple( contents, insert_file_list, images diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index 746f712..0362a83 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -69,7 +69,7 @@ import mixin spineRgxInit; static auto rgx = Rgx(); mixin InternalMarkup; -auto mkup = InlineMarkup(); +static auto mkup = InlineMarkup(); #+END_SRC ** struct Generic ConfComposite diff --git a/org/metaverse.org b/org/metaverse.org index cc8414b..be6c662 100644 --- a/org/metaverse.org +++ b/org/metaverse.org @@ -238,6 +238,28 @@ int[] dom_structure_markedup_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,] int[] dom_structure_markedup_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; 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,]; +alias TxtPlusHasFootnotes = Tuple!( + string, "obj_txt", + bool, "has_notes_reg", + bool, "has_notes_star", + bool, "has_notes_plus", +); +alias TxtPlusHasFootnotesUrlsImages = Tuple!( + string, "obj_txt", + bool, "has_notes_reg", + bool, "has_notes_star", + bool, "has_notes_plus", + bool, "has_urls", + bool, "has_images_without_dimensions", +); +alias TxtAndAnchorTagPlusHasFootnotesUrlsImages = Tuple!( + string, "obj_txt", + string, "anchor_tag", + bool, "has_notes_reg", + bool, "has_notes_star", + bool, "has_links", + bool, "has_images_without_dimensions", +); enum DomTags { none, open, close, close_and_open, open_still, } #+END_SRC @@ -1295,7 +1317,7 @@ if ((obj_type_status["heading"] == State.on) : ocn_emit(obj_type_status["ocn_status"]); an_object["is"] = "heading"; an_object_key="body_nugget"; - auto substantive_object_and_anchor_tags_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, ((_new_doc) ? Yes._new_doc : No._new_doc)); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[sObj.content]; anchor_tag = substantive_object_and_anchor_tags_tuple[sObj.anchor_tag]; @@ -1440,7 +1462,7 @@ if ((obj_type_status["heading"] == State.on) heading_ptr-1, an_object["is"], ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3943,7 +3965,7 @@ string[string] flow_txt_block_poem(CMM)( ); } an_object["is"] = "verse"; - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4006,7 +4028,7 @@ string[string] flow_txt_block_poem(CMM)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4052,7 +4074,7 @@ string[string] flow_txt_block_poem(CMM)( } processing.remove("verse"); an_object["is"] = "verse"; - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4115,7 +4137,7 @@ string[string] flow_txt_block_poem(CMM)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4261,7 +4283,7 @@ void flow_table_closed_make_special_notation_table_(N,CMM)( "table" ); an_object["is"] = "table"; - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block.metainfo.ocn = obj_cite_digits.object_number; @@ -4339,7 +4361,7 @@ string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4396,7 +4418,7 @@ string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4453,7 +4475,7 @@ string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; // anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4552,7 +4574,7 @@ string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -4610,7 +4632,7 @@ string[string] flow_block_flag_line_empty_(B,N,CMM,Ts)( heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; @@ -5422,7 +5444,7 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - Tuple!(string, bool, bool, bool) footnotes_endnotes_markup_and_number_or_stars()(string obj_txt_in, bool reset_note_numbers) @safe { + TxtPlusHasFootnotes footnotes_endnotes_markup_and_number_or_stars()(string obj_txt_in, bool reset_note_numbers) @safe { /+ endnotes (regular) +/ bool flg_notes_reg = false; bool flg_notes_star = false; @@ -5478,7 +5500,7 @@ static struct ObjInlineMarkupMunge { } else { obj_txt_out = obj_txt_in; } - Tuple!(string, bool, bool, bool) t = tuple( + TxtPlusHasFootnotes t = tuple( obj_txt_out, flg_notes_reg, flg_notes_star, @@ -5492,7 +5514,7 @@ static struct ObjInlineMarkupMunge { #+name: meta_emitters_obj_inline_markup_munge #+BEGIN_SRC d - private Tuple!(string, bool, bool, bool, bool, bool) object_notes_and_links_()( + private TxtPlusHasFootnotesUrlsImages object_notes_and_links_()( string obj_txt_in, bool reset_note_numbers=false ) @safe { @@ -5526,8 +5548,8 @@ static struct ObjInlineMarkupMunge { obj_txt_in = obj_txt_in .replaceAll(rgx.para_inline_link_anchor, "┃$1┃"); } - Tuple!(string, bool, bool, bool) ftn = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers); - obj_txt_out = ftn[0]; + TxtPlusHasFootnotes ftn = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers); + obj_txt_out = ftn.obj_txt; debug(footnotes) { writeln(obj_txt_out, tail); } @@ -5539,18 +5561,18 @@ static struct ObjInlineMarkupMunge { writeln(m.hit); } } - Tuple!(string, bool, bool, bool, bool, bool) t = tuple( + TxtPlusHasFootnotesUrlsImages t = tuple( obj_txt_out, - ftn[1], - ftn[2], - ftn[3], + ftn.has_notes_reg, + ftn.has_notes_star, + ftn.has_notes_plus, urls, images_without_dimensions, ); return t; } auto init() { - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(""); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(""); return t; } invariant() { @@ -5571,7 +5593,7 @@ static struct ObjInlineMarkupMunge { .replaceFirst(rgx.heading, "") .replaceFirst(rgx.object_number_off_all, "") .strip; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); debug(munge) { writeln(__LINE__); writeln(obj_txt_in); @@ -5598,7 +5620,7 @@ static struct ObjInlineMarkupMunge { obj_txt["munge"]=(obj_txt_in) .replaceFirst(rgx.para_attribs, "") .replaceFirst(rgx.object_number_off_all, ""); - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); debug(munge) { writeln(__LINE__); writeln(obj_txt_in); @@ -5634,7 +5656,7 @@ static struct ObjInlineMarkupMunge { #+BEGIN_SRC d auto munge_group(string obj_txt_in) @safe { obj_txt["munge"]=obj_txt_in; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); return t; } invariant() { @@ -5654,7 +5676,7 @@ static struct ObjInlineMarkupMunge { #+BEGIN_SRC d auto munge_block()(string obj_txt_in) @safe { obj_txt["munge"]=obj_txt_in; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); return t; } invariant() { @@ -5674,7 +5696,7 @@ static struct ObjInlineMarkupMunge { #+BEGIN_SRC d auto munge_verse()(string obj_txt_in) @safe { obj_txt["munge"]=obj_txt_in; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); return t; } invariant() { @@ -5749,7 +5771,7 @@ 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(CMM)( + TxtAndAnchorTagPlusHasFootnotesUrlsImages obj_inline_markup_and_anchor_tags_and_misc(CMM)( string[string] obj_, string obj_key_, CMM conf_make_meta, @@ -5829,7 +5851,7 @@ static struct ObjInlineMarkup { obj_notes_and_links["image_no_dimensions"] = x[5]; break; } - Tuple!(string, string, bool, bool, bool, bool) t = tuple( + TxtAndAnchorTagPlusHasFootnotesUrlsImages t = tuple( obj_txt["munge"], anchor_tag, obj_notes_and_links["notes_reg"], diff --git a/org/out_harvest_metadata.org b/org/out_harvest_metadata.org index 7a27ebf..4b7fe7e 100644 --- a/org/out_harvest_metadata.org +++ b/org/out_harvest_metadata.org @@ -58,7 +58,7 @@ import #+name: metadoc_harvest_initialize #+BEGIN_SRC d -auto markup = InlineMarkup(); +static auto mkup = InlineMarkup(); #+END_SRC ** harvest summary @@ -73,12 +73,12 @@ char_repeat_number = (char_repeat_number > min_repeat_number) : min_repeat_number; writefln( "%s\n\"%s\", %s\n%s\n%s\n%s", - markup.repeat_character_by_number_provided("-", char_repeat_number), + mkup.repeat_character_by_number_provided("-", char_repeat_number), doc_matters.conf_make_meta.meta.title_full, doc_matters.conf_make_meta.meta.creator_author, doc_matters.src.filename, doc_matters.conf_make_meta.meta.classify_topic_register_arr, - markup.repeat_character_by_number_provided("-", char_repeat_number), + mkup.repeat_character_by_number_provided("-", char_repeat_number), ); #+END_SRC @@ -127,7 +127,7 @@ module doc_reform.meta.metadoc_harvests_topics; mixin InternalMarkup; mixin spineRgxInit; template spineMetaDocHarvestsTopics() { - auto mkup = InlineMarkup(); + static auto mkup = InlineMarkup(); void spineMetaDocHarvestsTopics(H,M,O)( H hvst, M _make_and_meta_struct, @@ -459,7 +459,7 @@ module doc_reform.meta.metadoc_harvests_authors; mixin InternalMarkup; mixin spineRgxInit; template spineMetaDocHarvestsAuthors() { - auto mkup = InlineMarkup(); + static auto mkup = InlineMarkup(); void spineMetaDocHarvestsAuthors(H,M,O)( H harvests, M _make_and_meta_struct, diff --git a/org/out_latex.org b/org/out_latex.org index 8ae369b..8a84ceb 100644 --- a/org/out_latex.org +++ b/org/out_latex.org @@ -25,7 +25,7 @@ template outputLaTeX() { <> mixin InternalMarkup; // watch mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); mixin spineLanguageCodes; auto lang = Lang(); <> @@ -75,8 +75,8 @@ void writeOutputLaTeX(T,M)( f.writeln(latex_content.content); f.writeln(latex_content.tail); foreach (image; doc_matters.srcs.image_list) { - auto fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; - auto fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; + string fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; + string fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; if (exists(fn_src_in)) { fn_src_in.copy(fn_src_out_file); } diff --git a/org/out_metadata.org b/org/out_metadata.org index f3c069c..e8da2c4 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -19,8 +19,8 @@ ** _module template_ metadoc document metadata -#+BEGIN_SRC d :tangle "../src/spine/io_out/metadata.d" -module spine.io_out.metadata; +#+BEGIN_SRC d :tangle "../src/doc_reform/io_out/metadata.d" +module doc_reform.io_out.metadata; template outputMetadata() { void outputMetadata(T)( T doc_matters) @safe { <> @@ -41,7 +41,7 @@ template outputMetadata() { #+BEGIN_SRC d import std.file; import std.format; -import spine.io_out; +import doc_reform.io_out; mixin InternalMarkup; string[] metadata_; #+END_SRC diff --git a/org/out_odt.org b/org/out_odt.org index 66fe2b4..e843a48 100644 --- a/org/out_odt.org +++ b/org/out_odt.org @@ -58,7 +58,7 @@ template outputODT() { <> mixin InternalMarkup; mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); // mixin outputXmlODT; <> <> diff --git a/org/out_sqlite.org b/org/out_sqlite.org index 9f247b1..5e56ad1 100644 --- a/org/out_sqlite.org +++ b/org/out_sqlite.org @@ -132,7 +132,7 @@ template SQLiteDbRun() { #+BEGIN_SRC d :tangle "../src/doc_reform/io_out/sqlite.d" template SQLinsertDelimiter() { - auto SQLinsertDelimiter(string _txt) { + string SQLinsertDelimiter(string _txt) { _txt = _txt .replaceAll(rgx.quotation_mark_sql_insert_delimiter, "$0$0"); return _txt; @@ -673,7 +673,7 @@ string inline_notes_scroll(M,O)( #+name: sanitize_and_munge_inline_html #+BEGIN_SRC d -Tuple!(string, string) inline_notes_seg(M,O)( +Tuple!(string, string[]) inline_notes_seg(M,O)( M doc_matters, const O obj, string _txt, @@ -706,7 +706,7 @@ Tuple!(string, string) inline_notes_seg(M,O)( writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text); } } - Tuple!(string, string) t = tuple( + Tuple!(string, string[]) t = tuple( _txt, _endnotes, ); diff --git a/org/out_xmls.org b/org/out_xmls.org index df095ec..9738c23 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -589,9 +589,9 @@ string inline_notes_scroll(O,M)( #+name: xhtml_format_objects #+BEGIN_SRC d Tuple!(string, string[]) inline_notes_seg(O,M)( - string _txt, - const O obj, - M doc_matters, + string _txt, + const O obj, + M doc_matters, ) @safe { string[] _endnotes; if (obj.has.inline_notes_star) { @@ -698,7 +698,7 @@ auto inline_markup_seg(O,M)( _txt = inline_images(_txt, obj, doc_matters, _suffix, _xml_type); // TODO _txt = inline_links(_txt, obj, doc_matters, _suffix, _xml_type); // TODO } - auto t = inline_notes_seg(_txt, obj, doc_matters); + Tuple!(string, string[]) t = inline_notes_seg(_txt, obj, doc_matters); return t; } #+END_SRC @@ -1529,7 +1529,7 @@ void scroll(D,M)( ) @safe { mixin spineOutputRgxInit; auto xhtml_format = outputXHTMLs(); - auto rgx = Rgx(); + static auto rgx = Rgx(); string[] doc_html; string[] doc; string suffix = ".html"; @@ -1764,7 +1764,7 @@ void seg(D,M)( M doc_matters, ) @safe { mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); auto xhtml_format = outputXHTMLs(); string[][string] doc_html; string[][string] doc_html_endnotes; @@ -2069,7 +2069,7 @@ void seg_write_output(D,E,M)( static assert(is(typeof(doc_html) == string[][string])); } mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); auto xhtml_format = outputXHTMLs(); auto m = doc_matters.src.filename.matchFirst(rgx.src_fn); @@ -2334,7 +2334,7 @@ string epub3_oebps_content(D,M,P)(D doc_abstraction, M doc_matters, P parts) @sa string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) @safe { enum DomTags { none, open, close, close_and_open, open_still, } auto markup = InlineMarkup(); - auto rgx = Rgx(); + static auto rgx = Rgx(); string toc =format(" @@ -2423,7 +2423,7 @@ string epub2_oebps_toc_ncx(D,I)(D doc_abstraction, I doc_matters) @safe { int counter = 0; string _uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO shared elsewhere auto markup = InlineMarkup(); - auto rgx = Rgx(); + static auto rgx = Rgx(); enum DomTags { none, open, close, close_and_open, open_still, } string toc = format(q"┃ @@ -2521,7 +2521,7 @@ void outputEPub3(D,I)( ) { // @trusted mixin spineOutputRgxInit; auto xhtml_format = outputXHTMLs(); - auto rgx = Rgx(); + static auto rgx = Rgx(); string[] doc; string segment_filename; string[] top_level_headings = ["","","",""]; diff --git a/src/doc_reform/io_in/read_source_files.d b/src/doc_reform/io_in/read_source_files.d index bf8702b..ba3e145 100644 --- a/src/doc_reform/io_in/read_source_files.d +++ b/src/doc_reform/io_in/read_source_files.d @@ -15,7 +15,7 @@ static template spineRawMarkupContent() { mixin spineRgxInit; static auto rgx = Rgx(); string[] _images=[]; - auto _extract_images(S)(S content_block) @safe { + string[] _extract_images(S)(S content_block) @safe { string[] images_; string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { @@ -24,6 +24,17 @@ static template spineRawMarkupContent() { return images_; } auto rawsrc = RawMarkupContent(); + alias ContentsInsertsImages = Tuple!( + char[][], "contents", + string[], "insert_files", + string[], "images" + ); + alias HeaderContentInsertsImages = Tuple!( + char[], "header", + char[][], "src_txt", + string[], "insert_files", + string[], "images" + ); auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) @safe { auto _0_header_1_body_content_2_insert_filelist_tuple = rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src); @@ -32,7 +43,7 @@ static template spineRawMarkupContent() { struct RawMarkupContent { final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); - auto source_txt_str + string source_txt_str = raw.markupSourceReadIn(fn_src); return source_txt_str; } @@ -44,22 +55,22 @@ static template spineRawMarkupContent() { auto raw = MarkupRawUnit(); string[] insert_file_list; string[] images_list; - Tuple!(char[], char[][], string[], string[]) t + HeaderContentInsertsImages t = raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); - auto header_raw = t[0]; - auto sourcefile_body_content = t[1]; + char[] header_raw = t.header; + char[][] sourcefile_body_content = t.src_txt; if (fn_src.match(rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise auto ins = Inserts(); - Tuple!(char[][], string[], string[]) tu + ContentsInsertsImages tu = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src); - sourcefile_body_content = tu[0]; - insert_file_list = tu[1].dup; - images_list = tu[2].dup; + sourcefile_body_content = tu.contents; + insert_file_list = tu.insert_files.dup; + images_list = tu.images.dup; } else if (_opt_action.source || _opt_action.pod) { auto ins = Inserts(); - Tuple!(char[][], string[], string[]) tu + ContentsInsertsImages tu = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src); - images_list = tu[2].dup; + images_list = tu.images.dup; } string header_type = ""; t = tuple( @@ -68,7 +79,6 @@ static template spineRawMarkupContent() { insert_file_list, images_list ); - static assert(t.length==4); return t; } } @@ -115,24 +125,24 @@ static template spineRawMarkupContent() { = (cast(char[]) src_text).split(rgx.newline_eol_strip_preceding); return source_line_arr; } - auto markupSourceReadIn(in string fn_src) { + string markupSourceReadIn(in string fn_src) { static auto rgx = Rgx(); enforce( fn_src.match(rgx.src_pth_sst_or_ssm), "not a dr markup filename: «" ~ fn_src ~ "»" ); - auto source_txt_str = readInMarkupSource(fn_src); + string source_txt_str = readInMarkupSource(fn_src); return source_txt_str; } - Tuple!(char[], char[][], string[], string[]) markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) @safe { + HeaderContentInsertsImages markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) @safe { string[] file_insert_list = []; string[] images_list = []; char[][] hc = header0Content1(source_txt_str); char[] header = hc[0]; char[] source_txt = hc[1]; char[][] source_line_arr = markupSourceLineArray(source_txt); - Tuple!(char[], char[][], string[], string[]) t = tuple( + HeaderContentInsertsImages t = tuple( header, source_line_arr, file_insert_list, @@ -155,7 +165,11 @@ static template spineRawMarkupContent() { } } struct Inserts { - auto scan_subdoc_source(O)( + alias ContentsAndImages = Tuple!( + char[][], "insert_contents", + string[], "images" + ); + ContentsAndImages scan_subdoc_source(O)( O _opt_action, char[][] markup_sourcefile_insert_content, string fn_src @@ -227,20 +241,20 @@ static template spineRawMarkupContent() { type1["header_meta"] = 0; contents_insert ~= line; // images to extract for image list? if (_opt_action.source || _opt_action.pod) { - auto _image_linelist = _extract_images(line); + string[] _image_linelist = _extract_images(line); if (_image_linelist.length > 0) { _images ~= _image_linelist; } } } } // end src subdoc (inserts) loop - Tuple!(char[][], string[]) t = tuple( + ContentsAndImages t = tuple( contents_insert, _images ); return t; } - Tuple!(char[][], string[], string[]) scan_master_src_for_insert_files_and_import_content(O)( + ContentsInsertsImages scan_master_src_for_insert_files_and_import_content(O)( O _opt_action, char[][] sourcefile_body_content, string fn_src @@ -290,14 +304,14 @@ static template spineRawMarkupContent() { ); } auto ins = Inserts(); - auto contents_insert_tu = ins.scan_subdoc_source( + ContentsAndImages contents_insert_tu = ins.scan_subdoc_source( _opt_action, markup_sourcefile_insert_content, fn_src_insert.to!string ); - contents ~= contents_insert_tu[0]; // images to extract for image list? + contents ~= contents_insert_tu.insert_contents; if (_opt_action.source || _opt_action.pod) { - auto _image_linelist = _extract_images(contents_insert_tu[0]); + string[] _image_linelist = _extract_images(contents_insert_tu.images); if (_image_linelist.length > 0) { _images ~= _image_linelist; } @@ -315,7 +329,7 @@ static template spineRawMarkupContent() { } else { contents ~= line; if (_opt_action.source || _opt_action.pod) { - auto _image_linelist = _extract_images(line); + string[] _image_linelist = _extract_images(line); if (_image_linelist.length > 0) { _images ~= _image_linelist; } @@ -330,7 +344,7 @@ static template spineRawMarkupContent() { writeln(__LINE__); writeln(contents.length); } - Tuple!(char[][], string[], string[]) t = tuple( + ContentsInsertsImages t = tuple( contents, insert_file_list, images diff --git a/src/doc_reform/io_out/defaults.d b/src/doc_reform/io_out/defaults.d index 887c1be..4dd8021 100644 --- a/src/doc_reform/io_out/defaults.d +++ b/src/doc_reform/io_out/defaults.d @@ -35,7 +35,7 @@ template InternalMarkup() { string tc_p = "┆"; string img = "☼"; string sep = "␣"; - string on_o = "「"; auto on_c = "」"; + string on_o = "「"; string on_c = "」"; string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index 35a31cd..4de98a1 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -131,7 +131,7 @@ template outputEPub3() { string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) @safe { enum DomTags { none, open, close, close_and_open, open_still, } auto markup = InlineMarkup(); - auto rgx = Rgx(); + static auto rgx = Rgx(); string toc =format(" @@ -211,7 +211,7 @@ template outputEPub3() { int counter = 0; string _uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO shared elsewhere auto markup = InlineMarkup(); - auto rgx = Rgx(); + static auto rgx = Rgx(); enum DomTags { none, open, close, close_and_open, open_still, } string toc = format(q"┃ @@ -303,7 +303,7 @@ template outputEPub3() { ) { // @trusted mixin spineOutputRgxInit; auto xhtml_format = outputXHTMLs(); - auto rgx = Rgx(); + static auto rgx = Rgx(); string[] doc; string segment_filename; string[] top_level_headings = ["","","",""]; diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index 458533c..8598ca5 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -19,7 +19,7 @@ template outputHTML() { ) @safe { mixin spineOutputRgxInit; auto xhtml_format = outputXHTMLs(); - auto rgx = Rgx(); + static auto rgx = Rgx(); string[] doc_html; string[] doc; string suffix = ".html"; @@ -211,7 +211,7 @@ template outputHTML() { M doc_matters, ) @safe { mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); auto xhtml_format = outputXHTMLs(); string[][string] doc_html; string[][string] doc_html_endnotes; @@ -468,7 +468,7 @@ template outputHTML() { static assert(is(typeof(doc_html) == string[][string])); } mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); auto xhtml_format = outputXHTMLs(); auto m = doc_matters.src.filename.matchFirst(rgx.src_fn); diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index 52707db..cfa347c 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -9,7 +9,7 @@ template outputLaTeX() { std.conv : to; mixin InternalMarkup; // watch mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); mixin spineLanguageCodes; auto lang = Lang(); auto paper() { @@ -1180,8 +1180,8 @@ string table(O,M)( f.writeln(latex_content.content); f.writeln(latex_content.tail); foreach (image; doc_matters.srcs.image_list) { - auto fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; - auto fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; + string fn_src_in = doc_matters.src.image_dir_path ~ "/" ~ image; + string fn_src_out_file = pth_latex.latex_path_stuff ~ "/" ~ image; if (exists(fn_src_in)) { fn_src_in.copy(fn_src_out_file); } diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d index b935734..8201926 100644 --- a/src/doc_reform/io_out/metadata.d +++ b/src/doc_reform/io_out/metadata.d @@ -1,9 +1,9 @@ -module spine.io_out.metadata; +module doc_reform.io_out.metadata; template outputMetadata() { void outputMetadata(T)( T doc_matters) @safe { import std.file; import std.format; - import spine.io_out; + import doc_reform.io_out; mixin InternalMarkup; string[] metadata_; string theme_dark_0 = format(q"┃ diff --git a/src/doc_reform/io_out/odt.d b/src/doc_reform/io_out/odt.d index 09bcf65..23eb947 100644 --- a/src/doc_reform/io_out/odt.d +++ b/src/doc_reform/io_out/odt.d @@ -604,7 +604,7 @@ template outputODT() { doc_reform.io_out.xmls_css; mixin InternalMarkup; mixin spineOutputRgxInit; - auto rgx = Rgx(); + static auto rgx = Rgx(); // mixin outputXmlODT; string odt_head(I)(I doc_matters) @safe { string _has_tables = format(q"┃ diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index f9a17d4..e83a75f 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -128,7 +128,7 @@ template SQLiteDbRun() { } } template SQLinsertDelimiter() { - auto SQLinsertDelimiter(string _txt) { + string SQLinsertDelimiter(string _txt) { _txt = _txt .replaceAll(rgx.quotation_mark_sql_insert_delimiter, "$0$0"); return _txt; @@ -406,7 +406,7 @@ template SQLiteFormatAndLoadObject() { } return _txt; } - Tuple!(string, string) inline_notes_seg(M,O)( + Tuple!(string, string[]) inline_notes_seg(M,O)( M doc_matters, const O obj, string _txt, @@ -439,7 +439,7 @@ template SQLiteFormatAndLoadObject() { writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text); } } - Tuple!(string, string) t = tuple( + Tuple!(string, string[]) t = tuple( _txt, _endnotes, ); diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index b14a7bf..1d58e27 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -458,9 +458,9 @@ template outputXHTMLs() { return _txt; } Tuple!(string, string[]) inline_notes_seg(O,M)( - string _txt, - const O obj, - M doc_matters, + string _txt, + const O obj, + M doc_matters, ) @safe { string[] _endnotes; if (obj.has.inline_notes_star) { @@ -554,7 +554,7 @@ template outputXHTMLs() { _txt = inline_images(_txt, obj, doc_matters, _suffix, _xml_type); // TODO _txt = inline_links(_txt, obj, doc_matters, _suffix, _xml_type); // TODO } - auto t = inline_notes_seg(_txt, obj, doc_matters); + Tuple!(string, string[]) t = inline_notes_seg(_txt, obj, doc_matters); return t; } string lev4_heading_subtoc(O,M)( diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index c1d6f2c..121605a 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -15,7 +15,7 @@ import mixin spineRgxInit; static auto rgx = Rgx(); mixin InternalMarkup; -auto mkup = InlineMarkup(); +static auto mkup = InlineMarkup(); string url_markup(string line) @safe { string line_ = line .replaceAll( diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index b3f6bba..0b6388b 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -188,7 +188,7 @@ template InternalMarkup() { string tc_p = "┆"; string img = "☼"; string sep = "␣"; - string on_o = "「"; auto on_c = "」"; + string on_o = "「"; string on_c = "」"; string mk_bullet = "● "; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index d37e029..6dbbb22 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -89,6 +89,28 @@ template docAbstraction() { int[] dom_structure_markedup_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; 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,]; + alias TxtPlusHasFootnotes = Tuple!( + string, "obj_txt", + bool, "has_notes_reg", + bool, "has_notes_star", + bool, "has_notes_plus", + ); + alias TxtPlusHasFootnotesUrlsImages = Tuple!( + string, "obj_txt", + bool, "has_notes_reg", + bool, "has_notes_star", + bool, "has_notes_plus", + bool, "has_urls", + bool, "has_images_without_dimensions", + ); + alias TxtAndAnchorTagPlusHasFootnotesUrlsImages = Tuple!( + string, "obj_txt", + string, "anchor_tag", + bool, "has_notes_reg", + bool, "has_notes_star", + bool, "has_links", + bool, "has_images_without_dimensions", + ); enum DomTags { none, open, close, close_and_open, open_still, } pure ObjGenericComposite obj_heading_ancestors()( ObjGenericComposite obj, @@ -957,7 +979,7 @@ template docAbstraction() { : ocn_emit(obj_type_status["ocn_status"]); an_object["is"] = "heading"; an_object_key="body_nugget"; - auto substantive_object_and_anchor_tags_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_object_and_anchor_tags_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, ((_new_doc) ? Yes._new_doc : No._new_doc)); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[sObj.content]; anchor_tag = substantive_object_and_anchor_tags_tuple[sObj.anchor_tag]; @@ -1096,7 +1118,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"], ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -2855,7 +2877,7 @@ template docAbstraction() { ); } an_object["is"] = "verse"; - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -2918,7 +2940,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -2964,7 +2986,7 @@ template docAbstraction() { } processing.remove("verse"); an_object["is"] = "verse"; - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3027,7 +3049,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3329,7 +3351,7 @@ template docAbstraction() { "table" ); an_object["is"] = "table"; - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block.metainfo.ocn = obj_cite_digits.object_number; @@ -3393,7 +3415,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3444,7 +3466,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3495,7 +3517,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; // anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3582,7 +3604,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tag = substantive_obj_misc_tuple[sObj.anchor_tag]; @@ -3634,7 +3656,7 @@ template docAbstraction() { heading_ptr-1, an_object["is"] ); - auto substantive_obj_misc_tuple + TxtAndAnchorTagPlusHasFootnotesUrlsImages substantive_obj_misc_tuple = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, No._new_doc); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; @@ -4347,7 +4369,7 @@ template docAbstraction() { } return obj_txt_in; } - Tuple!(string, bool, bool, bool) footnotes_endnotes_markup_and_number_or_stars()(string obj_txt_in, bool reset_note_numbers) @safe { + TxtPlusHasFootnotes footnotes_endnotes_markup_and_number_or_stars()(string obj_txt_in, bool reset_note_numbers) @safe { /+ endnotes (regular) +/ bool flg_notes_reg = false; bool flg_notes_star = false; @@ -4403,7 +4425,7 @@ template docAbstraction() { } else { obj_txt_out = obj_txt_in; } - Tuple!(string, bool, bool, bool) t = tuple( + TxtPlusHasFootnotes t = tuple( obj_txt_out, flg_notes_reg, flg_notes_star, @@ -4411,7 +4433,7 @@ template docAbstraction() { ); return t; } - private Tuple!(string, bool, bool, bool, bool, bool) object_notes_and_links_()( + private TxtPlusHasFootnotesUrlsImages object_notes_and_links_()( string obj_txt_in, bool reset_note_numbers=false ) @safe { @@ -4445,8 +4467,8 @@ template docAbstraction() { obj_txt_in = obj_txt_in .replaceAll(rgx.para_inline_link_anchor, "┃$1┃"); } - Tuple!(string, bool, bool, bool) ftn = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers); - obj_txt_out = ftn[0]; + TxtPlusHasFootnotes ftn = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers); + obj_txt_out = ftn.obj_txt; debug(footnotes) { writeln(obj_txt_out, tail); } @@ -4458,18 +4480,18 @@ template docAbstraction() { writeln(m.hit); } } - Tuple!(string, bool, bool, bool, bool, bool) t = tuple( + TxtPlusHasFootnotesUrlsImages t = tuple( obj_txt_out, - ftn[1], - ftn[2], - ftn[3], + ftn.has_notes_reg, + ftn.has_notes_star, + ftn.has_notes_plus, urls, images_without_dimensions, ); return t; } auto init() { - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(""); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(""); return t; } invariant() { @@ -4482,7 +4504,7 @@ template docAbstraction() { .replaceFirst(rgx.heading, "") .replaceFirst(rgx.object_number_off_all, "") .strip; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); debug(munge) { writeln(__LINE__); writeln(obj_txt_in); @@ -4497,7 +4519,7 @@ template docAbstraction() { obj_txt["munge"]=(obj_txt_in) .replaceFirst(rgx.para_attribs, "") .replaceFirst(rgx.object_number_off_all, ""); - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); debug(munge) { writeln(__LINE__); writeln(obj_txt_in); @@ -4514,21 +4536,21 @@ template docAbstraction() { } auto munge_group(string obj_txt_in) @safe { obj_txt["munge"]=obj_txt_in; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); return t; } invariant() { } auto munge_block()(string obj_txt_in) @safe { obj_txt["munge"]=obj_txt_in; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); return t; } invariant() { } auto munge_verse()(string obj_txt_in) @safe { obj_txt["munge"]=obj_txt_in; - Tuple!(string, bool, bool, bool, bool, bool) t = object_notes_and_links_(obj_txt["munge"]); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); return t; } invariant() { @@ -4558,7 +4580,7 @@ template docAbstraction() { static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; static string anchor_tag = ""; - auto obj_inline_markup_and_anchor_tags_and_misc(CMM)( + TxtAndAnchorTagPlusHasFootnotesUrlsImages obj_inline_markup_and_anchor_tags_and_misc(CMM)( string[string] obj_, string obj_key_, CMM conf_make_meta, @@ -4638,7 +4660,7 @@ template docAbstraction() { obj_notes_and_links["image_no_dimensions"] = x[5]; break; } - Tuple!(string, string, bool, bool, bool, bool) t = tuple( + TxtAndAnchorTagPlusHasFootnotesUrlsImages t = tuple( obj_txt["munge"], anchor_tag, obj_notes_and_links["notes_reg"], diff --git a/src/doc_reform/meta/metadoc_harvest.d b/src/doc_reform/meta/metadoc_harvest.d index 4bb62ae..eb050e4 100644 --- a/src/doc_reform/meta/metadoc_harvest.d +++ b/src/doc_reform/meta/metadoc_harvest.d @@ -18,7 +18,7 @@ template spineMetaDocHarvest() { std.utf, std.conv : to; mixin InternalMarkup; - auto markup = InlineMarkup(); + static auto mkup = InlineMarkup(); import doc_reform.io_out.paths_output; auto pth_html_abs = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); auto pth_html_rel = spineDocRootTreeHTML!()(doc_matters.src.language); diff --git a/src/doc_reform/meta/metadoc_harvests_authors.d b/src/doc_reform/meta/metadoc_harvests_authors.d index 19ed583..3a7aebc 100644 --- a/src/doc_reform/meta/metadoc_harvests_authors.d +++ b/src/doc_reform/meta/metadoc_harvests_authors.d @@ -14,7 +14,7 @@ module doc_reform.meta.metadoc_harvests_authors; mixin InternalMarkup; mixin spineRgxInit; template spineMetaDocHarvestsAuthors() { - auto mkup = InlineMarkup(); + static auto mkup = InlineMarkup(); void spineMetaDocHarvestsAuthors(H,M,O)( H harvests, M _make_and_meta_struct, diff --git a/src/doc_reform/meta/metadoc_harvests_topics.d b/src/doc_reform/meta/metadoc_harvests_topics.d index 5e11b7e..8c41f3b 100644 --- a/src/doc_reform/meta/metadoc_harvests_topics.d +++ b/src/doc_reform/meta/metadoc_harvests_topics.d @@ -14,7 +14,7 @@ module doc_reform.meta.metadoc_harvests_topics; mixin InternalMarkup; mixin spineRgxInit; template spineMetaDocHarvestsTopics() { - auto mkup = InlineMarkup(); + static auto mkup = InlineMarkup(); void spineMetaDocHarvestsTopics(H,M,O)( H hvst, M _make_and_meta_struct, -- cgit v1.2.3