From 099d54647f0ff4bf7effb7c554e987eeff11fb85 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 14 Jan 2017 10:08:53 -0500 Subject: identify internal links for downstream munging --- org/ao_abstract_doc_source.org | 43 +++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'org/ao_abstract_doc_source.org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 4aa20be..e413570 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -197,7 +197,7 @@ enum DocStructMarkupHeading { h_text_5, // extra level, drop content_non_header } // header section A-D; header text 1-4 -enum DocStructCollapsedHeading { lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7 } // not yet used +enum DocStructCollapsedHeading { lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7 } /+ biblio variables +/ string biblio_tag_name, biblio_tag_entry, st; string[] biblio_arr_json; @@ -232,7 +232,7 @@ void heading_ancestors(O)( switch (obj.heading_lev_markup) { case 0: lv_ancestors[0] = to!string(obj.text); - foreach(k; 1..8) { // 1 .. 7 ? + foreach(k; 1..8) { lv_ancestors[k] = ""; } goto default; @@ -1430,8 +1430,9 @@ comp_obj_toc.indent_base = indent["base_position"]; comp_obj_toc.bullet = false; if (the_endnotes_section.length > 1) { toc_txt_ = format( - "{ %s }../%s.fnSuffix", + "{ %s }%s../%s.fnSuffix", "Endnotes", + mkup.mark_internal_site_lnk, "endnotes", // segment_anchor_tag_that_object_belongs_to ); toc_txt_= munge.url_links(toc_txt_); @@ -1440,8 +1441,9 @@ if (the_endnotes_section.length > 1) { } if (the_glossary_section.length > 1) { toc_txt_ = format( - "{ %s }../%s.fnSuffixs", + "{ %s }%s../%s.fnSuffixs", "Glossary", + mkup.mark_internal_site_lnk, "glossary", // segment_anchor_tag_that_object_belongs_to ); toc_txt_= munge.url_links(toc_txt_); @@ -1458,8 +1460,9 @@ if (the_glossary_section.length > 1) { } if (the_bibliography_section.length > 1){ toc_txt_ = format( - "{ %s }../%s.fnSuffix", + "{ %s }%s../%s.fnSuffix", "Bibliography", + mkup.mark_internal_site_lnk, "bibliography", // segment_anchor_tag_that_object_belongs_to ); toc_txt_= munge.url_links(toc_txt_); @@ -1477,8 +1480,9 @@ if (the_bibliography_section.length > 1){ } if (the_bookindex_section["seg"].length > 1) { toc_txt_ = format( - "{ %s }../%s.fnSuffix", + "{ %s }%s../%s.fnSuffix", "Book Index", + mkup.mark_internal_site_lnk, "bookindex", // segment_anchor_tag_that_object_belongs_to ); toc_txt_= munge.url_links(toc_txt_); @@ -1497,8 +1501,9 @@ if (the_bookindex_section["scroll"].length > 1) { } if (the_blurb_section.length > 1) { toc_txt_ = format( - "{ %s }../%s.fnSuffix", + "{ %s }%s../%s.fnSuffix", "Blurb", + mkup.mark_internal_site_lnk, "blurb", // segment_anchor_tag_that_object_belongs_to ); toc_txt_= munge.url_links(toc_txt_); @@ -1618,7 +1623,7 @@ if (the_blurb_section.length > 1) { } #+END_SRC -**** loop: all objects structural relationships (sections, segments, objects) +**** [#A] loop: all objects structural relationships (sections, segments, objects) needed for DOM structure, segnames & subtoc, backmatter pointers @@ -3827,6 +3832,8 @@ struct ObjInlineMarkup { in { } body { ObjGenericComposite comp_obj_toc; + mixin InternalMarkup; + auto mkup = InlineMarkup(); char[] heading_toc_ = to!(char[])(obj_["body_nugget"].dup.strip); heading_toc_ = _clean_heading_toc_(heading_toc_); auto attrib=""; @@ -3884,7 +3891,7 @@ struct ObjInlineMarkup { "hang_position" : 0, "base_position" : 0, ]; - toc_txt_ = "{ Table of Contents }../toc.fnSuffix"; + toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "../toc.fnSuffix"; toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.indent_hang = indent["hang_position"]; comp_obj_toc.indent_base = indent["base_position"]; @@ -3908,8 +3915,9 @@ struct ObjInlineMarkup { break; case 4: toc_txt_ = format( - "{ %s }../%s.fnSuffix", + "{ %s }%s../%s.fnSuffix", heading_toc_, + mkup.mark_internal_site_lnk, segment_anchor_tag_that_object_belongs_to, ); lev4_subtoc[segment_anchor_tag_that_object_belongs_to] = []; @@ -3925,8 +3933,9 @@ struct ObjInlineMarkup { break; case 5: .. case 7: toc_txt_ = format( - "{ %s }../%s.fnSuffix#%s", + "{ %s }%s../%s.fnSuffix#%s", heading_toc_, + mkup.mark_internal_site_lnk, segment_anchor_tag_that_object_belongs_to, _anchor_tag, ); @@ -4638,6 +4647,8 @@ struct BookIndexReportSection { bool[string] opt_action_bool, ) { mixin SiSUnode; + mixin InternalMarkup; + auto mkup = InlineMarkup(); string type_is; string lev; int heading_lev_markup, heading_lev_collapsed; @@ -4701,7 +4712,7 @@ struct BookIndexReportSection { bi_tmp_scroll ~= munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", "); bi_tmp_seg ~= (segment_anchor_tag_that_object_belongs_to.empty) ? munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ") - : munge.url_links(" {" ~ ref_ ~ "}../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", "); + : munge.url_links(" {" ~ ref_ ~ "}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", "); } bi_tmp_scroll ~= " \\\\\n "; bi_tmp_seg ~= " \\\\\n "; @@ -4718,7 +4729,7 @@ struct BookIndexReportSection { bi_tmp_scroll ~= munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", "); bi_tmp_seg ~= (segment_anchor_tag_that_object_belongs_to.empty) ? munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ") - : munge.url_links(" {" ~ ref_ ~ "}../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", "); + : munge.url_links(" {" ~ ref_ ~ "}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", "); } bi_tmp_scroll ~= " \\\\\n "; bi_tmp_seg ~= " \\\\\n "; @@ -4803,6 +4814,8 @@ struct NotesSection { ); } body { + mixin InternalMarkup; + auto mkup = InlineMarkup(); auto munge = ObjInlineMarkupMunge(); foreach( m; @@ -4813,7 +4826,7 @@ struct NotesSection { ) { debug(endnotes_build) { writeln( - "{^{", m.captures[1], ".}^}../", segment_anchor_tag_that_object_belongs_to, ".fnSuffix#noteref_\n ", m.captures[1], " ", + "{^{", m.captures[1], ".}^}" ~ mkup.mark_internal_site_lnk ~ "../", segment_anchor_tag_that_object_belongs_to, ".fnSuffix#noteref_\n ", m.captures[1], " ", m.captures[2]); // sometimes need segment name (segmented html & epub) } // TODO NEXT you need anchor for segments at this point -> @@ -4824,7 +4837,7 @@ struct NotesSection { m.captures[1]) ~ " " ~ m.captures[2] ~ "』" ) : (munge.url_links( - "{^{" ~ m.captures[1] ~ ".}^}../" ~ + "{^{" ~ m.captures[1] ~ ".}^}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#noteref_" ~ m.captures[1]) ~ " " ~ m.captures[2] ~ "』" ); -- cgit v1.2.3