aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/meta_abstraction.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/meta_abstraction.org')
-rw-r--r--org/meta_abstraction.org216
1 files changed, 111 insertions, 105 deletions
diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org
index 7f200bf..ee94ebc 100644
--- a/org/meta_abstraction.org
+++ b/org/meta_abstraction.org
@@ -186,12 +186,11 @@ string an_object_key;
string[] anchor_tags;
string anchor_tag;
string anchor_tag_;
-string segment_anchor_tag_that_object_belongs_to;
+string[string] segment_anchor_tag_that_object_belongs_to;
string lev_anchor_tag;
string[][string] tag_assoc_html;
string[][string] tag_assoc_lv0_to_lv3_html;
string[][string] tag_assoc_lv0_to_lv3_epub;
-string segment_anchor_tag_that_object_belongs_to_uri;
/+ enum +/
enum State { off, on }
enum TriState { off, on, closing }
@@ -429,7 +428,7 @@ auto inline_para_link_anchor(O,St,TA)(O an_object, St segment_anchor_tag_that_ob
static auto rgx = Rgx();
if (auto m = an_object["substantive"].match(rgx.inline_link_anchor)) {
if (m.captures[1] !in tag_assoc_html) {
- tag_assoc_html[(m.captures[1])] = [segment_anchor_tag_that_object_belongs_to];
+ tag_assoc_html[(m.captures[1])] = [segment_anchor_tag_that_object_belongs_to["html"]];
} else {
writeln("a tag named already exists, check text line\n ", an_object["substantive"]);
}
@@ -535,8 +534,8 @@ comp_obj_heading_.text = "Table of Conte
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
-comp_obj_heading_.tags.segment_anchor_tag = "toc";
-comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+comp_obj_heading_.tags.segment_anchor_tag_html = "toc";
+comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 4;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -711,8 +710,8 @@ if there is a glossary section you need to:
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "_part_glossary";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "_part_glossary";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 1;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -729,8 +728,8 @@ if there is a glossary section you need to:
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "glossary";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "glossary";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 4;
comp_obj_heading_.metainfo.heading_lev_collapsed = 2;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -832,8 +831,8 @@ if there is a blurb section you need to:
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "_part_blurb";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "_part_blurb";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 1;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -850,8 +849,8 @@ if there is a blurb section you need to:
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "blurb";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "blurb";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 4;
comp_obj_heading_.metainfo.heading_lev_collapsed = 2;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -871,8 +870,8 @@ if there is a blurb section you need to:
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "blurb";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "blurb";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = an_object["lev_markup_number"].to!int; // make int, remove need to conv
comp_obj_heading_.metainfo.heading_lev_collapsed = an_object["lev_collapsed_number"].to!int; // make int, remove need to conv
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -1200,22 +1199,22 @@ if ((obj_type_status["heading"] == State.on)
&& (!(anchor_tag.empty)
|| (tag_assoc_lv0_to_lv3_html.length > 1))
) {
- segment_anchor_tag_that_object_belongs_to = anchor_tag;
+ segment_anchor_tag_that_object_belongs_to["html"] = anchor_tag;
lev_anchor_tag = anchor_tag;
- tag_assoc_html[anchor_tag] = [segment_anchor_tag_that_object_belongs_to];
+ tag_assoc_html[anchor_tag] = [segment_anchor_tag_that_object_belongs_to["html"]];
if (tag_assoc_lv0_to_lv3_html.length > 1) { /+ 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; tag_assoc_lv0_to_lv3_html) {
- tag_assoc_html[lv0_to_lv3_html_tag[0]] = [segment_anchor_tag_that_object_belongs_to];
+ tag_assoc_html[lv0_to_lv3_html_tag[0]] = [segment_anchor_tag_that_object_belongs_to["html"]];
}
}
- segment_anchor_tag_that_object_belongs_to_uri = anchor_tag ~ ".fnSuffix";
+ segment_anchor_tag_that_object_belongs_to["html_uri"] = anchor_tag ~ ".fnSuffix";
anchor_tag_ = anchor_tag;
tag_assoc_lv0_to_lv3_html = tag_assoc_lv0_to_lv3_html.init;
} else if (an_object["lev_markup_number"].to!int > 4) {
- segment_anchor_tag_that_object_belongs_to = anchor_tag_;
+ segment_anchor_tag_that_object_belongs_to["html"] = anchor_tag_;
lev_anchor_tag = anchor_tag;
- tag_assoc_html[anchor_tag] = [segment_anchor_tag_that_object_belongs_to];
- segment_anchor_tag_that_object_belongs_to_uri = anchor_tag_ ~ ".fnSuffix#" ~ obj_cite_digits.on.to!string;
+ tag_assoc_html[anchor_tag] = [segment_anchor_tag_that_object_belongs_to["html"]];
+ segment_anchor_tag_that_object_belongs_to["html_uri"] = anchor_tag_ ~ ".fnSuffix#" ~ obj_cite_digits.on.to!string;
} else if (an_object["lev_markup_number"].to!int < 4) {
string segn;
switch (an_object["lev_markup_number"].to!int) {
@@ -1235,8 +1234,10 @@ if ((obj_type_status["heading"] == State.on)
++cnt3;
goto default;
default:
- segment_anchor_tag_that_object_belongs_to = segn;
- segment_anchor_tag_that_object_belongs_to_uri = segn ~ ".fnSuffix";
+ segment_anchor_tag_that_object_belongs_to["html"] = segn;
+ segment_anchor_tag_that_object_belongs_to["html_uri"] = segn ~ ".fnSuffix";
+ segment_anchor_tag_that_object_belongs_to["epub"] = segn;
+ segment_anchor_tag_that_object_belongs_to["epub_uri"] = segn ~ ".fnSuffix";
tag_assoc_lv0_to_lv3_html[segn] = [""];
tag_assoc_lv0_to_lv3_epub[segn] = ["segn"];
break;
@@ -1257,7 +1258,7 @@ if ((obj_type_status["heading"] == State.on)
the_table_of_contents_section,
);
if (an_object["lev_markup_number"] == "4") {
- html_segnames ~= segment_anchor_tag_that_object_belongs_to;
+ html_segnames ~= segment_anchor_tag_that_object_belongs_to["html"];
html_segnames_ptr = html_segnames_ptr_cntr;
html_segnames_ptr_cntr++;
}
@@ -1282,7 +1283,7 @@ if ((obj_type_status["heading"] == State.on)
++heading_ptr;
debug(segments) {
writeln(an_object["lev_markup_number"]);
- writeln(segment_anchor_tag_that_object_belongs_to);
+ writeln(segment_anchor_tag_that_object_belongs_to["html"]);
}
the_document_body_section ~= comp_obj_heading;
debug(objectrelated1) { // check
@@ -1330,7 +1331,7 @@ if ((obj_type_status["heading"] == State.on)
comp_obj_para.metainfo.is_of_type = "para";
comp_obj_para.metainfo.is_a = "para";
comp_obj_para.text = an_object["substantive"].to!string.strip;
- comp_obj_para.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_para.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
comp_obj_para.metainfo.ocn = obj_cite_digits.digit;
comp_obj_para.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
comp_obj_para.metainfo.o_n_book_index = obj_cite_digits.bkidx;
@@ -1493,8 +1494,8 @@ if (biblio_ordered.length > 0) {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "_part_bibliography";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "_part_bibliography";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 1;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -1509,8 +1510,8 @@ if (biblio_ordered.length > 0) {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "bibliography";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "bibliography";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 4;
comp_obj_heading_.metainfo.heading_lev_collapsed = 2;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -1649,8 +1650,8 @@ if (an_object["blurb_nugget"].length == 0) {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_para.metainfo.object_number_off = "";
comp_obj_para.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = "";
comp_obj_heading_.metainfo.heading_lev_markup = 1;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -2310,7 +2311,7 @@ foreach (ref obj; the_document_head_section) {
writeln(obj.text);
}
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
}
if (obj.metainfo.heading_lev_markup == 0) {
/+ TODO second hit (of two) with same assertion failure, check, fix and reinstate
@@ -2346,11 +2347,10 @@ if (the_table_of_contents_section["scroll"].length > 1) {
foreach (ref obj; the_table_of_contents_section["scroll"]) {
if (obj.metainfo.is_a == "heading") {
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2375,11 +2375,11 @@ if (the_table_of_contents_section["scroll"].length > 1) {
writeln(obj.text);
}
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
if ((opt_action.html)
@@ -2407,15 +2407,15 @@ if (the_document_body_section.length > 1) {
writeln(obj.text);
}
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
- obj.tags.lev4_subtoc = lev4_subtoc[obj.tags.segment_anchor_tag];
+ obj.tags.lev4_subtoc = lev4_subtoc[obj.tags.segment_anchor_tag_html];
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2458,14 +2458,14 @@ if (the_endnotes_section.length > 1) {
obj_cite_digits = ocn_emit(OCNstatus.on);
obj.metainfo.ocn = obj_cite_digits.digit;
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2500,14 +2500,14 @@ if (the_glossary_section.length > 1) {
obj_cite_digits = ocn_emit(OCNstatus.on);
obj.metainfo.ocn = obj_cite_digits.digit;
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2545,14 +2545,14 @@ if (the_bibliography_section.length > 1) {
obj_cite_digits = ocn_emit(OCNstatus.on);
obj.metainfo.ocn = obj_cite_digits.digit;
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2595,14 +2595,13 @@ if (the_bookindex_section["scroll"].length > 1) {
obj_cite_digits = ocn_emit(OCNstatus.on);
obj.metainfo.ocn = obj_cite_digits.on;
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2633,14 +2632,14 @@ if (the_bookindex_section["scroll"].length > 1) {
}
obj.metainfo.ocn = ++ocn_;
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2681,14 +2680,14 @@ if (the_blurb_section.length > 1) {
obj_cite_digits = ocn_emit(OCNstatus.on);
obj.metainfo.ocn = obj_cite_digits.on;
if (obj.metainfo.heading_lev_markup <= 4) {
- segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag;
+ segnames_lv0_to_4 ~= obj.tags.segment_anchor_tag_epub;
if (obj.metainfo.heading_lev_markup == 4) {
obj.tags.segname_prev = html_segnames[obj.ptr.html_segnames - 1];
if (html_segnames.length > obj.ptr.html_segnames + 1) {
obj.tags.segname_next = html_segnames[obj.ptr.html_segnames + 1];
}
- assert(obj.tags.segment_anchor_tag == html_segnames[obj.ptr.html_segnames],
- obj.tags.segment_anchor_tag ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
+ assert(obj.tags.segment_anchor_tag_html == html_segnames[obj.ptr.html_segnames],
+ obj.tags.segment_anchor_tag_html ~ "!=" ~ html_segnames[obj.ptr.html_segnames]);
}
}
/+ dom structure (marked up & collapsed) +/
@@ -2827,7 +2826,9 @@ comp_obj_heading_.metainfo.is_a = "heading";
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_para.metainfo.object_number_off = "";
comp_obj_para.metainfo.object_number_type = 0;
-comp_obj_heading_.tags.segment_anchor_tag = "";
+comp_obj_heading_.tags.segment_anchor_tag_html = "";
+comp_obj_heading_.tags.segment_anchor_tag_epub = "";
+comp_obj_heading_.tags.segment_anchor_tag_is = "";
comp_obj_heading_.metainfo.heading_lev_markup = 9;
comp_obj_heading_.metainfo.heading_lev_collapsed = 9;
comp_obj_heading_.metainfo.parent_ocn = 0;
@@ -3820,7 +3821,7 @@ void _poem_block_(L,O,T,C,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "verse";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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.text = an_object["substantive"];
@@ -3881,7 +3882,7 @@ void _poem_block_(L,O,T,C,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "verse";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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.text = an_object["substantive"];
@@ -3925,7 +3926,7 @@ void _poem_block_(L,O,T,C,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "verse";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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.text = an_object["substantive"];
@@ -3986,7 +3987,7 @@ void _poem_block_(L,O,T,C,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "verse";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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.text = an_object["substantive"];
@@ -4127,7 +4128,7 @@ void _table_closed_make_special_notation_table_(N,CMM)(
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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 = table_instructions(comp_obj_block, an_object["table_head"]);
@@ -4209,7 +4210,7 @@ void _block_flag_line_empty_(B,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "quote";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx;
comp_obj_block.metainfo.object_number_type = obj_cite_digit_type;
comp_obj_block.text = an_object["substantive"];
@@ -4262,7 +4263,7 @@ void _block_flag_line_empty_(B,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "group";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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.text = an_object["substantive"];
@@ -4313,7 +4314,7 @@ void _block_flag_line_empty_(B,N,CMM,Ts)(
comp_obj_block.metainfo.is_a = "block";
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
comp_obj_block.metainfo.o_n_book_index = obj_cite_digits.bkidx;
comp_obj_block.metainfo.object_number_type = obj_cite_digit_type;
comp_obj_block.text = an_object["substantive"];
@@ -4407,7 +4408,7 @@ void _block_flag_line_empty_(B,N,CMM,Ts)(
comp_obj_code.metainfo.is_a = "code";
comp_obj_code.metainfo.ocn = obj_cite_digits.on;
comp_obj_code.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_code.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_code.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
comp_obj_code.metainfo.o_n_book_index = obj_cite_digits.bkidx;
comp_obj_code.metainfo.object_number_type = obj_cite_digits.type;
comp_obj_code.text = an_object["substantive"];
@@ -4455,7 +4456,7 @@ void _block_flag_line_empty_(B,N,CMM,Ts)(
comp_obj_block = comp_obj_block.init;
comp_obj_block.metainfo.ocn = obj_cite_digits.on;
comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
- comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ comp_obj_block.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
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 = table_instructions(comp_obj_block, an_object["table_head"]);
@@ -5865,7 +5866,7 @@ static struct ObjInlineMarkup {
in {
debug(asserts) {
static assert(is(typeof(obj_) == string[string]));
- static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string));
+ static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string[string]));
static assert(is(typeof(_anchor_tag) == string));
static assert(is(typeof(lev4_subtoc) == string[][string]));
static assert(is(typeof(the_table_of_contents_section) == ObjGenericComposite[][string]));
@@ -5970,10 +5971,10 @@ static struct ObjInlineMarkup {
"{ %s }%s%s%s",
heading_toc_,
mkup.mark_internal_site_lnk,
- segment_anchor_tag_that_object_belongs_to,
+ segment_anchor_tag_that_object_belongs_to["html"],
".fnSuffix",
);
- lev4_subtoc[segment_anchor_tag_that_object_belongs_to] = [];
+ lev4_subtoc[segment_anchor_tag_that_object_belongs_to["html"]] = [];
toc_txt_= munge.url_links(toc_txt_);
indent=[
"hang_position" : obj_["lev_markup_number"].to!int,
@@ -5990,7 +5991,7 @@ static struct ObjInlineMarkup {
"{ %s }%s%s%s#%s",
heading_toc_,
mkup.mark_internal_site_lnk,
- segment_anchor_tag_that_object_belongs_to,
+ segment_anchor_tag_that_object_belongs_to["html"],
".fnSuffix",
_anchor_tag,
);
@@ -5999,7 +6000,7 @@ static struct ObjInlineMarkup {
heading_toc_,
_anchor_tag,
);
- lev4_subtoc[segment_anchor_tag_that_object_belongs_to]
+ lev4_subtoc[segment_anchor_tag_that_object_belongs_to["html"]]
~= munge.url_links(obj_["lev_markup_number"]
~ "~ " ~ subtoc_txt_.to!string.strip
);
@@ -6610,7 +6611,7 @@ struct BookIndexNuggetHash {
string[][string][string] bookindex_nugget_hash(BI,N,S)(
BI bookindex_section,
N obj_cite_digits,
- S segment_anchor_tag,
+ S segment_anchor_tag_that_object_belongs_to,
)
in {
debug(asserts) {
@@ -6621,7 +6622,7 @@ struct BookIndexNuggetHash {
if (!bookindex_section.empty) {
writeln(
"* [bookindex] ",
- "[", obj_cite_digits.on.to!string, ": ", segment_anchor_tag, "] ", bookindex_section
+ "[", obj_cite_digits.on.to!string, ": ", segment_anchor_tag_that_object_belongs_to["html"], "] ", bookindex_section
);
}
}
@@ -6642,11 +6643,11 @@ struct BookIndexNuggetHash {
object_number_endpoint=(obj_cite_digits.on + object_number_offset);
object_numbers ~= (obj_cite_digits.on.to!string
~ "-" ~ object_number_endpoint.to!string
- ~ ":" ~ segment_anchor_tag);
+ ~ ":" ~ segment_anchor_tag_that_object_belongs_to["html"]);
} else {
main_term = bi_main_term_and_rest[0].strip;
object_numbers ~= obj_cite_digits.on.to!string
- ~ ":" ~ segment_anchor_tag;
+ ~ ":" ~ segment_anchor_tag_that_object_belongs_to["html"];
}
bi[main_term]["_a"] ~= object_numbers;
object_numbers=null;
@@ -6662,11 +6663,11 @@ struct BookIndexNuggetHash {
object_number_endpoint=(obj_cite_digits.on + object_number_offset);
object_numbers ~= (obj_cite_digits.on.to!string
~ " - " ~ object_number_endpoint.to!string
- ~ ":" ~ segment_anchor_tag);
+ ~ ":" ~ segment_anchor_tag_that_object_belongs_to["html"]);
} else {
sub_term = sub_terms_bits.strip;
object_numbers ~= obj_cite_digits.on.to!string
- ~ ":" ~ segment_anchor_tag;
+ ~ ":" ~ segment_anchor_tag_that_object_belongs_to["html"];
}
if (!empty(sub_term)) {
bi[main_term][sub_term] ~= object_numbers;
@@ -6806,8 +6807,8 @@ struct BookIndexReportSection {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "_part_book_index";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "_part_book_index";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 1;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -6825,8 +6826,8 @@ struct BookIndexReportSection {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "bookindex";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "bookindex";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 4;
comp_obj_heading_.metainfo.heading_lev_collapsed = 2;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -6925,7 +6926,10 @@ struct BookIndexReportSection {
bookindex_section["scroll"] ~= comp_obj_heading_;
bookindex_section["seg"] ~= comp_obj_heading_;
}
- auto t = tuple(bookindex_section, obj_cite_digits);
+ auto t = tuple(
+ bookindex_section,
+ obj_cite_digits
+ );
return t;
}
#+END_SRC
@@ -6954,7 +6958,7 @@ struct NotesSection {
#+BEGIN_SRC d
private auto gather_notes_for_endnote_section(
ObjGenericComposite[] contents_am,
- string segment_anchor_tag_that_object_belongs_to,
+ string[string] segment_anchor_tag_that_object_belongs_to,
int cntr,
)
in {
@@ -6985,13 +6989,13 @@ struct NotesSection {
writeln(
"{^{", m.captures[1], ".}^}"
~ mkup.mark_internal_site_lnk,
- segment_anchor_tag_that_object_belongs_to,
+ segment_anchor_tag_that_object_belongs_to["html"],
".fnSuffix#noteref_\n ", m.captures[1], " ",
m.captures[2]); // sometimes need segment name (segmented html & epub)
}
// you need anchor for segments at this point ->
object_notes["anchor"] ~= "note_" ~ m.captures[1] ~ "』";
- object_notes["notes"] ~= (segment_anchor_tag_that_object_belongs_to.empty)
+ object_notes["notes"] ~= (segment_anchor_tag_that_object_belongs_to["html"].empty)
? (munge.url_links(
"{^{" ~ m.captures[1] ~ ".}^}#noteref_"
~ m.captures[1]) ~ " "
@@ -7000,7 +7004,7 @@ struct NotesSection {
: (munge.url_links(
"{^{" ~ m.captures[1] ~ ".}^}"
~ mkup.mark_internal_site_lnk
- ~ segment_anchor_tag_that_object_belongs_to
+ ~ segment_anchor_tag_that_object_belongs_to["html"]
~ ".fnSuffix#noteref_"
~ m.captures[1]) ~ " "
~ m.captures[2] ~ "』"
@@ -7060,8 +7064,8 @@ struct NotesSection {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "_part_endnotes";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "_part_endnotes";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 1;
comp_obj_heading_.metainfo.heading_lev_collapsed = 1;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -7077,8 +7081,8 @@ struct NotesSection {
comp_obj_heading_.metainfo.ocn = 0;
comp_obj_heading_.metainfo.object_number_off = "";
comp_obj_heading_.metainfo.object_number_type = 0;
- comp_obj_heading_.tags.segment_anchor_tag = "endnotes";
- comp_obj_heading_.tags.segment_anchor_tag_is = comp_obj_heading_.tags.segment_anchor_tag;
+ comp_obj_heading_.tags.segment_anchor_tag_html = "endnotes";
+ comp_obj_heading_.tags.segment_anchor_tag_epub = comp_obj_heading_.tags.segment_anchor_tag_html;
comp_obj_heading_.metainfo.heading_lev_markup = 4;
comp_obj_heading_.metainfo.heading_lev_collapsed = 2;
comp_obj_heading_.metainfo.parent_ocn = 1;
@@ -7291,7 +7295,7 @@ struct NodeStructureMetadata {
#+BEGIN_SRC d
ObjGenericComposite node_location_emitter(Lv,Tg,La,Ta,N,C,P,I)(
Lv lev_markup_number,
- Tg segment_anchor_tag,
+ Tg segment_anchor_tag_that_object_belongs_to,
La lev_anchor_tag,
Ta tag_assoc_html,
N obj_cite_digits,
@@ -7302,7 +7306,7 @@ struct NodeStructureMetadata {
in {
debug(asserts) {
static assert(is(typeof(lev_markup_number) == string));
- static assert(is(typeof(segment_anchor_tag) == string));
+ static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string[string]));
static assert(is(typeof(obj_cite_digits.on) == int));
static assert(is(typeof(cntr_) == int));
static assert(is(typeof(ptr_) == int));
@@ -7331,8 +7335,8 @@ struct NodeStructureMetadata {
comp_obj_location = comp_obj_location.init;
comp_obj_location.metainfo.is_a = is_;
comp_obj_location.metainfo.ocn = obj_cite_digits.on;
- comp_obj_location.tags.segment_anchor_tag = segment_anchor_tag.to!string;
- comp_obj_location.tags.segment_anchor_tag_is = comp_obj_location.tags.segment_anchor_tag;
+ comp_obj_location.tags.segment_anchor_tag_html = segment_anchor_tag_that_object_belongs_to["html"];
+ comp_obj_location.tags.segment_anchor_tag_epub = segment_anchor_tag_that_object_belongs_to["epub"];
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"];
@@ -7379,7 +7383,7 @@ struct NodeStructureMetadata {
static assert(is(typeof(lev) == string));
static assert(is(typeof(lev_markup_number) == string));
static assert(is(typeof(lev_collapsed_number) == string));
- static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string));
+ static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string[string]));
static assert(is(typeof(obj_cite_digits.on) == int));
static assert(is(typeof(cntr_) == int));
static assert(is(typeof(ptr_) == int));
@@ -7497,9 +7501,10 @@ struct NodeStructureMetadata {
_comp_obj_heading_.metainfo.ocn = obj_cite_digits.on;
_comp_obj_heading_.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string;
_comp_obj_heading_.metainfo.object_number_type = obj_cite_digits.type;
- _comp_obj_heading_.tags.segment_anchor_tag = segment_anchor_tag_that_object_belongs_to;
+ _comp_obj_heading_.tags.segment_anchor_tag_html = segment_anchor_tag_that_object_belongs_to["html"];
+ _comp_obj_heading_.tags.segment_anchor_tag_epub = _comp_obj_heading_.tags.segment_anchor_tag_html;
_comp_obj_heading_.tags.heading_lev_anchor_tag = lev_anchor_tag;
- _comp_obj_heading_.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to;
+ _comp_obj_heading_.tags.segment_anchor_tag_is = segment_anchor_tag_that_object_belongs_to["html"];
_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"];
@@ -7939,7 +7944,8 @@ struct DocObj_Pointer_ {
}
struct DocObj_Tags_ {
string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; // TODO redundant? see markedup and collapsed ancestors DONE
- string segment_anchor_tag = "";
+ string segment_anchor_tag_html = "";
+ string segment_anchor_tag_epub = "";
string segment_anchor_tag_is = "";
string heading_lev_anchor_tag = "";
string segname_prev = "";