aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/meta/metadoc_from_src_functions.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/meta/metadoc_from_src_functions.d')
-rw-r--r--src/sisudoc/meta/metadoc_from_src_functions.d37
1 files changed, 29 insertions, 8 deletions
diff --git a/src/sisudoc/meta/metadoc_from_src_functions.d b/src/sisudoc/meta/metadoc_from_src_functions.d
index 3ae10d1..63143e9 100644
--- a/src/sisudoc/meta/metadoc_from_src_functions.d
+++ b/src/sisudoc/meta/metadoc_from_src_functions.d
@@ -2557,10 +2557,8 @@ template docAbstractionFunctions() {
CMM conf_make_meta,
Flag!"_new_doc" _new_doc
) {
- obj_txt["munge"] = obj_[obj_key_].dup;
- obj_txt["munge"] = (obj_["is"].match(ctRegex!(`verse|code`)))
- ? obj_txt["munge"]
- : obj_txt["munge"].strip;
+ obj_txt["munge"] = obj_[obj_key_].dup;
+ obj_txt["munge"] = (obj_["is"].match(ctRegex!(`verse|code`))) ? obj_txt["munge"] : obj_txt["munge"].strip;
if (_new_doc) {
anchor_tag = "";
}
@@ -2579,8 +2577,8 @@ template docAbstractionFunctions() {
|| (obj_["is"] == "group")
|| (obj_["is"] == "block")
|| (obj_["is"] == "verse")) {
- obj_txt["munge"] = (obj_txt["munge"]).inline_markup_faces;
- obj_txt["munge"] = (obj_txt["munge"]).links_and_images;
+ obj_txt["munge"] = (obj_txt["munge"]).inline_markup_faces;
+ obj_txt["munge"] = (obj_txt["munge"]).links_and_images;
}
switch (obj_["is"]) {
case "heading":
@@ -3299,8 +3297,8 @@ template docAbstractionFunctions() {
// ↓ - endnotes
struct NotesSection {
string[string] object_notes;
- int previous_count;
- int mkn;
+ int previous_count;
+ int mkn;
static auto rgx = RgxI();
private auto gather_notes_for_endnote_section(
ObjGenericComposite[] contents_am,
@@ -4235,11 +4233,31 @@ template docAbstractionFunctions() {
int html_segnames_ptr_cntr,
int html_segnames_ptr,
) {
+ string[string][string] notes_;
+ if (the_document_body_section.length > 1) {
+ string _notes;
+ foreach (ref obj; the_document_body_section) {
+ if (obj.has.inline_notes_reg) {
+ if ((obj.text).matchFirst(rgx.inline_notes_al_gen)) {
+ foreach (m; (obj.text).matchAll(rgx.inline_notes_al_regular_number_note)) {
+ _notes ~= "\n\n" ~ m["num"] ~ ". " ~ m["note"];
+ notes_[(m["num"])]["ocn"] = obj.metainfo.ocn.to!string;
+ }
+ }
+ }
+ }
+ }
if (the_document_endnotes_section.length > 1) {
segnames["html"] ~= "endnotes";
segnames["epub"] ~= "endnotes";
html_segnames_ptr = html_segnames_ptr_cntr;
foreach (ref obj; the_document_endnotes_section) {
+ auto matches = (obj.text).matchAll(rgx.endnote_section_note);
+ foreach (m; matches) {
+ obj.metainfo.parent_ocn = notes_[(m["notenumber"])]["ocn"].to!int;
+ }
+ }
+ foreach (ref obj; the_document_endnotes_section) {
if (obj.metainfo.is_a == "heading") {
obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup];
}
@@ -5406,6 +5424,9 @@ template docSectKeysSeq() {
string[] latex() {
return document_section_keys_sequenced["latex"];
}
+ string[] text() {
+ return document_section_keys_sequenced["text"];
+ }
}
return doc_sect_keys_seq();
}