aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-02-26 18:01:24 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitb11f8f104e8c3a4ab9740d086da91aa943200e6e (patch)
tree2f898df140d855b5b9c29a17decf75c5f9896c80
parent0.13.3 tuples, sdp & doc_abstraction (flag marked up links & endnotes) (diff)
0.13.4 includes ao bookindex segname (anchors) fix
-rw-r--r--org/ao_doc_abstraction.org234
-rw-r--r--org/defaults.org20
-rw-r--r--org/sdp.org2
-rw-r--r--src/sdp/ao_abstract_doc_source.d212
-rw-r--r--src/sdp/ao_object_setter.d18
-rw-r--r--src/sdp/ao_rgx.d20
-rw-r--r--views/version.txt2
7 files changed, 306 insertions, 202 deletions
diff --git a/org/ao_doc_abstraction.org b/org/ao_doc_abstraction.org
index 63491de..d2b13aa 100644
--- a/org/ao_doc_abstraction.org
+++ b/org/ao_doc_abstraction.org
@@ -206,7 +206,6 @@ 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 }
/+ biblio variables +/
string biblio_tag_name, biblio_tag_entry, st;
string[] biblio_arr_json;
@@ -332,8 +331,8 @@ auto dom_set_markup_tags(int[] dom, int lev) {
}
}
}
- debug(dom) {
- writeln(lev, ": ", dom);
+ debug(dom_magic_numbers) {
+ writeln("marked up: ", lev, ": ", dom);
}
return dom;
}
@@ -377,8 +376,8 @@ auto dom_set_collapsed_tags(int[] dom, int lev) {
}
}
}
- debug(dom) {
- writeln(lev, ": ", dom);
+ debug(dom_magic_numbers) {
+ writeln("collapsed: ", lev, ": ", dom);
}
return dom;
}
@@ -558,7 +557,7 @@ if (!line.empty) {
}
#+END_SRC
-*** [#A] separate regular markup text from code blocks [+5]
+*** [#A] separate _code blocks_ from _other markup text_ [+5]
**** code blocks :block:code:
#+name: abs_in_loop_body_00_code_block
@@ -569,7 +568,7 @@ continue;
#+END_SRC
**** non code objects (other blocks or regular text) [+4] :non_code:
-***** in section (biblio, glossary, blurb) (block group) [+1] :block:active:
+***** in section (biblio, glossary, blurb) +(block group)+ [+1] :block:active:
****** within section: biblio :biblio:
#+name: abs_in_loop_body_non_code_obj
@@ -584,7 +583,7 @@ if ((matchFirst(line, rgx.heading_biblio)
type["biblio_section"] = State.on;
type["blurb_section"] = State.off;
if (opt_action_bool["backmatter"] && opt_action_bool["section_biblio"]) {
- _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); //
+ _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json);
debug(bibliobuild) {
writeln("- ", biblio_entry_str_json);
writeln("-> ", biblio_arr_json.length);
@@ -1031,10 +1030,6 @@ if ((type["heading"] == State.on)
obj_cite_number = (to!int(an_object["lev_markup_number"]) == 0)
? (ocn_emit(3))
: (obj_cite_number = ocn_emit(type["ocn_status"]));
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "heading";
an_object_key="body_nugget";
auto substantive_object_and_anchor_tags_tuple =
@@ -1052,6 +1047,10 @@ if ((type["heading"] == State.on)
segment_anchor_tag_that_object_belongs_to = "";
segment_anchor_tag_that_object_belongs_to_uri = "";
}
+ an_object["bookindex_nugget"] =
+ ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes =
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
/+ (incrementally build toc) table of contents here! +/
_anchor_tag=to!string(obj_cite_number);
the_table_of_contents_section = obj_im.table_of_contents_gather_headings(
@@ -1111,7 +1110,7 @@ if ((type["heading"] == State.on)
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "para";
auto comp_obj_heading =
node_construct.node_location_emitter(
@@ -1395,7 +1394,6 @@ auto bi_tuple =
bi.bookindex_build_abstraction_section(
bookindex_unordered_hashes,
obj_cite_number,
- segment_anchor_tag_that_object_belongs_to,
opt_action_bool,
);
destroy(bookindex_unordered_hashes);
@@ -1455,24 +1453,28 @@ comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.bullet = false;
if (the_endnotes_section.length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Endnotes",
mkup.mark_internal_site_lnk,
"endnotes", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
}
if (the_glossary_section.length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffixs",
+ "{ %s }%s%s%s",
"Glossary",
mkup.mark_internal_site_lnk,
"glossary", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
toc_txt_ = format(
"{ %s }#%s",
@@ -1481,17 +1483,20 @@ if (the_glossary_section.length > 1) {
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
if (the_bibliography_section.length > 1){
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Bibliography",
mkup.mark_internal_site_lnk,
"bibliography", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
toc_txt_ = format(
@@ -1501,17 +1506,20 @@ if (the_bibliography_section.length > 1){
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
if (the_bookindex_section["seg"].length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Book Index",
mkup.mark_internal_site_lnk,
"bookindex", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
}
if (the_bookindex_section["scroll"].length > 1) {
@@ -1522,17 +1530,20 @@ if (the_bookindex_section["scroll"].length > 1) {
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
if (the_blurb_section.length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Blurb",
mkup.mark_internal_site_lnk,
"blurb", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
toc_txt_ = format(
"{ %s }#%s",
@@ -1540,6 +1551,7 @@ if (the_blurb_section.length > 1) {
"blurb", // _anchor_tag
);
toc_txt_= munge.url_links(toc_txt_);
+ comp_obj_toc.inline_links = true;
comp_obj_toc.text = to!string(toc_txt_).strip;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
@@ -3057,7 +3069,7 @@ void _block_flag_line_empty_(B)(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "code";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3092,7 +3104,7 @@ void _block_flag_line_empty_(B)(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "verse"; // check also
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3121,7 +3133,7 @@ void _block_flag_line_empty_(B)(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "table";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3158,7 +3170,7 @@ void _block_flag_line_empty_(B)(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "group";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3194,7 +3206,7 @@ void _block_flag_line_empty_(B)(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "block";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3231,7 +3243,7 @@ void _block_flag_line_empty_(B)(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "quote";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3310,7 +3322,8 @@ auto _book_index_(L,I,O,T,B)(
/+ book_index flag set +/
if (auto m = match(line, rgx.book_index_close)) {
type["book_index"] = State.off;
- if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ if (opt_action_bool["backmatter"]
+ && opt_action_bool["section_bookindex"]) {
an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]);
debug(bookindexmatch) { // book index
writefln(
@@ -3321,7 +3334,8 @@ auto _book_index_(L,I,O,T,B)(
}
book_idx_tmp = "";
} else {
- if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ if (opt_action_bool["backmatter"]
+ && opt_action_bool["section_bookindex"]) {
book_idx_tmp ~= line;
}
}
@@ -3766,7 +3780,7 @@ struct ObjInlineMarkupMunge {
n_foot_sp_asterisk = 0;
n_foot_sp_plus = 0;
}
- string url_links(Ot)(Ot obj_txt_in) {
+ string url_links(Ot)(Ot obj_txt_in, string suffix = ".html") {
debug(asserts){
static assert(is(typeof(obj_txt_in) == string));
}
@@ -3779,7 +3793,7 @@ struct ObjInlineMarkupMunge {
obj_txt_in,
rgx.inline_link_naked_url,
("$1"
- ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
~ "$3") // ("$1{ $2 }$2$3")
);
@@ -3794,7 +3808,7 @@ struct ObjInlineMarkupMunge {
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper_punctuated,
- (mkup.lnk_o ~ " $1 " ~ mkup.lnk_c
+ (mkup.lnk_o ~ "$1" ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
@@ -3804,7 +3818,7 @@ struct ObjInlineMarkupMunge {
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper,
- (mkup.lnk_o ~ " $1 " ~ mkup.lnk_c
+ (mkup.lnk_o ~ "$1" ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
@@ -3820,7 +3834,7 @@ struct ObjInlineMarkupMunge {
obj_txt_in,
rgx.inline_link_markup_regular,
("$1"
- ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c
~ mkup.url_o ~ "$3" ~ mkup.url_c
~ "$4") // ("$1{ $2 }$3$4")
);
@@ -3833,8 +3847,8 @@ struct ObjInlineMarkupMunge {
static assert(is(typeof(obj_txt_in) == string));
}
/+ endnotes (regular) +/
- bool notes_reg = false;
- bool notes_star = false;
+ bool flg_notes_reg = false;
+ bool flg_notes_star = false;
obj_txt_in =
replaceAll(
obj_txt_in,
@@ -3855,7 +3869,7 @@ struct ObjInlineMarkupMunge {
stage_reset_note_numbers = false;
foreach(n; m) {
if (match(to!string(n.hit), rgx.inline_al_delimiter_open_symbol_star)) {
- notes_star = true;
+ flg_notes_star = true;
++n_foot_sp_asterisk;
asterisks_ = "*";
n_foot=n_foot_sp_asterisk;
@@ -3866,7 +3880,7 @@ struct ObjInlineMarkupMunge {
(mkup.en_a_o ~ replicate(asterisks_, n_foot_sp_asterisk) ~ " ")
) ~ "\n");
} else if (match(to!string(n.hit), rgx.inline_al_delimiter_open_regular)) {
- notes_reg = true;
+ flg_notes_reg = true;
++n_foot_reg;
n_foot=n_foot_reg;
obj_txt_out ~=
@@ -3885,8 +3899,8 @@ struct ObjInlineMarkupMunge {
}
auto t = tuple(
obj_txt_out,
- notes_reg,
- notes_star,
+ flg_notes_reg,
+ flg_notes_star,
);
return t;
}
@@ -4120,7 +4134,7 @@ struct ObjInlineMarkup {
obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"]);
if (auto m = match(obj_txt["munge"], rgx.heading_anchor_tag)) {
anchor_tag = m.captures[1];
- anchor_tags_ ~=anchor_tag;
+ anchor_tags_ ~= anchor_tag;
} else if (obj_["lev"] == "1") {
writeln("heading anchor tag missing: ", obj_txt["munge"]);
}
@@ -4242,6 +4256,7 @@ struct ObjInlineMarkup {
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.bullet = false;
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
} else {
indent=[
@@ -4258,6 +4273,7 @@ struct ObjInlineMarkup {
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.bullet = false;
comp_obj_toc.text = "Table of Contents";
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
comp_obj_toc = comp_obj_toc.init;
@@ -4267,17 +4283,19 @@ struct ObjInlineMarkup {
comp_obj_toc.ocn = 0;
comp_obj_toc.obj_cite_number = "";
comp_obj_toc.bullet = false;
+ comp_obj_toc.inline_links = true;
switch (to!int(obj_["lev_markup_number"])) {
case 0:
indent=[
"hang_position" : 0,
"base_position" : 0,
];
- toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "../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"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 1: .. case 3:
@@ -4293,14 +4311,16 @@ struct ObjInlineMarkup {
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 4:
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
heading_toc_,
mkup.mark_internal_site_lnk,
segment_anchor_tag_that_object_belongs_to,
+ ".fnSuffix",
);
lev4_subtoc[segment_anchor_tag_that_object_belongs_to] = [];
toc_txt_= munge.url_links(toc_txt_);
@@ -4311,14 +4331,16 @@ struct ObjInlineMarkup {
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 5: .. case 7:
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix#%s",
+ "{ %s }%s%s%s#%s",
heading_toc_,
mkup.mark_internal_site_lnk,
segment_anchor_tag_that_object_belongs_to,
+ ".fnSuffix",
_anchor_tag,
);
subtoc_txt_ = format(
@@ -4335,6 +4357,7 @@ struct ObjInlineMarkup {
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
default:
@@ -4934,9 +4957,10 @@ struct BookIndexNuggetHash {
string[][string][string] bi;
string[][string][string] hash_nugget;
string[] bi_main_terms_split_arr;
- string[][string][string] bookindex_nugget_hash(BI,N)(
+ string[][string][string] bookindex_nugget_hash(BI,N,S)(
BI bookindex_section,
- N obj_cite_number
+ N obj_cite_number,
+ S segment_anchor_tag,
)
in {
debug(asserts){
@@ -4947,7 +4971,7 @@ struct BookIndexNuggetHash {
if (!bookindex_section.empty) {
writeln(
"* [bookindex] ",
- "[", to!string(obj_cite_number), "] ", bookindex_section
+ "[", to!string(obj_cite_number), ": ", segment_anchor_tag, "] ", bookindex_section
);
}
}
@@ -4967,10 +4991,12 @@ struct BookIndexNuggetHash {
main_term = strip(m.captures[1]);
obj_cite_number_offset = to!int(m.captures[2]);
obj_cite_number_endpoint=(obj_cite_number + obj_cite_number_offset);
- obj_cite_numbers ~= (to!string(obj_cite_number) ~ "-" ~ to!string(obj_cite_number_endpoint));
+ obj_cite_numbers ~= (to!string(obj_cite_number) ~ "-" ~ to!string(obj_cite_number_endpoint)
+ ~ ":" ~ segment_anchor_tag);
} else {
main_term = strip(bi_main_term_and_rest[0]);
- obj_cite_numbers ~= to!string(obj_cite_number);
+ obj_cite_numbers ~= to!string(obj_cite_number)
+ ~ ":" ~ segment_anchor_tag;
}
bi[main_term]["_a"] ~= obj_cite_numbers;
obj_cite_numbers=null;
@@ -4985,10 +5011,12 @@ struct BookIndexNuggetHash {
sub_term = strip(m.captures[1]);
obj_cite_number_offset = to!int(m.captures[2]);
obj_cite_number_endpoint=(obj_cite_number + obj_cite_number_offset);
- obj_cite_numbers ~= (to!string(obj_cite_number) ~ " - " ~ to!string(obj_cite_number_endpoint));
+ obj_cite_numbers ~= (to!string(obj_cite_number) ~ " - " ~ to!string(obj_cite_number_endpoint)
+ ~ ":" ~ segment_anchor_tag);
} else {
sub_term = strip(sub_terms_bits);
- obj_cite_numbers ~= to!string(obj_cite_number);
+ obj_cite_numbers ~= to!string(obj_cite_number)
+ ~ ":" ~ segment_anchor_tag;
}
if (!empty(sub_term)) {
bi[main_term][sub_term] ~= obj_cite_numbers;
@@ -5021,13 +5049,13 @@ struct BookIndexReportIndent {
auto mainkeys=
bookindex_unordered_hashes.byKey.array.sort().release;
foreach (mainkey; mainkeys) {
- debug(bookindex) {
+ debug(bookindex1) {
writeln(mainkey);
}
auto subkeys=
bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
foreach (subkey; subkeys) {
- debug(bookindex) {
+ debug(bookindex1) {
writeln(" ", subkey);
writeln(" ", to!string(
bookindex_unordered_hashes[mainkey][subkey]
@@ -5091,16 +5119,14 @@ struct BookIndexReportSection {
#+name: ao_emitters_book_index_report_section
#+BEGIN_SRC d
- auto bookindex_build_abstraction_section(BI,N,Ta,B)(
+ auto bookindex_build_abstraction_section(BI,N,B)(
BI bookindex_unordered_hashes,
N obj_cite_number,
- Ta segment_anchor_tag_that_object_belongs_to,
B opt_action_bool,
) {
debug(asserts){
static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string]));
static assert(is(typeof(obj_cite_number) == int));
- static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string));
static assert(is(typeof(opt_action_bool) == bool[string]));
}
mixin SiSUnode;
@@ -5118,7 +5144,8 @@ struct BookIndexReportSection {
auto node_para_int_ = node_metadata_para_int;
auto node_para_str_ = node_metadata_para_str;
if ((mainkeys.length > 0)
- && (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"])) {
+ && (opt_action_bool["backmatter"]
+ && opt_action_bool["section_bookindex"])) {
string bi_tmp_seg, bi_tmp_scroll;
string[] bi_tmp_tags;
comp_obj_heading_ = comp_obj_heading_.init;
@@ -5133,6 +5160,7 @@ struct BookIndexReportSection {
comp_obj_heading_.heading_lev_collapsed = 1;
comp_obj_heading_.parent_ocn = 1;
comp_obj_heading_.parent_lev_markup = 0;
+ comp_obj_heading.inline_links = true;
bookindex_section["scroll"] ~= comp_obj_heading_;
bookindex_section["seg"] ~= comp_obj_heading_;
++obj_cite_number;
@@ -5150,6 +5178,7 @@ struct BookIndexReportSection {
comp_obj_heading_.heading_lev_collapsed = 2;
comp_obj_heading_.parent_ocn = 1;
comp_obj_heading_.parent_lev_markup = 0;
+ comp_obj_heading.inline_links = false;
comp_obj_heading_.anchor_tags = ["bookindex"];
bookindex_section["scroll"] ~= comp_obj_heading_;
bookindex_section["seg"] ~= comp_obj_heading_;
@@ -5164,15 +5193,33 @@ struct BookIndexReportSection {
buffer.clear();
bi_tmp_tags ~= translate(mainkey, transTable);
bi_tmp_seg = "!{" ~ mainkey ~ "}! ";
+ auto bkidx_lnk_seg(string locs) {
+ string markup = "";
+ if (auto m = matchFirst(locs, rgx.book_index_go_seg)) {
+ markup =
+ munge.url_links("{ " ~ m["link"] ~ " }"
+ ~ mkup.mark_internal_site_lnk ~ m["seg"] ~ ".fnSuffix"
+ ~ "#" ~ m["ocn"] ~ ", ");
+ } else {
+ writeln(__LINE__, ": ", locs);
+ }
+ return markup;
+ }
+ auto bkidx_lnk_scroll(string locs) {
+ string markup = "";
+ if (auto m = matchFirst(locs, rgx.book_index_go)) {
+ markup =
+ munge.url_links("{ " ~ m["link"] ~ " }"
+ ~ mkup.mark_internal_site_lnk
+ ~ "#" ~ m["ocn"] ~ ", ");
+ } else {
+ writeln(__LINE__, ": ", locs);
+ }
+ return markup;
+ }
foreach (ref_; bookindex_unordered_hashes[mainkey]["_a"]) {
- auto go = replaceAll(ref_, rgx.book_index_go, "$1");
- 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_ ~ "}"
- ~ mkup.mark_internal_site_lnk ~ "../"
- ~ segment_anchor_tag_that_object_belongs_to
- ~ ".fnSuffix#" ~ go ~ ", ");
+ bi_tmp_scroll ~= bkidx_lnk_scroll(ref_);
+ bi_tmp_seg ~= bkidx_lnk_seg(ref_);
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -5185,21 +5232,15 @@ struct BookIndexReportSection {
bi_tmp_tags ~= translate(subkey, transTable);
bi_tmp_seg ~= subkey ~ ", ";
foreach (ref_; bookindex_unordered_hashes[mainkey][subkey]) {
- auto go = replaceAll(ref_, rgx.book_index_go, "$1");
- 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_ ~ "}"
- ~ mkup.mark_internal_site_lnk ~ "../"
- ~ segment_anchor_tag_that_object_belongs_to
- ~ ".fnSuffix#" ~ go ~ ", ");
+ bi_tmp_scroll ~= bkidx_lnk_scroll(ref_);
+ bi_tmp_seg ~= bkidx_lnk_seg(ref_);
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
++skn;
}
- bi_tmp_scroll = replaceFirst(bi_tmp_scroll, rgx.trailing_linebreak, "");
- bi_tmp_seg = replaceFirst(bi_tmp_seg, rgx.trailing_linebreak, "");
+ bi_tmp_scroll = replaceFirst(bi_tmp_scroll, rgx.trailing_linebreak, "");
+ bi_tmp_seg = replaceFirst(bi_tmp_seg, rgx.trailing_linebreak, "");
comp_obj_para = comp_obj_para.init;
comp_obj_para.use = "backmatter";
comp_obj_para.is_of = "para";
@@ -5211,6 +5252,7 @@ struct BookIndexReportSection {
comp_obj_para.indent_hang = 0;
comp_obj_para.indent_base = 1;
comp_obj_para.bullet = false;
+ comp_obj_para.inline_links = true;
bookindex_section["scroll"] ~= comp_obj_para;
comp_obj_para.text = to!string(bi_tmp_seg).strip;
bookindex_section["seg"] ~= comp_obj_para;
@@ -5263,9 +5305,6 @@ struct NotesSection {
int cntr,
)
in {
- // endnotes/ footnotes for
- // doc objects other than paragraphs & headings
- // various forms of grouped text
assert((contents_am[cntr].is_a == "para")
|| (contents_am[cntr].is_a == "heading")
|| (contents_am[cntr].is_a == "group"));
@@ -5289,20 +5328,27 @@ struct NotesSection {
) {
debug(endnotes_build) {
writeln(
- "{^{", m.captures[1], ".}^}" ~ mkup.mark_internal_site_lnk ~ "../", 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 ->
object_notes["anchor"] ~= "#note_" ~ m.captures[1] ~ "』";
object_notes["notes"] ~= (segment_anchor_tag_that_object_belongs_to.empty)
? (munge.url_links(
- "{^{" ~ m.captures[1] ~ ".}^}#noteref_" ~
- m.captures[1]) ~ " " ~ m.captures[2] ~ "』"
+ "{^{" ~ m.captures[1] ~ ".}^}#noteref_"
+ ~ m.captures[1]) ~ " "
+ ~ m.captures[2] ~ "』"
)
: (munge.url_links(
- "{^{" ~ m.captures[1] ~ ".}^}" ~ mkup.mark_internal_site_lnk ~ "../" ~
- segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#noteref_" ~
- m.captures[1]) ~ " " ~ m.captures[2] ~ "』"
+ "{^{" ~ m.captures[1] ~ ".}^}"
+ ~ mkup.mark_internal_site_lnk
+ ~ segment_anchor_tag_that_object_belongs_to
+ ~ ".fnSuffix#noteref_"
+ ~ m.captures[1]) ~ " "
+ ~ m.captures[2] ~ "』"
);
}
return object_notes;
@@ -5413,6 +5459,7 @@ struct NotesSection {
string notenumber = to!string(m.captures[1]);
string anchor_tag = "note_" ~ notenumber;
comp_obj_endnote_.anchor_tags ~= [ endnotes_["anchor"][i] ];
+ comp_obj_endnote_.inline_links = true;
comp_obj_endnote_.text = endnote.strip;
the_endnotes_section ~= comp_obj_endnote_;
}
@@ -5772,7 +5819,7 @@ struct NodeStructureMetadata {
_comp_obj_heading_ = _comp_obj_heading_.init;
_comp_obj_heading_.use = "body";
_comp_obj_heading_.is_of = "para";
- _comp_obj_heading_.is_a = "heading"; // = is_; // check whether needed, constant???
+ _comp_obj_heading_.is_a = "heading";
_comp_obj_heading_.text = to!string(_text).strip;
_comp_obj_heading_.ocn = obj_cite_number_;
_comp_obj_heading_.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number);
@@ -5786,6 +5833,9 @@ struct NodeStructureMetadata {
_comp_obj_heading_.ptr_doc_object = cntr_;
_comp_obj_heading_.ptr_html_segnames = ((lev_markup_number == "4") ? html_segnames_ptr : 0);
_comp_obj_heading_.ptr_heading = ptr_;
+ _comp_obj_heading_.inline_notes_reg = flag_notes_reg;
+ _comp_obj_heading_.inline_notes_star = flag_notes_star;
+ _comp_obj_heading_.inline_links = flag_links;
debug(node) {
if (match(lev_markup_number, rgx.levels_numbered_headings)) {
writeln("* ", to!string(_node));
@@ -6102,12 +6152,12 @@ struct ObjGenericComposite {
string text = "";
string obj_cite_number = "";
string[] anchor_tags = [];
- string marked_up_level = "9";
- int[] closes_lev_collapsed = [];
- int[] closes_lev_markup = [];
int indent_base = 0;
int indent_hang = 0;
bool bullet = false;
+ bool inline_links = false;
+ bool inline_notes_reg = false;
+ bool inline_notes_star = false;
string syntax = "";
int ocn = 0;
string segment_anchor_tag = "";
@@ -6116,24 +6166,20 @@ struct ObjGenericComposite {
int parent_lev_markup = 0;
int parent_ocn = 0;
int[] ancestors = [];
+ string marked_up_level = "9";
int heading_lev_markup = 9;
int heading_lev_collapsed = 9;
- int[] heading_closes_lev_collapsed = [];
- int[] heading_closes_lev_markup = [];
+ int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,];
+ int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,];
string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ];
+ string[] lev4_subtoc = [];
int heading_array_ptr = 0;
int ptr_doc_object = 0;
int ptr_html_segnames = 0;
int ptr_heading = 0;
int array_ptr = 0;
int heading_array_ptr_segments = 0;
- string[] lev4_subtoc = [];
string[string][string] node;
- int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,];
- int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,];
- bool inline_links = false;
- bool inline_notes_reg = false;
- bool inline_notes_star = false;
}
#+END_SRC
diff --git a/org/defaults.org b/org/defaults.org
index 8b6a74f..616921b 100644
--- a/org/defaults.org
+++ b/org/defaults.org
@@ -568,7 +568,11 @@ static within_quotes = ctRegex!(`"(.+?)"`);
static make_heading_delimiter = ctRegex!(`[;][ ]*`);
static arr_delimiter = ctRegex!(`[ ]*[;][ ]*`);
static name_delimiter = ctRegex!(`^([^,]+)[ ]*,[ ]+(.+?)$`);
-static book_index_go = ctRegex!("([0-9]+)(?:-[0-9]+)?");
+static book_index_go = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)");
+static book_index_go_scroll = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)");
+static book_index_go_seg = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?):(?P<seg>[a-z0-9_-]+)");
+static book_index_go_seg_ = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)(:(?P<seg>[a-z0-9_-]+))?");
+static book_index_go_seg_anchorless = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)");
static trailing_comma = ctRegex!(",[ ]*$");
static trailing_linebreak = ctRegex!(",[ ]{1,2}\\\\\\\\\n[ ]{4}$","m");
static newline_eol_delimiter = ctRegex!("\n");
@@ -748,6 +752,9 @@ static inline_text_and_note_square_sp = ctRegex!(`(.+?)~\[[*+]+\
static inline_text_and_note_square = ctRegex!(`(.+?)~\[\s*(.+?)\]~`, "mg");
static inline_note_square_delimiters = ctRegex!(`(~\[\s*)(.+?)(\]~)`, "mg");
static inline_curly_delimiter_open_regular = ctRegex!(`~\{\s*`, "m");
+static inline_curly_delimiter_open_symbol_star = ctRegex!(`~\{[*]\s`, "m"); //
+static inline_curly_delimiter_open_symbol_plus = ctRegex!(`~\{[+]\s`, "m"); //
+static inline_curly_delimiter_open_star_or_plus = ctRegex!(`~\{[+*]`, "m"); //
static inline_curly_delimiter_close_regular = ctRegex!(`\s*\}~`, "m");
static inline_text_and_note_curly = ctRegex!(`(?P<text>.+?)(?:(?:[~])[{][*+ ]*)(?P<note>.+?)(?:[}][~])`, "mg");
static note_ref = ctRegex!(`^\S+?noteref_([0-9]+)`, "mg"); // {^{73.}^}#noteref_73
@@ -757,12 +764,11 @@ static note_ref = ctRegex!(`^\S+?noteref_(
#+name: ao_rgx
#+BEGIN_SRC d
-static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+)`, "mg");
-static inline_link_naked_url = ctRegex!(`(^|[ ])((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
-static inline_link_markup_regular = ctRegex!(`(^|[ ])\{\s*(.+?)\s*\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
-static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
-static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+)`, "mg");
-static inline_a_url = ctRegex!(`(┤)(\S+?)(├)`, "mg");
+static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
+static inline_link_naked_url = ctRegex!(`(?P<before>^|[ ])(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg");
+static inline_link_markup_regular = ctRegex!(`(?P<before>^|[ ])\{\s*(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg");
+static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg");
+static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
#+END_SRC
*** images :images:
diff --git a/org/sdp.org b/org/sdp.org
index 5dd7f45..2318ee7 100644
--- a/org/sdp.org
+++ b/org/sdp.org
@@ -23,7 +23,7 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 13, 3);
+enum ver = Version(0, 13, 4);
#+END_SRC
* 1. sdp (sisu document parser) :sdp:
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d
index 14b1071..7cb68e5 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -59,7 +59,6 @@ template SiSUdocAbstraction() {
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 }
/+ biblio variables +/
string biblio_tag_name, biblio_tag_entry, st;
string[] biblio_arr_json;
@@ -173,8 +172,8 @@ template SiSUdocAbstraction() {
}
}
}
- debug(dom) {
- writeln(lev, ": ", dom);
+ debug(dom_magic_numbers) {
+ writeln("marked up: ", lev, ": ", dom);
}
return dom;
}
@@ -212,8 +211,8 @@ template SiSUdocAbstraction() {
}
}
}
- debug(dom) {
- writeln(lev, ": ", dom);
+ debug(dom_magic_numbers) {
+ writeln("collapsed: ", lev, ": ", dom);
}
return dom;
}
@@ -397,7 +396,7 @@ template SiSUdocAbstraction() {
type["biblio_section"] = State.on;
type["blurb_section"] = State.off;
if (opt_action_bool["backmatter"] && opt_action_bool["section_biblio"]) {
- _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); //
+ _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json);
debug(bibliobuild) {
writeln("- ", biblio_entry_str_json);
writeln("-> ", biblio_arr_json.length);
@@ -722,10 +721,6 @@ template SiSUdocAbstraction() {
obj_cite_number = (to!int(an_object["lev_markup_number"]) == 0)
? (ocn_emit(3))
: (obj_cite_number = ocn_emit(type["ocn_status"]));
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "heading";
an_object_key="body_nugget";
auto substantive_object_and_anchor_tags_tuple =
@@ -743,6 +738,10 @@ template SiSUdocAbstraction() {
segment_anchor_tag_that_object_belongs_to = "";
segment_anchor_tag_that_object_belongs_to_uri = "";
}
+ an_object["bookindex_nugget"] =
+ ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes =
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
/+ (incrementally build toc) table of contents here! +/
_anchor_tag=to!string(obj_cite_number);
the_table_of_contents_section = obj_im.table_of_contents_gather_headings(
@@ -796,7 +795,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "para";
auto comp_obj_heading =
node_construct.node_location_emitter(
@@ -998,7 +997,6 @@ template SiSUdocAbstraction() {
bi.bookindex_build_abstraction_section(
bookindex_unordered_hashes,
obj_cite_number,
- segment_anchor_tag_that_object_belongs_to,
opt_action_bool,
);
destroy(bookindex_unordered_hashes);
@@ -1046,24 +1044,28 @@ template SiSUdocAbstraction() {
comp_obj_toc.bullet = false;
if (the_endnotes_section.length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Endnotes",
mkup.mark_internal_site_lnk,
"endnotes", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
}
if (the_glossary_section.length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffixs",
+ "{ %s }%s%s%s",
"Glossary",
mkup.mark_internal_site_lnk,
"glossary", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
toc_txt_ = format(
"{ %s }#%s",
@@ -1072,17 +1074,20 @@ template SiSUdocAbstraction() {
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
if (the_bibliography_section.length > 1){
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Bibliography",
mkup.mark_internal_site_lnk,
"bibliography", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
toc_txt_ = format(
@@ -1092,17 +1097,20 @@ template SiSUdocAbstraction() {
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
if (the_bookindex_section["seg"].length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Book Index",
mkup.mark_internal_site_lnk,
"bookindex", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
}
if (the_bookindex_section["scroll"].length > 1) {
@@ -1113,17 +1121,20 @@ template SiSUdocAbstraction() {
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
if (the_blurb_section.length > 1) {
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
"Blurb",
mkup.mark_internal_site_lnk,
"blurb", // segment_anchor_tag_that_object_belongs_to
+ ".fnSuffix",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
toc_txt_ = format(
"{ %s }#%s",
@@ -1131,6 +1142,7 @@ template SiSUdocAbstraction() {
"blurb", // _anchor_tag
);
toc_txt_= munge.url_links(toc_txt_);
+ comp_obj_toc.inline_links = true;
comp_obj_toc.text = to!string(toc_txt_).strip;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
@@ -2408,7 +2420,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "code";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2443,7 +2455,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "verse"; // check also
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2472,7 +2484,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "table";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2509,7 +2521,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "group";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2545,7 +2557,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "block";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2582,7 +2594,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "quote";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2655,7 +2667,8 @@ template SiSUdocAbstraction() {
/+ book_index flag set +/
if (auto m = match(line, rgx.book_index_close)) {
type["book_index"] = State.off;
- if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ if (opt_action_bool["backmatter"]
+ && opt_action_bool["section_bookindex"]) {
an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]);
debug(bookindexmatch) { // book index
writefln(
@@ -2666,7 +2679,8 @@ template SiSUdocAbstraction() {
}
book_idx_tmp = "";
} else {
- if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ if (opt_action_bool["backmatter"]
+ && opt_action_bool["section_bookindex"]) {
book_idx_tmp ~= line;
}
}
@@ -3075,7 +3089,7 @@ template SiSUdocAbstraction() {
n_foot_sp_asterisk = 0;
n_foot_sp_plus = 0;
}
- string url_links(Ot)(Ot obj_txt_in) {
+ string url_links(Ot)(Ot obj_txt_in, string suffix = ".html") {
debug(asserts){
static assert(is(typeof(obj_txt_in) == string));
}
@@ -3088,7 +3102,7 @@ template SiSUdocAbstraction() {
obj_txt_in,
rgx.inline_link_naked_url,
("$1"
- ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
~ "$3") // ("$1{ $2 }$2$3")
);
@@ -3103,7 +3117,7 @@ template SiSUdocAbstraction() {
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper_punctuated,
- (mkup.lnk_o ~ " $1 " ~ mkup.lnk_c
+ (mkup.lnk_o ~ "$1" ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
@@ -3113,7 +3127,7 @@ template SiSUdocAbstraction() {
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper,
- (mkup.lnk_o ~ " $1 " ~ mkup.lnk_c
+ (mkup.lnk_o ~ "$1" ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
~ mkup.url_o ~ "$2" ~ mkup.url_c
@@ -3129,7 +3143,7 @@ template SiSUdocAbstraction() {
obj_txt_in,
rgx.inline_link_markup_regular,
("$1"
- ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c
~ mkup.url_o ~ "$3" ~ mkup.url_c
~ "$4") // ("$1{ $2 }$3$4")
);
@@ -3142,8 +3156,8 @@ template SiSUdocAbstraction() {
static assert(is(typeof(obj_txt_in) == string));
}
/+ endnotes (regular) +/
- bool notes_reg = false;
- bool notes_star = false;
+ bool flg_notes_reg = false;
+ bool flg_notes_star = false;
obj_txt_in =
replaceAll(
obj_txt_in,
@@ -3164,7 +3178,7 @@ template SiSUdocAbstraction() {
stage_reset_note_numbers = false;
foreach(n; m) {
if (match(to!string(n.hit), rgx.inline_al_delimiter_open_symbol_star)) {
- notes_star = true;
+ flg_notes_star = true;
++n_foot_sp_asterisk;
asterisks_ = "*";
n_foot=n_foot_sp_asterisk;
@@ -3175,7 +3189,7 @@ template SiSUdocAbstraction() {
(mkup.en_a_o ~ replicate(asterisks_, n_foot_sp_asterisk) ~ " ")
) ~ "\n");
} else if (match(to!string(n.hit), rgx.inline_al_delimiter_open_regular)) {
- notes_reg = true;
+ flg_notes_reg = true;
++n_foot_reg;
n_foot=n_foot_reg;
obj_txt_out ~=
@@ -3194,8 +3208,8 @@ template SiSUdocAbstraction() {
}
auto t = tuple(
obj_txt_out,
- notes_reg,
- notes_star,
+ flg_notes_reg,
+ flg_notes_star,
);
return t;
}
@@ -3416,7 +3430,7 @@ template SiSUdocAbstraction() {
obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"]);
if (auto m = match(obj_txt["munge"], rgx.heading_anchor_tag)) {
anchor_tag = m.captures[1];
- anchor_tags_ ~=anchor_tag;
+ anchor_tags_ ~= anchor_tag;
} else if (obj_["lev"] == "1") {
writeln("heading anchor tag missing: ", obj_txt["munge"]);
}
@@ -3532,6 +3546,7 @@ template SiSUdocAbstraction() {
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.bullet = false;
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
} else {
indent=[
@@ -3548,6 +3563,7 @@ template SiSUdocAbstraction() {
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.bullet = false;
comp_obj_toc.text = "Table of Contents";
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
comp_obj_toc = comp_obj_toc.init;
@@ -3557,17 +3573,19 @@ template SiSUdocAbstraction() {
comp_obj_toc.ocn = 0;
comp_obj_toc.obj_cite_number = "";
comp_obj_toc.bullet = false;
+ comp_obj_toc.inline_links = true;
switch (to!int(obj_["lev_markup_number"])) {
case 0:
indent=[
"hang_position" : 0,
"base_position" : 0,
];
- toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "../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"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 1: .. case 3:
@@ -3583,14 +3601,16 @@ template SiSUdocAbstraction() {
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 4:
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix",
+ "{ %s }%s%s%s",
heading_toc_,
mkup.mark_internal_site_lnk,
segment_anchor_tag_that_object_belongs_to,
+ ".fnSuffix",
);
lev4_subtoc[segment_anchor_tag_that_object_belongs_to] = [];
toc_txt_= munge.url_links(toc_txt_);
@@ -3601,14 +3621,16 @@ template SiSUdocAbstraction() {
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 5: .. case 7:
toc_txt_ = format(
- "{ %s }%s../%s.fnSuffix#%s",
+ "{ %s }%s%s%s#%s",
heading_toc_,
mkup.mark_internal_site_lnk,
segment_anchor_tag_that_object_belongs_to,
+ ".fnSuffix",
_anchor_tag,
);
subtoc_txt_ = format(
@@ -3625,6 +3647,7 @@ template SiSUdocAbstraction() {
comp_obj_toc.indent_hang = indent["hang_position"];
comp_obj_toc.indent_base = indent["base_position"];
comp_obj_toc.text = to!string(toc_txt_).strip;
+ comp_obj_toc.inline_links = true;
the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
default:
@@ -4092,9 +4115,10 @@ template SiSUdocAbstraction() {
string[][string][string] bi;
string[][string][string] hash_nugget;
string[] bi_main_terms_split_arr;
- string[][string][string] bookindex_nugget_hash(BI,N)(
+ string[][string][string] bookindex_nugget_hash(BI,N,S)(
BI bookindex_section,
- N obj_cite_number
+ N obj_cite_number,
+ S segment_anchor_tag,
)
in {
debug(asserts){
@@ -4105,7 +4129,7 @@ template SiSUdocAbstraction() {
if (!bookindex_section.empty) {
writeln(
"* [bookindex] ",
- "[", to!string(obj_cite_number), "] ", bookindex_section
+ "[", to!string(obj_cite_number), ": ", segment_anchor_tag, "] ", bookindex_section
);
}
}
@@ -4125,10 +4149,12 @@ template SiSUdocAbstraction() {
main_term = strip(m.captures[1]);
obj_cite_number_offset = to!int(m.captures[2]);
obj_cite_number_endpoint=(obj_cite_number + obj_cite_number_offset);
- obj_cite_numbers ~= (to!string(obj_cite_number) ~ "-" ~ to!string(obj_cite_number_endpoint));
+ obj_cite_numbers ~= (to!string(obj_cite_number) ~ "-" ~ to!string(obj_cite_number_endpoint)
+ ~ ":" ~ segment_anchor_tag);
} else {
main_term = strip(bi_main_term_and_rest[0]);
- obj_cite_numbers ~= to!string(obj_cite_number);
+ obj_cite_numbers ~= to!string(obj_cite_number)
+ ~ ":" ~ segment_anchor_tag;
}
bi[main_term]["_a"] ~= obj_cite_numbers;
obj_cite_numbers=null;
@@ -4143,10 +4169,12 @@ template SiSUdocAbstraction() {
sub_term = strip(m.captures[1]);
obj_cite_number_offset = to!int(m.captures[2]);
obj_cite_number_endpoint=(obj_cite_number + obj_cite_number_offset);
- obj_cite_numbers ~= (to!string(obj_cite_number) ~ " - " ~ to!string(obj_cite_number_endpoint));
+ obj_cite_numbers ~= (to!string(obj_cite_number) ~ " - " ~ to!string(obj_cite_number_endpoint)
+ ~ ":" ~ segment_anchor_tag);
} else {
sub_term = strip(sub_terms_bits);
- obj_cite_numbers ~= to!string(obj_cite_number);
+ obj_cite_numbers ~= to!string(obj_cite_number)
+ ~ ":" ~ segment_anchor_tag;
}
if (!empty(sub_term)) {
bi[main_term][sub_term] ~= obj_cite_numbers;
@@ -4173,13 +4201,13 @@ template SiSUdocAbstraction() {
auto mainkeys=
bookindex_unordered_hashes.byKey.array.sort().release;
foreach (mainkey; mainkeys) {
- debug(bookindex) {
+ debug(bookindex1) {
writeln(mainkey);
}
auto subkeys=
bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
foreach (subkey; subkeys) {
- debug(bookindex) {
+ debug(bookindex1) {
writeln(" ", subkey);
writeln(" ", to!string(
bookindex_unordered_hashes[mainkey][subkey]
@@ -4224,16 +4252,14 @@ template SiSUdocAbstraction() {
++mkn;
}
}
- auto bookindex_build_abstraction_section(BI,N,Ta,B)(
+ auto bookindex_build_abstraction_section(BI,N,B)(
BI bookindex_unordered_hashes,
N obj_cite_number,
- Ta segment_anchor_tag_that_object_belongs_to,
B opt_action_bool,
) {
debug(asserts){
static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string]));
static assert(is(typeof(obj_cite_number) == int));
- static assert(is(typeof(segment_anchor_tag_that_object_belongs_to) == string));
static assert(is(typeof(opt_action_bool) == bool[string]));
}
mixin SiSUnode;
@@ -4251,7 +4277,8 @@ template SiSUdocAbstraction() {
auto node_para_int_ = node_metadata_para_int;
auto node_para_str_ = node_metadata_para_str;
if ((mainkeys.length > 0)
- && (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"])) {
+ && (opt_action_bool["backmatter"]
+ && opt_action_bool["section_bookindex"])) {
string bi_tmp_seg, bi_tmp_scroll;
string[] bi_tmp_tags;
comp_obj_heading_ = comp_obj_heading_.init;
@@ -4266,6 +4293,7 @@ template SiSUdocAbstraction() {
comp_obj_heading_.heading_lev_collapsed = 1;
comp_obj_heading_.parent_ocn = 1;
comp_obj_heading_.parent_lev_markup = 0;
+ comp_obj_heading.inline_links = true;
bookindex_section["scroll"] ~= comp_obj_heading_;
bookindex_section["seg"] ~= comp_obj_heading_;
++obj_cite_number;
@@ -4283,6 +4311,7 @@ template SiSUdocAbstraction() {
comp_obj_heading_.heading_lev_collapsed = 2;
comp_obj_heading_.parent_ocn = 1;
comp_obj_heading_.parent_lev_markup = 0;
+ comp_obj_heading.inline_links = false;
comp_obj_heading_.anchor_tags = ["bookindex"];
bookindex_section["scroll"] ~= comp_obj_heading_;
bookindex_section["seg"] ~= comp_obj_heading_;
@@ -4297,15 +4326,33 @@ template SiSUdocAbstraction() {
buffer.clear();
bi_tmp_tags ~= translate(mainkey, transTable);
bi_tmp_seg = "!{" ~ mainkey ~ "}! ";
+ auto bkidx_lnk_seg(string locs) {
+ string markup = "";
+ if (auto m = matchFirst(locs, rgx.book_index_go_seg)) {
+ markup =
+ munge.url_links("{ " ~ m["link"] ~ " }"
+ ~ mkup.mark_internal_site_lnk ~ m["seg"] ~ ".fnSuffix"
+ ~ "#" ~ m["ocn"] ~ ", ");
+ } else {
+ writeln(__LINE__, ": ", locs);
+ }
+ return markup;
+ }
+ auto bkidx_lnk_scroll(string locs) {
+ string markup = "";
+ if (auto m = matchFirst(locs, rgx.book_index_go)) {
+ markup =
+ munge.url_links("{ " ~ m["link"] ~ " }"
+ ~ mkup.mark_internal_site_lnk
+ ~ "#" ~ m["ocn"] ~ ", ");
+ } else {
+ writeln(__LINE__, ": ", locs);
+ }
+ return markup;
+ }
foreach (ref_; bookindex_unordered_hashes[mainkey]["_a"]) {
- auto go = replaceAll(ref_, rgx.book_index_go, "$1");
- 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_ ~ "}"
- ~ mkup.mark_internal_site_lnk ~ "../"
- ~ segment_anchor_tag_that_object_belongs_to
- ~ ".fnSuffix#" ~ go ~ ", ");
+ bi_tmp_scroll ~= bkidx_lnk_scroll(ref_);
+ bi_tmp_seg ~= bkidx_lnk_seg(ref_);
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -4318,21 +4365,15 @@ template SiSUdocAbstraction() {
bi_tmp_tags ~= translate(subkey, transTable);
bi_tmp_seg ~= subkey ~ ", ";
foreach (ref_; bookindex_unordered_hashes[mainkey][subkey]) {
- auto go = replaceAll(ref_, rgx.book_index_go, "$1");
- 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_ ~ "}"
- ~ mkup.mark_internal_site_lnk ~ "../"
- ~ segment_anchor_tag_that_object_belongs_to
- ~ ".fnSuffix#" ~ go ~ ", ");
+ bi_tmp_scroll ~= bkidx_lnk_scroll(ref_);
+ bi_tmp_seg ~= bkidx_lnk_seg(ref_);
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
++skn;
}
- bi_tmp_scroll = replaceFirst(bi_tmp_scroll, rgx.trailing_linebreak, "");
- bi_tmp_seg = replaceFirst(bi_tmp_seg, rgx.trailing_linebreak, "");
+ bi_tmp_scroll = replaceFirst(bi_tmp_scroll, rgx.trailing_linebreak, "");
+ bi_tmp_seg = replaceFirst(bi_tmp_seg, rgx.trailing_linebreak, "");
comp_obj_para = comp_obj_para.init;
comp_obj_para.use = "backmatter";
comp_obj_para.is_of = "para";
@@ -4344,6 +4385,7 @@ template SiSUdocAbstraction() {
comp_obj_para.indent_hang = 0;
comp_obj_para.indent_base = 1;
comp_obj_para.bullet = false;
+ comp_obj_para.inline_links = true;
bookindex_section["scroll"] ~= comp_obj_para;
comp_obj_para.text = to!string(bi_tmp_seg).strip;
bookindex_section["seg"] ~= comp_obj_para;
@@ -4379,9 +4421,6 @@ template SiSUdocAbstraction() {
int cntr,
)
in {
- // endnotes/ footnotes for
- // doc objects other than paragraphs & headings
- // various forms of grouped text
assert((contents_am[cntr].is_a == "para")
|| (contents_am[cntr].is_a == "heading")
|| (contents_am[cntr].is_a == "group"));
@@ -4405,20 +4444,27 @@ template SiSUdocAbstraction() {
) {
debug(endnotes_build) {
writeln(
- "{^{", m.captures[1], ".}^}" ~ mkup.mark_internal_site_lnk ~ "../", 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 ->
object_notes["anchor"] ~= "#note_" ~ m.captures[1] ~ "』";
object_notes["notes"] ~= (segment_anchor_tag_that_object_belongs_to.empty)
? (munge.url_links(
- "{^{" ~ m.captures[1] ~ ".}^}#noteref_" ~
- m.captures[1]) ~ " " ~ m.captures[2] ~ "』"
+ "{^{" ~ m.captures[1] ~ ".}^}#noteref_"
+ ~ m.captures[1]) ~ " "
+ ~ m.captures[2] ~ "』"
)
: (munge.url_links(
- "{^{" ~ m.captures[1] ~ ".}^}" ~ mkup.mark_internal_site_lnk ~ "../" ~
- segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#noteref_" ~
- m.captures[1]) ~ " " ~ m.captures[2] ~ "』"
+ "{^{" ~ m.captures[1] ~ ".}^}"
+ ~ mkup.mark_internal_site_lnk
+ ~ segment_anchor_tag_that_object_belongs_to
+ ~ ".fnSuffix#noteref_"
+ ~ m.captures[1]) ~ " "
+ ~ m.captures[2] ~ "』"
);
}
return object_notes;
@@ -4517,6 +4563,7 @@ template SiSUdocAbstraction() {
string notenumber = to!string(m.captures[1]);
string anchor_tag = "note_" ~ notenumber;
comp_obj_endnote_.anchor_tags ~= [ endnotes_["anchor"][i] ];
+ comp_obj_endnote_.inline_links = true;
comp_obj_endnote_.text = endnote.strip;
the_endnotes_section ~= comp_obj_endnote_;
}
@@ -4816,7 +4863,7 @@ template SiSUdocAbstraction() {
_comp_obj_heading_ = _comp_obj_heading_.init;
_comp_obj_heading_.use = "body";
_comp_obj_heading_.is_of = "para";
- _comp_obj_heading_.is_a = "heading"; // = is_; // check whether needed, constant???
+ _comp_obj_heading_.is_a = "heading";
_comp_obj_heading_.text = to!string(_text).strip;
_comp_obj_heading_.ocn = obj_cite_number_;
_comp_obj_heading_.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number);
@@ -4830,6 +4877,9 @@ template SiSUdocAbstraction() {
_comp_obj_heading_.ptr_doc_object = cntr_;
_comp_obj_heading_.ptr_html_segnames = ((lev_markup_number == "4") ? html_segnames_ptr : 0);
_comp_obj_heading_.ptr_heading = ptr_;
+ _comp_obj_heading_.inline_notes_reg = flag_notes_reg;
+ _comp_obj_heading_.inline_notes_star = flag_notes_star;
+ _comp_obj_heading_.inline_links = flag_links;
debug(node) {
if (match(lev_markup_number, rgx.levels_numbered_headings)) {
writeln("* ", to!string(_node));
diff --git a/src/sdp/ao_object_setter.d b/src/sdp/ao_object_setter.d
index e165d23..698c39e 100644
--- a/src/sdp/ao_object_setter.d
+++ b/src/sdp/ao_object_setter.d
@@ -22,12 +22,12 @@ template ObjectSetter() {
string text = "";
string obj_cite_number = "";
string[] anchor_tags = [];
- string marked_up_level = "9";
- int[] closes_lev_collapsed = [];
- int[] closes_lev_markup = [];
int indent_base = 0;
int indent_hang = 0;
bool bullet = false;
+ bool inline_links = false;
+ bool inline_notes_reg = false;
+ bool inline_notes_star = false;
string syntax = "";
int ocn = 0;
string segment_anchor_tag = "";
@@ -36,24 +36,20 @@ template ObjectSetter() {
int parent_lev_markup = 0;
int parent_ocn = 0;
int[] ancestors = [];
+ string marked_up_level = "9";
int heading_lev_markup = 9;
int heading_lev_collapsed = 9;
- int[] heading_closes_lev_collapsed = [];
- int[] heading_closes_lev_markup = [];
+ int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,];
+ int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,];
string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ];
+ string[] lev4_subtoc = [];
int heading_array_ptr = 0;
int ptr_doc_object = 0;
int ptr_html_segnames = 0;
int ptr_heading = 0;
int array_ptr = 0;
int heading_array_ptr_segments = 0;
- string[] lev4_subtoc = [];
string[string][string] node;
- int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,];
- int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,];
- bool inline_links = false;
- bool inline_notes_reg = false;
- bool inline_notes_star = false;
}
struct TheObjects {
ObjGenericComposite[] oca;
diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d
index 0b9f57a..6d91096 100644
--- a/src/sdp/ao_rgx.d
+++ b/src/sdp/ao_rgx.d
@@ -12,7 +12,11 @@ template SiSUrgxInit() {
static make_heading_delimiter = ctRegex!(`[;][ ]*`);
static arr_delimiter = ctRegex!(`[ ]*[;][ ]*`);
static name_delimiter = ctRegex!(`^([^,]+)[ ]*,[ ]+(.+?)$`);
- static book_index_go = ctRegex!("([0-9]+)(?:-[0-9]+)?");
+ static book_index_go = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)");
+ static book_index_go_scroll = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)");
+ static book_index_go_seg = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?):(?P<seg>[a-z0-9_-]+)");
+ static book_index_go_seg_ = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)(:(?P<seg>[a-z0-9_-]+))?");
+ static book_index_go_seg_anchorless = ctRegex!("(?P<link>(?P<ocn>[0-9]+)(?:-[0-9]+)?)");
static trailing_comma = ctRegex!(",[ ]*$");
static trailing_linebreak = ctRegex!(",[ ]{1,2}\\\\\\\\\n[ ]{4}$","m");
static newline_eol_delimiter = ctRegex!("\n");
@@ -132,15 +136,17 @@ template SiSUrgxInit() {
static inline_text_and_note_square = ctRegex!(`(.+?)~\[\s*(.+?)\]~`, "mg");
static inline_note_square_delimiters = ctRegex!(`(~\[\s*)(.+?)(\]~)`, "mg");
static inline_curly_delimiter_open_regular = ctRegex!(`~\{\s*`, "m");
+ static inline_curly_delimiter_open_symbol_star = ctRegex!(`~\{[*]\s`, "m"); //
+ static inline_curly_delimiter_open_symbol_plus = ctRegex!(`~\{[+]\s`, "m"); //
+ static inline_curly_delimiter_open_star_or_plus = ctRegex!(`~\{[+*]`, "m"); //
static inline_curly_delimiter_close_regular = ctRegex!(`\s*\}~`, "m");
static inline_text_and_note_curly = ctRegex!(`(?P<text>.+?)(?:(?:[~])[{][*+ ]*)(?P<note>.+?)(?:[}][~])`, "mg");
static note_ref = ctRegex!(`^\S+?noteref_([0-9]+)`, "mg"); // {^{73.}^}#noteref_73
- static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+)`, "mg");
- static inline_link_naked_url = ctRegex!(`(^|[ ])((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
- static inline_link_markup_regular = ctRegex!(`(^|[ ])\{\s*(.+?)\s*\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
- static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+?)([.,;:?!]?(?:[ ]|$))`, "mg");
- static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(.+?)\}((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|#)\S+)`, "mg");
- static inline_a_url = ctRegex!(`(┤)(\S+?)(├)`, "mg");
+ static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
+ static inline_link_naked_url = ctRegex!(`(?P<before>^|[ ])(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg");
+ static inline_link_markup_regular = ctRegex!(`(?P<before>^|[ ])\{\s*(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg");
+ static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg");
+ static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
static image = ctRegex!(`([a-zA-Z0-9._-]+?\.(?:png|gif|jpg))`, "mg");
/+ inline markup book index +/
static book_index = ctRegex!(`^=\{\s*(.+?)\}$`, "m");
diff --git a/views/version.txt b/views/version.txt
index 7b20281..7b826fb 100644
--- a/views/version.txt
+++ b/views/version.txt
@@ -4,4 +4,4 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 13, 3);
+enum ver = Version(0, 13, 4);