aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-02-10 08:24:05 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit096fb733867a947752a32b091f5ad92ec7c433cc (patch)
treee2fd946895a889880ef8e3ed5dd834635d047ccd
parentoutput, sisupod & a few switches (diff)
0.13.0 batch processing, reset values for each document (footnotes, bookindex, biblio etc.)
-rw-r--r--org/ao_doc_abstraction.org137
-rw-r--r--org/sdp.org2
-rw-r--r--src/sdp/ao_abstract_doc_source.d127
-rw-r--r--views/version.txt2
4 files changed, 190 insertions, 78 deletions
diff --git a/org/ao_doc_abstraction.org b/org/ao_doc_abstraction.org
index e4f38d3..b3f31c0 100644
--- a/org/ao_doc_abstraction.org
+++ b/org/ao_doc_abstraction.org
@@ -106,7 +106,7 @@ template SiSUdocAbstraction() {
/+ +/
<<ao_emitters_obj_inline_markup_munge>>
<<ao_emitters_obj_inline_markup>>
- <<ao_emitters_obj_inline_markup_and_anchor_tags>>
+ <<ao_emitters_obj_inline_markup_and_anchor_tags_and_misc>>
<<ao_emitters_obj_inline_markup_table_of_contents>>
<<ao_emitters_obj_inline_markup_private>>
<<ao_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags>>
@@ -142,8 +142,8 @@ template SiSUdocAbstraction() {
#+name: abs_top_imports
#+BEGIN_SRC d
import
- ao_object_setter,
ao_defaults,
+ ao_object_setter,
ao_rgx,
output_hub;
private import
@@ -191,7 +191,6 @@ string[] anchor_tags;
string anchor_tag_;
string segment_anchor_tag_that_object_belongs_to;
string segment_anchor_tag_that_object_belongs_to_uri;
-auto note_section = NotesSection();
/+ enum +/
enum State { off, on }
enum TriState { off, on, closing }
@@ -216,8 +215,8 @@ JSONValue[] bib_arr_json;
int bib_entry;
/+ counters +/
int cntr, previous_count, previous_length;
+bool reset_note_numbers=true;
int[string] line_occur;
-string[] html_segnames=["toc"];
int html_segnames_ptr=0;
int html_segnames_ptr_cntr=0;
int verse_line, heading_ptr;
@@ -395,13 +394,6 @@ int ocn_emit(int ocn_status_flag) {
/+ book index variables +/
string book_idx_tmp;
string[][string][string] bookindex_unordered_hashes;
-auto bookindex_extract_hash = BookIndexNuggetHash();
-string[][string][string] bkidx_hash(
- string bookindex_section,
- int obj_cite_number
-) {
- return bookindex_extract_hash.bookindex_nugget_hash(bookindex_section, obj_cite_number);
-}
/+ node +/
ObjGenericComposite comp_obj_heading, comp_obj_location, comp_obj_block, comp_obj_code, comp_obj_poem_ocn, comp_obj_comment;
auto node_construct = NodeStructureMetadata();
@@ -423,6 +415,8 @@ scope(exit) {
destroy(an_object);
destroy(processing);
destroy(biblio_arr_json);
+ previous_length=0;
+ reset_note_numbers=true;
}
#+END_SRC
@@ -516,7 +510,10 @@ the_table_of_contents_section = [
];
auto mkup = InlineMarkup();
auto munge = ObjInlineMarkupMunge();
+auto note_section = NotesSection();
+auto bookindex_extract_hash = BookIndexNuggetHash();
string[][string] lev4_subtoc;
+string[] html_segnames=["toc"];
#+END_SRC
** 2. _loop: process document body_ [+6] :loop:
@@ -994,6 +991,7 @@ if ((matchFirst(line, rgx.book_index))
#+name: abs_in_loop_body_not_block_obj_line_empty_blocks_flags
#+BEGIN_SRC d
_block_flag_line_empty_(
+ bookindex_extract_hash,
line,
an_object,
the_document_body_section,
@@ -1035,7 +1033,7 @@ if ((type["heading"] == State.on)
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ 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 =
@@ -1109,7 +1107,7 @@ if ((type["heading"] == State.on)
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "para";
auto comp_obj_heading =
node_construct.node_location_emitter(
@@ -1393,6 +1391,7 @@ auto bi_tuple =
segment_anchor_tag_that_object_belongs_to,
opt_action_bool,
);
+destroy(bookindex_unordered_hashes);
static assert(!isTypeTuple!(bi_tuple));
auto the_bookindex_section = bi_tuple[0];
obj_cite_number = bi_tuple[1];
@@ -2022,6 +2021,13 @@ if ((opt_action_bool["html"])
}
#+END_SRC
+*** dup
+
+#+name: abs_post
+#+BEGIN_SRC d
+auto segnames = html_segnames.dup;
+#+END_SRC
+
*** clean out structure
#+name: abs_post
@@ -2034,6 +2040,19 @@ destroy(the_glossary_section);
destroy(the_bibliography_section);
destroy(the_bookindex_section);
destroy(the_blurb_section);
+destroy(html_segnames);
+destroy(bookindex_unordered_hashes);
+destroy(an_object);
+biblio_arr_json = [];
+obj_cite_number=0;
+obj_cite_number_=0;
+html_segnames_ptr=0;
+html_segnames_ptr_cntr=0;
+content_non_header = "8";
+dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
+dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
+dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
+dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
#+END_SRC
*** [#A] _return document tuple_ :return:tuple:
@@ -2043,7 +2062,7 @@ destroy(the_blurb_section);
auto t = tuple(
document_the,
document_section_keys_sequenced,
- html_segnames,
+ segnames,
images,
);
return t;
@@ -2990,7 +3009,8 @@ void _table_block_(L,O,T)(
#+name: abs_functions_block_line_status_empty
#+BEGIN_SRC d
-void _block_flag_line_empty_(
+void _block_flag_line_empty_(B)(
+ B bookindex_extract_hash,
char[] line,
ref string[string] an_object,
ref ObjGenericComposite[] the_document_body_section,
@@ -3018,7 +3038,7 @@ void _block_flag_line_empty_(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "code";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3050,7 +3070,7 @@ void _block_flag_line_empty_(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "verse"; // check also
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3079,7 +3099,7 @@ void _block_flag_line_empty_(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "table";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3113,7 +3133,7 @@ void _block_flag_line_empty_(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "group";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3146,7 +3166,7 @@ void _block_flag_line_empty_(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "block";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3180,7 +3200,7 @@ void _block_flag_line_empty_(
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "quote";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3705,6 +3725,7 @@ struct ObjInlineMarkupMunge {
string obj_txt_out, tail, note;
auto rgx = Rgx();
auto mkup = InlineMarkup();
+ int stage_reset_note_numbers = true;
private auto initialize_note_numbers() {
n_foot = 0;
n_foot_reg = 0;
@@ -3716,14 +3737,17 @@ struct ObjInlineMarkupMunge {
static assert(is(typeof(obj_txt_in) == string));
}
/+ url matched +/
- if (auto m = matchAll(obj_txt_in, rgx.inline_url)) {
+ if (match(obj_txt_in, rgx.inline_url)) {
/+ link: naked url: http://url +/
if (match(obj_txt_in, rgx.inline_link_naked_url)) {
obj_txt_in =
replaceAll(
obj_txt_in,
rgx.inline_link_naked_url,
- ("$1" ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ "$3") // ("$1{ $2 }$2$3")
+ ("$1"
+ ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.url_o ~ "$2" ~ mkup.url_c
+ ~ "$3") // ("$1{ $2 }$2$3")
);
}
/+ link with helper for endnote including the url:
@@ -3736,13 +3760,21 @@ struct ObjInlineMarkupMunge {
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper_punctuated,
- (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 ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3")
+ (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
+ ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3")
);
obj_txt_in =
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper,
- (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 ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~")
+ (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
+ ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~")
);
}
/+ link with regular markup:
@@ -3753,13 +3785,16 @@ struct ObjInlineMarkupMunge {
replaceAll(
obj_txt_in,
rgx.inline_link_markup_regular,
- ("$1" ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c ~ mkup.url_o ~ "$3" ~ mkup.url_c ~ "$4") // ("$1{ $2 }$3$4")
+ ("$1"
+ ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.url_o ~ "$3" ~ mkup.url_c
+ ~ "$4") // ("$1{ $2 }$3$4")
);
}
}
return obj_txt_in;
}
- string footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in) { // here endnotes are marked up
+ string footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in, bool reset_note_numbers) { // here endnotes are marked up
debug(asserts){
static assert(is(typeof(obj_txt_in) == string));
}
@@ -3770,8 +3805,18 @@ struct ObjInlineMarkupMunge {
rgx.inline_notes_curly,
(mkup.en_a_o ~ " $1" ~ mkup.en_a_c)
);
+ if (!(stage_reset_note_numbers) && reset_note_numbers) {
+ stage_reset_note_numbers = true;
+ }
if (match(obj_txt_in, rgx.inline_notes_al_gen)) {
if (auto m = matchAll(obj_txt_in, rgx.inline_text_and_note_al_)) {
+ if (stage_reset_note_numbers) {
+ n_foot = 0;
+ n_foot_reg = 0;
+ n_foot_sp_asterisk = 0;
+ n_foot_sp_plus = 0;
+ }
+ stage_reset_note_numbers = false;
foreach(n; m) {
if (match(to!string(n.hit), rgx.inline_al_delimiter_open_symbol_star)) {
++n_foot_sp_asterisk;
@@ -3802,8 +3847,12 @@ struct ObjInlineMarkupMunge {
}
return obj_txt_out;
}
- private auto object_notes_(string obj_txt_in)
- in { }
+ private auto object_notes_(Ot)(Ot obj_txt_in, bool reset_note_numbers=false)
+ in {
+ debug(asserts){
+ assert(is(typeof(obj_txt_in) == string));
+ }
+ }
body {
obj_txt_out = "";
tail = "";
@@ -3820,10 +3869,10 @@ struct ObjInlineMarkupMunge {
(mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c)
);
/+ url matched +/
- if (auto m = matchAll(obj_txt_in, rgx.inline_url)) {
+ if (match(obj_txt_in, rgx.inline_url)) {
obj_txt_in = url_links(obj_txt_in);
}
- obj_txt_out = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in);
+ obj_txt_out = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers);
debug(footnotes) {
writeln(obj_txt_out, tail);
}
@@ -3856,7 +3905,7 @@ struct ObjInlineMarkupMunge {
}
return obj_txt["munge"];
}
- string heading(Ot)(Ot obj_txt_in)
+ string heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false)
in {
debug(asserts){
static assert(is(typeof(obj_txt_in) == string));
@@ -3867,7 +3916,7 @@ struct ObjInlineMarkupMunge {
obj_txt["munge"]=replaceFirst(obj_txt["munge"], rgx.heading, "");
obj_txt["munge"]=replaceFirst(obj_txt["munge"], rgx.obj_cite_number_off_all, "");
obj_txt["munge"]=strip(obj_txt["munge"]);
- obj_txt["munge"]=object_notes_(obj_txt["munge"]);
+ obj_txt["munge"]=object_notes_(obj_txt["munge"], reset_note_numbers);
debug(munge) {
writeln(__LINE__);
writeln(obj_txt_in);
@@ -3978,7 +4027,7 @@ struct ObjInlineMarkup {
****** object inline markup and anchor tags :markup:inline:
-#+name: ao_emitters_obj_inline_markup_and_anchor_tags
+#+name: ao_emitters_obj_inline_markup_and_anchor_tags_and_misc
#+BEGIN_SRC d
auto obj_inline_markup_and_anchor_tags(O,K,Ma)(
O obj_,
@@ -4010,7 +4059,8 @@ struct ObjInlineMarkup {
} else if (obj_["lev"] == "1") {
writeln("heading anchor tag missing: ", obj_txt["munge"]);
}
- obj_txt["munge"]=munge.heading(obj_txt["munge"]);
+ obj_txt["munge"]=munge.heading(obj_txt["munge"], reset_note_numbers);
+ reset_note_numbers=false;
break;
case "para":
obj_txt["munge"]=munge.para(obj_txt["munge"]);
@@ -4043,8 +4093,8 @@ struct ObjInlineMarkup {
break;
}
auto t = tuple(
- obj_txt["munge"],
- anchor_tags_,
+ obj_txt["munge"],
+ anchor_tags_,
);
anchor_tags_=[];
return t;
@@ -5047,7 +5097,10 @@ struct BookIndexReportSection {
bi_tmp_scroll ~= munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ");
bi_tmp_seg ~= (segment_anchor_tag_that_object_belongs_to.empty)
? munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ")
- : munge.url_links(" {" ~ ref_ ~ "}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", ");
+ : munge.url_links(" {" ~ ref_ ~ "}"
+ ~ mkup.mark_internal_site_lnk ~ "../"
+ ~ segment_anchor_tag_that_object_belongs_to
+ ~ ".fnSuffix#" ~ go ~ ", ");
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -5064,7 +5117,10 @@ struct BookIndexReportSection {
bi_tmp_scroll ~= munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ");
bi_tmp_seg ~= (segment_anchor_tag_that_object_belongs_to.empty)
? munge.url_links(" {" ~ ref_ ~ "}#" ~ go ~ ", ")
- : munge.url_links(" {" ~ ref_ ~ "}" ~ mkup.mark_internal_site_lnk ~ "../" ~ segment_anchor_tag_that_object_belongs_to ~ ".fnSuffix#" ~ go ~ ", ");
+ : munge.url_links(" {" ~ ref_ ~ "}"
+ ~ mkup.mark_internal_site_lnk ~ "../"
+ ~ segment_anchor_tag_that_object_belongs_to
+ ~ ".fnSuffix#" ~ go ~ ", ");
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -5326,6 +5382,8 @@ struct Bibliography {
body {
JSONValue[] biblio_unsorted =
_biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json);
+ biblio_arr_json = [];
+ biblio_unsorted_incomplete = [];
JSONValue[] biblio_sorted__ = biblio_sort(biblio_unsorted);
biblio_debug(biblio_sorted__);
debug(biblio0) {
@@ -5380,6 +5438,7 @@ struct Bibliography {
}
JSONValue[] biblio_unsorted_array_of_json_objects =
bib_arr_json.dup;
+ destroy(bib_arr_json);
return biblio_unsorted_array_of_json_objects;
}
#+END_SRC
diff --git a/org/sdp.org b/org/sdp.org
index 658c0b9..032709f 100644
--- a/org/sdp.org
+++ b/org/sdp.org
@@ -23,7 +23,7 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 12, 2);
+enum ver = Version(0, 13, 0);
#+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 119a718..a0dccbe 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -6,8 +6,8 @@
template SiSUdocAbstraction() {
/+ ↓ abstraction imports +/
import
- ao_object_setter,
ao_defaults,
+ ao_object_setter,
ao_rgx,
output_hub;
private import
@@ -44,7 +44,6 @@ template SiSUdocAbstraction() {
string anchor_tag_;
string segment_anchor_tag_that_object_belongs_to;
string segment_anchor_tag_that_object_belongs_to_uri;
- auto note_section = NotesSection();
/+ enum +/
enum State { off, on }
enum TriState { off, on, closing }
@@ -69,8 +68,8 @@ template SiSUdocAbstraction() {
int bib_entry;
/+ counters +/
int cntr, previous_count, previous_length;
+ bool reset_note_numbers=true;
int[string] line_occur;
- string[] html_segnames=["toc"];
int html_segnames_ptr=0;
int html_segnames_ptr_cntr=0;
int verse_line, heading_ptr;
@@ -224,13 +223,6 @@ template SiSUdocAbstraction() {
/+ book index variables +/
string book_idx_tmp;
string[][string][string] bookindex_unordered_hashes;
- auto bookindex_extract_hash = BookIndexNuggetHash();
- string[][string][string] bkidx_hash(
- string bookindex_section,
- int obj_cite_number
- ) {
- return bookindex_extract_hash.bookindex_nugget_hash(bookindex_section, obj_cite_number);
- }
/+ node +/
ObjGenericComposite comp_obj_heading, comp_obj_location, comp_obj_block, comp_obj_code, comp_obj_poem_ocn, comp_obj_comment;
auto node_construct = NodeStructureMetadata();
@@ -261,6 +253,8 @@ template SiSUdocAbstraction() {
destroy(an_object);
destroy(processing);
destroy(biblio_arr_json);
+ previous_length=0;
+ reset_note_numbers=true;
}
mixin SiSUrgxInitFlags;
mixin SiSUnode;
@@ -348,7 +342,10 @@ template SiSUdocAbstraction() {
];
auto mkup = InlineMarkup();
auto munge = ObjInlineMarkupMunge();
+ auto note_section = NotesSection();
+ auto bookindex_extract_hash = BookIndexNuggetHash();
string[][string] lev4_subtoc;
+ string[] html_segnames=["toc"];
/+ abstraction init ↑ +/
/+ ↓ loop markup document/text line by line +/
srcDocLoop:
@@ -696,6 +693,7 @@ template SiSUdocAbstraction() {
} else if (type["blocks"] == TriState.closing) {
/+ line empty, with blocks flag +/
_block_flag_line_empty_(
+ bookindex_extract_hash,
line,
an_object,
the_document_body_section,
@@ -726,7 +724,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ 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 =
@@ -794,7 +792,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "para";
auto comp_obj_heading =
node_construct.node_location_emitter(
@@ -996,6 +994,7 @@ template SiSUdocAbstraction() {
segment_anchor_tag_that_object_belongs_to,
opt_action_bool,
);
+ destroy(bookindex_unordered_hashes);
static assert(!isTypeTuple!(bi_tuple));
auto the_bookindex_section = bi_tuple[0];
obj_cite_number = bi_tuple[1];
@@ -1552,6 +1551,7 @@ template SiSUdocAbstraction() {
document_section_keys_sequenced["seg"] ~= "tail";
document_section_keys_sequenced["scroll"] ~= "tail";
}
+ auto segnames = html_segnames.dup;
destroy(the_document_head_section);
destroy(the_table_of_contents_section);
destroy(the_document_body_section);
@@ -1560,10 +1560,23 @@ template SiSUdocAbstraction() {
destroy(the_bibliography_section);
destroy(the_bookindex_section);
destroy(the_blurb_section);
+ destroy(html_segnames);
+ destroy(bookindex_unordered_hashes);
+ destroy(an_object);
+ biblio_arr_json = [];
+ obj_cite_number=0;
+ obj_cite_number_=0;
+ html_segnames_ptr=0;
+ html_segnames_ptr_cntr=0;
+ content_non_header = "8";
+ dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
+ dom_markedup_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
+ dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
+ dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
auto t = tuple(
document_the,
document_section_keys_sequenced,
- html_segnames,
+ segnames,
images,
);
return t;
@@ -2347,7 +2360,8 @@ template SiSUdocAbstraction() {
}
}
}
- void _block_flag_line_empty_(
+ void _block_flag_line_empty_(B)(
+ B bookindex_extract_hash,
char[] line,
ref string[string] an_object,
ref ObjGenericComposite[] the_document_body_section,
@@ -2375,7 +2389,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "code";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2407,7 +2421,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "verse"; // check also
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2436,7 +2450,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "table";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2470,7 +2484,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "group";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2503,7 +2517,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "block";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -2537,7 +2551,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
- bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
+ bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "quote";
auto comp_obj_location =
node_construct.node_location_emitter(
@@ -3020,6 +3034,7 @@ template SiSUdocAbstraction() {
string obj_txt_out, tail, note;
auto rgx = Rgx();
auto mkup = InlineMarkup();
+ int stage_reset_note_numbers = true;
private auto initialize_note_numbers() {
n_foot = 0;
n_foot_reg = 0;
@@ -3031,14 +3046,17 @@ template SiSUdocAbstraction() {
static assert(is(typeof(obj_txt_in) == string));
}
/+ url matched +/
- if (auto m = matchAll(obj_txt_in, rgx.inline_url)) {
+ if (match(obj_txt_in, rgx.inline_url)) {
/+ link: naked url: http://url +/
if (match(obj_txt_in, rgx.inline_link_naked_url)) {
obj_txt_in =
replaceAll(
obj_txt_in,
rgx.inline_link_naked_url,
- ("$1" ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ "$3") // ("$1{ $2 }$2$3")
+ ("$1"
+ ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.url_o ~ "$2" ~ mkup.url_c
+ ~ "$3") // ("$1{ $2 }$2$3")
);
}
/+ link with helper for endnote including the url:
@@ -3051,13 +3069,21 @@ template SiSUdocAbstraction() {
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper_punctuated,
- (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 ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3")
+ (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
+ ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3")
);
obj_txt_in =
replaceAll(
obj_txt_in,
rgx.inline_link_endnote_url_helper,
- (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 ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~")
+ (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
+ ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~")
);
}
/+ link with regular markup:
@@ -3068,13 +3094,16 @@ template SiSUdocAbstraction() {
replaceAll(
obj_txt_in,
rgx.inline_link_markup_regular,
- ("$1" ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c ~ mkup.url_o ~ "$3" ~ mkup.url_c ~ "$4") // ("$1{ $2 }$3$4")
+ ("$1"
+ ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c
+ ~ mkup.url_o ~ "$3" ~ mkup.url_c
+ ~ "$4") // ("$1{ $2 }$3$4")
);
}
}
return obj_txt_in;
}
- string footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in) { // here endnotes are marked up
+ string footnotes_endnotes_markup_and_number_or_stars(Ot)(Ot obj_txt_in, bool reset_note_numbers) { // here endnotes are marked up
debug(asserts){
static assert(is(typeof(obj_txt_in) == string));
}
@@ -3085,8 +3114,18 @@ template SiSUdocAbstraction() {
rgx.inline_notes_curly,
(mkup.en_a_o ~ " $1" ~ mkup.en_a_c)
);
+ if (!(stage_reset_note_numbers) && reset_note_numbers) {
+ stage_reset_note_numbers = true;
+ }
if (match(obj_txt_in, rgx.inline_notes_al_gen)) {
if (auto m = matchAll(obj_txt_in, rgx.inline_text_and_note_al_)) {
+ if (stage_reset_note_numbers) {
+ n_foot = 0;
+ n_foot_reg = 0;
+ n_foot_sp_asterisk = 0;
+ n_foot_sp_plus = 0;
+ }
+ stage_reset_note_numbers = false;
foreach(n; m) {
if (match(to!string(n.hit), rgx.inline_al_delimiter_open_symbol_star)) {
++n_foot_sp_asterisk;
@@ -3117,8 +3156,12 @@ template SiSUdocAbstraction() {
}
return obj_txt_out;
}
- private auto object_notes_(string obj_txt_in)
- in { }
+ private auto object_notes_(Ot)(Ot obj_txt_in, bool reset_note_numbers=false)
+ in {
+ debug(asserts){
+ assert(is(typeof(obj_txt_in) == string));
+ }
+ }
body {
obj_txt_out = "";
tail = "";
@@ -3135,10 +3178,10 @@ template SiSUdocAbstraction() {
(mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c)
);
/+ url matched +/
- if (auto m = matchAll(obj_txt_in, rgx.inline_url)) {
+ if (match(obj_txt_in, rgx.inline_url)) {
obj_txt_in = url_links(obj_txt_in);
}
- obj_txt_out = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in);
+ obj_txt_out = footnotes_endnotes_markup_and_number_or_stars(obj_txt_in, reset_note_numbers);
debug(footnotes) {
writeln(obj_txt_out, tail);
}
@@ -3171,7 +3214,7 @@ template SiSUdocAbstraction() {
}
return obj_txt["munge"];
}
- string heading(Ot)(Ot obj_txt_in)
+ string heading(Ot)(Ot obj_txt_in, bool reset_note_numbers=false)
in {
debug(asserts){
static assert(is(typeof(obj_txt_in) == string));
@@ -3182,7 +3225,7 @@ template SiSUdocAbstraction() {
obj_txt["munge"]=replaceFirst(obj_txt["munge"], rgx.heading, "");
obj_txt["munge"]=replaceFirst(obj_txt["munge"], rgx.obj_cite_number_off_all, "");
obj_txt["munge"]=strip(obj_txt["munge"]);
- obj_txt["munge"]=object_notes_(obj_txt["munge"]);
+ obj_txt["munge"]=object_notes_(obj_txt["munge"], reset_note_numbers);
debug(munge) {
writeln(__LINE__);
writeln(obj_txt_in);
@@ -3312,7 +3355,8 @@ template SiSUdocAbstraction() {
} else if (obj_["lev"] == "1") {
writeln("heading anchor tag missing: ", obj_txt["munge"]);
}
- obj_txt["munge"]=munge.heading(obj_txt["munge"]);
+ obj_txt["munge"]=munge.heading(obj_txt["munge"], reset_note_numbers);
+ reset_note_numbers=false;
break;
case "para":
obj_txt["munge"]=munge.para(obj_txt["munge"]);
@@ -3345,8 +3389,8 @@ template SiSUdocAbstraction() {
break;
}
auto t = tuple(
- obj_txt["munge"],
- anchor_tags_,
+ obj_txt["munge"],
+ anchor_tags_,
);
anchor_tags_=[];
return t;
@@ -4186,7 +4230,10 @@ template SiSUdocAbstraction() {
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 ~ ", ");
+ : munge.url_links(" {" ~ ref_ ~ "}"
+ ~ mkup.mark_internal_site_lnk ~ "../"
+ ~ segment_anchor_tag_that_object_belongs_to
+ ~ ".fnSuffix#" ~ go ~ ", ");
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -4203,7 +4250,10 @@ template SiSUdocAbstraction() {
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 ~ ", ");
+ : munge.url_links(" {" ~ ref_ ~ "}"
+ ~ mkup.mark_internal_site_lnk ~ "../"
+ ~ segment_anchor_tag_that_object_belongs_to
+ ~ ".fnSuffix#" ~ go ~ ", ");
}
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
@@ -4418,6 +4468,8 @@ template SiSUdocAbstraction() {
body {
JSONValue[] biblio_unsorted =
_biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json);
+ biblio_arr_json = [];
+ biblio_unsorted_incomplete = [];
JSONValue[] biblio_sorted__ = biblio_sort(biblio_unsorted);
biblio_debug(biblio_sorted__);
debug(biblio0) {
@@ -4466,6 +4518,7 @@ template SiSUdocAbstraction() {
}
JSONValue[] biblio_unsorted_array_of_json_objects =
bib_arr_json.dup;
+ destroy(bib_arr_json);
return biblio_unsorted_array_of_json_objects;
}
final private JSONValue[] biblio_sort(BJ)(BJ biblio_unordered) {
diff --git a/views/version.txt b/views/version.txt
index 7ab514d..fd3b654 100644
--- a/views/version.txt
+++ b/views/version.txt
@@ -4,4 +4,4 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 12, 2);
+enum ver = Version(0, 13, 0);