diff options
Diffstat (limited to 'src/doc_reform/meta/metadoc_from_src.d')
-rw-r--r-- | src/doc_reform/meta/metadoc_from_src.d | 80 |
1 files changed, 51 insertions, 29 deletions
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"], |