From 1e04f9f2ecb5a326ded1422cd03ee1f37198e571 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 27 Jan 2022 12:57:13 -0500 Subject: cgi sqlite_search, heading matches fix, cleanup --- org/cgi_spine_search.org | 50 +++++++---------- org/config_d_cfte.org | 11 ++-- org/metaverse.org | 140 +++++++++++++++++++++++------------------------ org/out_xmls.org | 2 +- 4 files changed, 98 insertions(+), 105 deletions(-) (limited to 'org') diff --git a/org/cgi_spine_search.org b/org/cgi_spine_search.org index 1fecaa9..b1e9a5a 100644 --- a/org/cgi_spine_search.org +++ b/org/cgi_spine_search.org @@ -253,9 +253,7 @@ struct Config { string http_request_type; string http_host; // string server_name; - string web_doc_root_path; - string doc_collection_sub_root; - string cgi_root; + string doc_collection_subroot; string cgi_script_name; string cgi_search_form_title; string cgi_search_form_html_title; @@ -276,9 +274,7 @@ auto conf = Config(); conf.http_request_type = environment.get("REQUEST_SCHEME", _cfg.http_request_type); conf.http_host = environment.get("SERVER_NAME", _cfg.http_host); // conf.http_host = environment.get("HTTP_HOST", _cfg.http_host); -conf.web_doc_root_path = environment.get("DOCUMENT_ROOT", _cfg.www_doc_root); -conf.doc_collection_sub_root = "<>"; // (output_path - web_doc_root_path) -conf.cgi_root = environment.get("CONTEXT_DOCUMENT_ROOT", _cfg.cgi_bin_subpath); +conf.doc_collection_subroot = _cfg.www_doc_subroot; conf.cgi_script_name = environment.get("SCRIPT_NAME", _cfg.cgi_filename); conf.cgi_search_form_title = _cfg.cgi_search_form_title; // ≅ SiSU spine search form conf.cgi_search_form_html_title = "" ~ _cfg.cgi_search_form_title ~ ""; -conf.query_base_url = conf.http_request_type ~ "://" ~ conf.http_host ~ "/" ~ conf.cgi_script_name ~ "?"; +conf.query_base_url = conf.http_request_type ~ "://" ~ conf.http_host ~ conf.cgi_script_name ~ "?"; conf.query_string = environment.get("QUERY_STRING", ""); conf.http_url = environment.get("HTTP_REFERER", conf.query_base_url ~ conf.query_string); conf.request_method = environment.get("REQUEST_METHOD", "POST"); @@ -1093,6 +1089,7 @@ SELECT doc_objects.body, doc_objects.seg_name, doc_objects.ocn, + doc_objects.lev, metadata_and_text.uid FROM doc_objects, @@ -1149,7 +1146,7 @@ if (!select_query_results.empty) { ~ "
" ~ "

" ~ "

" ~ "

" ~ row["ocn"].as!string ~ ":

" @@ -1191,9 +1188,10 @@ if (!select_query_results.empty) { ~ "
" ~ "

" ~ row["ocn"].as!string ~ ":

" @@ -1205,15 +1203,15 @@ if (!select_query_results.empty) { ); } } else { - if (row["ocn"].as!string != "0") { + if ((row["lev"].as!int < 4) + || (row["ocn"].as!string == "0")) { cgi.write( _matched_ocn_open ~ "" ~ row["ocn"].as!string ~ ", " @@ -1223,9 +1221,10 @@ if (!select_query_results.empty) { _matched_ocn_open ~ "" ~ row["ocn"].as!string ~ ", " @@ -2090,15 +2089,7 @@ _cfg.doc_root_www #+NAME: doc_subroot_path #+BEGIN_SRC text -/spine/static -#+END_SRC - -#+NAME: cgi_root_path -#+BEGIN_SRC text -_cfg.doc_root_cgi -#+END_SRC -#+BEGIN_SRC text -/usr/lib/cgi-bin/ +/spine #+END_SRC #+NAME: db_root_path @@ -2168,4 +2159,3 @@ see configuration_cfte.org +/ #+END_SRC - diff --git a/org/config_d_cfte.org b/org/config_d_cfte.org index e5815ea..ebc164b 100644 --- a/org/config_d_cfte.org +++ b/org/config_d_cfte.org @@ -103,10 +103,8 @@ enum _cfg = Cfg(); struct Cfg { string http_request_type = "<>"; string http_host = "<>"; - string www_url_doc_root = "<>"; - string www_doc_root = "<>"; - string cgi_bin_subpath = "<>"; - string cgi_filename = "<>"; // "spine-search" + string www_doc_subroot = "<>"; + string cgi_filename = "<>"; string cgi_search_form_title = "<>"; string db_sqlite_path = "<>"; string db_sqlite_filename = "<>"; @@ -136,6 +134,11 @@ http://localhost /srv/www/spine #+END_SRC +#+NAME: www_doc_subroot +#+BEGIN_SRC sh +/spine +#+END_SRC + #+NAME: cgi_bin_root #+BEGIN_SRC sh /var/www/cgi/cgi-bin diff --git a/org/metaverse.org b/org/metaverse.org index f3e7425..b97bd2f 100644 --- a/org/metaverse.org +++ b/org/metaverse.org @@ -372,7 +372,7 @@ string anchor_tag_; string[string] tag_in_seg; string lev_anchor_tag; string[string][string] tag_assoc; -string[] lv0_to_3_tags; +string[] lv0to3_tags; /+ enum +/ enum DocStructMarkupHeading { h_sect_A, @@ -686,8 +686,8 @@ enum sObj { content, anchor_tag, notes_reg, notes_star, links, image_no_dimensio static auto rgx = RgxI(); if (auto m = an_object["substantive"].match(rgx.inline_link_anchor)) { if (m.captures[1] !in tag_assoc) { - tag_assoc[(m.captures[1])]["seg_lv4"] = tag_in_seg["seg_lv4"]; - tag_assoc[(m.captures[1])]["seg_lv1_to_4"] = tag_in_seg["seg_lv1_to_4"]; + tag_assoc[(m.captures[1])]["seg_lv4"] = tag_in_seg["seg_lv4"]; + tag_assoc[(m.captures[1])]["seg_lv1to4"] = tag_in_seg["seg_lv1to4"]; } else { writeln("a tag named already exists, check text line\n ", an_object["substantive"]); } @@ -837,8 +837,8 @@ comp_obj_heading_.ptr.html_segnames = html_segnames_p comp_obj_heading_.tags.anchor_tags = ["toc"]; comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 1, 0, 0, 0]; comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; -tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; -tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; +tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; +tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; auto toc_head = comp_obj_heading_; html_segnames_ptr_cntr++; the_document_toc_section = [toc_head]; @@ -1018,8 +1018,8 @@ if there is a glossary section you need to: comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_document_glossary_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } { comp_obj_heading_ = comp_obj_heading_.init; @@ -1044,8 +1044,8 @@ if there is a glossary section you need to: comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; comp_obj_heading_.tags.anchor_tags = ["glossary"]; the_document_glossary_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } } else { an_object = line.flow_para_match_(an_object, an_object_key, indent, bullet, pith, line_occur); @@ -1154,8 +1154,8 @@ if there is a blurb section you need to: comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_document_blurb_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } { comp_obj_heading_ = comp_obj_heading_.init; @@ -1180,8 +1180,8 @@ if there is a blurb section you need to: comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 1, 0, 0, 0]; comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; the_document_blurb_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } } else if (line.matchFirst(rgx.headings) && (opt_action.backmatter && opt_action.section_blurb)) { @@ -1204,8 +1204,8 @@ if there is a blurb section you need to: comp_obj_heading_.metainfo.parent_ocn = 1; comp_obj_heading_.metainfo.parent_lev_markup = 0; the_document_blurb_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } else { an_object = line.flow_para_match_(an_object, an_object_key, indent, bullet, pith, line_occur); comp_obj_para = comp_obj_para.init; @@ -1509,9 +1509,9 @@ assert( #+NAME: abs_in_loop_body_not_block_obj_line_empty_heading_obj #+BEGIN_SRC d if (_new_doc) { - tag_assoc = tag_assoc.init; - lv0_to_3_tags = lv0_to_3_tags.init; - tag_in_seg = tag_in_seg.init; + tag_assoc = tag_assoc.init; + lv0to3_tags = lv0to3_tags.init; + tag_in_seg = tag_in_seg.init; } if (pith["txt_is"] == eN.txt_is.heading && line_occur["heading"] > eN.bi.off @@ -1534,26 +1534,26 @@ if (pith["txt_is"] == eN.txt_is.heading if ( an_object["lev_markup_number"].to!int == 4 && (!(anchor_tag.empty) - || (lv0_to_3_tags.length > 0)) + || (lv0to3_tags.length > 0)) ) { - tag_in_seg["seg_lv4"] = anchor_tag; - tag_in_seg["seg_lv1_to_4"] = anchor_tag; + tag_in_seg["seg_lv4"] = anchor_tag; + tag_in_seg["seg_lv1to4"] = anchor_tag; lev_anchor_tag = anchor_tag; - tag_assoc[anchor_tag]["seg_lv4"] = tag_in_seg["seg_lv4"]; - tag_assoc[anchor_tag]["seg_lv1_to_4"] = tag_in_seg["seg_lv1_to_4"]; - if (lv0_to_3_tags.length > 0) { /+ names used for html markup segments 1 to 4 (rather than epub which has separate segments for A to D) +/ - foreach (lv0_to_lv3_html_tag; lv0_to_3_tags) { + tag_assoc[anchor_tag]["seg_lv4"] = tag_in_seg["seg_lv4"]; + tag_assoc[anchor_tag]["seg_lv1to4"] = tag_in_seg["seg_lv1to4"]; + if (lv0to3_tags.length > 0) { /+ names used for html markup segments 1 to 4 (rather than epub which has separate segments for A to D) +/ + foreach (lv0_to_lv3_html_tag; lv0to3_tags) { tag_assoc[lv0_to_lv3_html_tag]["seg_lv4"] = anchor_tag; } } anchor_tag_ = anchor_tag; - lv0_to_3_tags = lv0_to_3_tags.init; + lv0to3_tags = lv0to3_tags.init; } else if (an_object["lev_markup_number"].to!int > 4) { - tag_in_seg["seg_lv4"] = anchor_tag_; - tag_in_seg["seg_lv1_to_4"] = anchor_tag_; - lev_anchor_tag = anchor_tag; + tag_in_seg["seg_lv4"] = anchor_tag_; + tag_in_seg["seg_lv1to4"] = anchor_tag_; + lev_anchor_tag = anchor_tag; tag_assoc[anchor_tag]["seg_lv4"] = tag_in_seg["seg_lv4"]; - tag_assoc[anchor_tag]["seg_lv1_to_4"] = tag_in_seg["seg_lv1_to_4"]; + tag_assoc[anchor_tag]["seg_lv1to4"] = tag_in_seg["seg_lv1to4"]; } else if (an_object["lev_markup_number"].to!int < 4) { string segn; switch (an_object["lev_markup_number"].to!int) { /+ names used for epub markup segments A to D +/ @@ -1573,10 +1573,10 @@ if (pith["txt_is"] == eN.txt_is.heading ++cnt3; goto default; default: - lv0_to_3_tags ~= obj_cite_digits.object_number.to!string; - lv0_to_3_tags ~= segn; - tag_in_seg["seg_lv4"] = segn; // for html segname need following lv4 not yet known - tag_in_seg["seg_lv1_to_4"] = segn; + lv0to3_tags ~= obj_cite_digits.object_number.to!string; + lv0to3_tags ~= segn; + tag_in_seg["seg_lv4"] = segn; // for html segname need following lv4 not yet known + tag_in_seg["seg_lv1to4"] = segn; break; } } @@ -1600,7 +1600,7 @@ if (pith["txt_is"] == eN.txt_is.heading html_segnames_ptr_cntr++; } if (an_object["lev_markup_number"].to!int <= 4) { - segnames["epub"] ~= tag_in_seg["seg_lv1_to_4"]; + segnames["epub"] ~= tag_in_seg["seg_lv1to4"]; } auto comp_obj_heading = node_construct.node_emitter_heading( @@ -1625,7 +1625,7 @@ if (pith["txt_is"] == eN.txt_is.heading debug(segments) { writeln(an_object["lev_markup_number"]); writeln(tag_in_seg["seg_lv4"]); - writeln(tag_in_seg["seg_lv1_to_4"]); + writeln(tag_in_seg["seg_lv1to4"]); } the_document_body_section ~= comp_obj_heading; debug(objectrelated1) { // check @@ -1678,7 +1678,7 @@ if (pith["txt_is"] == eN.txt_is.heading comp_obj_para.metainfo.is_a = "para"; comp_obj_para.text = an_object["substantive"].to!string.strip; comp_obj_para.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_para.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_para.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_para.metainfo.ocn = obj_cite_digits.object_number; comp_obj_para.metainfo.identifier = obj_cite_digits.identifier; comp_obj_para.metainfo.object_number_off = (obj_cite_digits.off == 0) ? true : false; // TODO @@ -1798,8 +1798,8 @@ eof xml_dom_tail_section comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0]; comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0]; the_document_xml_dom_tail_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } #+END_SRC @@ -1888,8 +1888,8 @@ if (biblio_ordered.length > 0) { comp_obj_heading_.metainfo.dom_structure_markedup_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_document_bibliography_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } { comp_obj_heading_ = comp_obj_heading_.init; @@ -1914,8 +1914,8 @@ if (biblio_ordered.length > 0) { comp_obj_heading_.metainfo.dom_structure_collapsed_tags_status = [ 1, 1, 1, 0, 0, 0, 0, 0]; comp_obj_heading_.tags.anchor_tags = ["bibliography"]; the_document_bibliography_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; } { string out_; @@ -2770,7 +2770,7 @@ if (the_document_body_section.length > 1) { tag_assoc[(obj.metainfo.identifier)]["seg_lv4"] = obj.tags.html_segment_anchor_tag_is; } - tag_assoc[(obj.metainfo.identifier)]["seg_lv1_to_4"] + tag_assoc[(obj.metainfo.identifier)]["seg_lv1to4"] = obj.tags.epub_segment_anchor_tag_is; } if (obj.metainfo.is_a == "heading") { @@ -3261,10 +3261,10 @@ if ((opt_action.html) #+NAME: abs_post_document_segnames #+BEGIN_SRC d string[] segnames_4 = segnames["html"].dup; -string[] segnames_lv1_to_4 = segnames["epub"].dup; +string[] segnames_lv1to4 = segnames["epub"].dup; debug(segnames) { - writeln("segnames_lv4: ", segnames_4); - writeln("segnames_lv1_to_4: ", segnames_lv1_to_4); + writeln("segnames_lv4: ", segnames_4); + writeln("segnames_lv1to4: ", segnames_lv1to4); } #+END_SRC @@ -4238,7 +4238,7 @@ why extra object stuff only in poem/verse? comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx; comp_obj_block.metainfo.object_number_type = obj_cite_digits.type; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4301,7 +4301,7 @@ why extra object stuff only in poem/verse? comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx; comp_obj_block.metainfo.object_number_type = obj_cite_digits.type; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4347,7 +4347,7 @@ why extra object stuff only in poem/verse? comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx; comp_obj_block.metainfo.object_number_type = obj_cite_digits.type; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4410,7 +4410,7 @@ why extra object stuff only in poem/verse? comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx; comp_obj_block.metainfo.object_number_type = obj_cite_digits.type; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4551,7 +4551,7 @@ process and use an_object["table_head"] (then empty it) comp_obj_block.metainfo.identifier = obj_cite_digits.identifier; comp_obj_block.metainfo.object_number_off = obj_cite_digits.off; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx; comp_obj_block.metainfo.object_number_type = obj_cite_digits.type; comp_obj_block = comp_obj_block.flow_table_instructions(an_object["table_head"]); @@ -4639,7 +4639,7 @@ if (pith["block_is"] == eN.blk_is.quote) { comp_obj_block.metainfo.lang = an_object["lang"]; comp_obj_block.metainfo.attrib = an_object["attrib"]; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4697,7 +4697,7 @@ if (pith["block_is"] == eN.blk_is.quote) { comp_obj_block.metainfo.lang = an_object["lang"]; comp_obj_block.metainfo.attrib = an_object["attrib"]; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4755,7 +4755,7 @@ if (pith["block_is"] == eN.blk_is.quote) { comp_obj_block.metainfo.lang = an_object["lang"]; comp_obj_block.metainfo.attrib = an_object["attrib"]; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.text = an_object["substantive"]; comp_obj_block.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4857,7 +4857,7 @@ if (pith["block_is"] == eN.blk_is.quote) { comp_obj_code.metainfo.attrib = an_object["attrib"]; comp_obj_code.code_block.linenumbers = (an_object["attrib"].match(rgx.code_numbering)) ? true : false; comp_obj_code.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_code.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_code.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_code.text = an_object["substantive"]; comp_obj_code.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_code.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -4906,7 +4906,7 @@ if (pith["block_is"] == eN.blk_is.quote) { comp_obj_block.metainfo.identifier = obj_cite_digits.identifier; comp_obj_block.metainfo.object_number_off = obj_cite_digits.off; comp_obj_block.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + comp_obj_block.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx; comp_obj_block.metainfo.object_number_type = obj_cite_digits.type; comp_obj_block = comp_obj_block.flow_table_instructions(an_object["table_head"]); @@ -6978,8 +6978,8 @@ struct BookIndexReportSection { comp_obj_heading_.metainfo.parent_lev_markup = 0; comp_obj_heading.has.inline_links = true; bookindex_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; ++mkn; } { @@ -7004,8 +7004,8 @@ struct BookIndexReportSection { comp_obj_heading.has.inline_links = false; comp_obj_heading_.tags.anchor_tags = ["bookindex"]; bookindex_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; ++mkn; } import std.array : appender; @@ -7247,8 +7247,8 @@ struct NotesSection { comp_obj_heading_.metainfo.parent_ocn = 1; comp_obj_heading_.metainfo.parent_lev_markup = 0; the_document_endnotes_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; ++mkn; } { @@ -7272,8 +7272,8 @@ struct NotesSection { comp_obj_heading_.metainfo.parent_lev_markup = 0; comp_obj_heading_.tags.anchor_tags = ["endnotes"]; the_document_endnotes_section ~= comp_obj_heading_; - tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; - tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_heading_.tags.in_segment_html; + tag_assoc[comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_heading_.tags.segment_anchor_tag_epub; ++mkn; } } else { @@ -7499,7 +7499,7 @@ struct NodeStructureMetadata { comp_obj_location.metainfo.ocn = obj_cite_digits.object_number; comp_obj_location.metainfo.identifier = obj_cite_digits.identifier; comp_obj_location.tags.anchor_tag_html = tag_in_seg["seg_lv4"]; - comp_obj_location.tags.segment_anchor_tag_epub = tag_in_seg["seg_lv1_to_4"]; + comp_obj_location.tags.segment_anchor_tag_epub = tag_in_seg["seg_lv1to4"]; comp_obj_location.tags.heading_lev_anchor_tag = lev_anchor_tag; comp_obj_location.metainfo.parent_ocn = p_["object_number"]; comp_obj_location.metainfo.parent_lev_markup = p_["lev_markup_number"]; @@ -7656,12 +7656,12 @@ invariant() { _comp_obj_heading_.metainfo.object_number_off = obj_cite_digits.off; // _comp_obj_heading_.metainfo.o_n_book_index = obj_cite_digits.bkidx; _comp_obj_heading_.metainfo.object_number_type = obj_cite_digits.type; - _comp_obj_heading_.tags.segment_anchor_tag_epub = tag_in_seg["seg_lv1_to_4"]; + _comp_obj_heading_.tags.segment_anchor_tag_epub = tag_in_seg["seg_lv1to4"]; _comp_obj_heading_.tags.anchor_tag_html = tag_in_seg["seg_lv4"]; _comp_obj_heading_.tags.in_segment_html = _comp_obj_heading_.tags.anchor_tag_html; _comp_obj_heading_.tags.heading_lev_anchor_tag = lev_anchor_tag; _comp_obj_heading_.tags.html_segment_anchor_tag_is = tag_in_seg["seg_lv4"]; - _comp_obj_heading_.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1_to_4"]; + _comp_obj_heading_.tags.epub_segment_anchor_tag_is = tag_in_seg["seg_lv1to4"]; _comp_obj_heading_.metainfo.heading_lev_markup = (!(lev_markup_number.empty) ? lev_markup_number.to!int : 0); _comp_obj_heading_.metainfo.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? lev_collapsed_number.to!int : 0); _comp_obj_heading_.metainfo.parent_ocn = p_["object_number"]; @@ -7673,8 +7673,8 @@ invariant() { _comp_obj_heading_.has.inline_notes_reg = flag_notes_reg; _comp_obj_heading_.has.inline_notes_star = flag_notes_star; _comp_obj_heading_.has.inline_links = flag_links; - tag_assoc[_comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = _comp_obj_heading_.tags.in_segment_html; - tag_assoc[_comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1_to_4"] = _comp_obj_heading_.tags.segment_anchor_tag_epub; + tag_assoc[_comp_obj_heading_.tags.anchor_tag_html]["seg_lv4"] = _comp_obj_heading_.tags.in_segment_html; + tag_assoc[_comp_obj_heading_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = _comp_obj_heading_.tags.segment_anchor_tag_epub; debug(_node) { if (lev_markup_number.match(rgx.levels_numbered_headings)) { writeln("* ", _node.to!string); diff --git a/org/out_xmls.org b/org/out_xmls.org index ef96b34..964f43d 100644 --- a/org/out_xmls.org +++ b/org/out_xmls.org @@ -612,7 +612,7 @@ import "$1"); } if (_xml_type == "seg" || _xml_type == "epub") { - seg_lvs = (_xml_type == "epub") ? "seg_lv1_to_4" : "seg_lv4"; + seg_lvs = (_xml_type == "epub") ? "seg_lv1to4" : "seg_lv4"; foreach (m; _txt.match(rgx.inline_link_hash)) { if (m.captures["hash"] in doc_matters.has.tag_associations) { if ( -- cgit v1.2.3