From 8525eb4bf305824d55558705175d4cc9ed5d37c2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 21 Aug 2021 12:18:02 -0400 Subject: metaverse parallel processing reproducability - html xhtml issue with tags - epub issue with title (skipped) in OEBPS/toc.ncx --- src/doc_reform/io_out/epub3.d | 4 ++-- src/doc_reform/io_out/html.d | 2 +- src/doc_reform/io_out/xmls.d | 9 +++++---- src/doc_reform/meta/metadoc_from_src.d | 14 +++++++++----- 4 files changed, 17 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index aa875ad..1a8d924 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -344,7 +344,7 @@ template outputEPub3() { ┃"); return toc; } - + @system void outputEPub3(D,I)( const D doc_abstraction, I doc_matters, @@ -858,5 +858,5 @@ template outputEPub3() { } } } - + } diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index c6f36a1..ceaf9f9 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -560,7 +560,7 @@ template outputHTML() { M doc_matters, ) { { /+ (copy html images) +/ - + auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); if (!exists(pth_html.image)) { pth_html.image.mkdirRecurse; diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index e6012fe..703df3d 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -127,10 +127,9 @@ template outputXHTMLs() { return _txt; } @safe string _xhtml_anchor_tags(O)(O obj) { - const(string[]) anchor_tags = obj.tags.anchor_tags; string tags=""; - if (anchor_tags.length > 0) { - foreach (tag; anchor_tags) { + if (obj.tags.anchor_tags.length > 0) { + foreach (tag; obj.tags.anchor_tags) { if (!(tag.empty)) { tags ~= ""; } @@ -746,7 +745,9 @@ template outputXHTMLs() { ┃", _horizontal_rule, obj.metainfo.identifier, - (doc_matters.opt.action.ocn_off) ? "" : ((obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier), + (doc_matters.opt.action.ocn_off) + ? "" : ((obj.metainfo.object_number.empty) + ? "" : obj.metainfo.identifier), obj.metainfo.heading_lev_markup, obj.metainfo.is_a, obj.metainfo.identifier, diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 6f6b383..d306df5 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -450,6 +450,8 @@ template docAbstraction() { destroy(biblio_arr_json); previous_length = 0; reset_note_numbers = true; + lev_anchor_tag = ""; + anchor_tag = ""; } mixin spineNode; auto node_para_int_ = node_metadata_para_int; @@ -1237,7 +1239,7 @@ template docAbstraction() { comp_obj_para.attrib.indent_hang = indent["hang_position"]; comp_obj_para.attrib.indent_base = indent["base_position"]; comp_obj_para.attrib.bullet = bullet; - comp_obj_para.tags.anchor_tags = [anchor_tag]; + comp_obj_para.tags.anchor_tags = [anchor_tag]; anchor_tag=""; comp_obj_para.has.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_para.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; comp_obj_para.has.inline_links = substantive_obj_misc_tuple[sObj.links]; @@ -2470,6 +2472,8 @@ template docAbstraction() { dom_structure_markedup_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; dom_structure_collapsed_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; dom_structure_collapsed_tags_status_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; + lev_anchor_tag = ""; + anchor_tag = ""; @safe auto doc_has() { struct DocHas_ { uint inline_links() { @@ -4696,7 +4700,7 @@ template docAbstraction() { static auto rgx = RgxI(); static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; - static string anchor_tag = ""; + string anchor_tag = ""; @safe TxtAndAnchorTagPlusHasFootnotesUrlsImages obj_inline_markup_and_anchor_tags_and_misc(CMM)( string[string] obj_, string obj_key_, @@ -5039,6 +5043,9 @@ template docAbstraction() { bool _new_doc ) { if (!(munge_.match(rgx.heading_anchor_tag))) { + if (lev_ == "A") { // (_new_doc) + heading_num_lev1 = 0; + } if (munge_.match(rgx.heading_identify_anchor_tag)) { if (auto m = munge_.match(rgx.heading_extract_named_anchor_tag)) { munge_ = munge_.replaceFirst( @@ -5055,9 +5062,6 @@ template docAbstraction() { "$1~" ~ "s" ~ m.captures[1] ~ " "); } } else if (lev_ == "1") { // (if not successful) manufacture a unique anchor tag for lev == "1" - if (_new_doc) { - heading_num_lev1 = 0; - } heading_num_lev1 ++; munge_ = munge_.replaceFirst( rgx.heading_marker_missing_tag, -- cgit v1.2.3