aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/meta/metadoc_from_src_functions.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2025-10-08 19:14:19 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2025-10-08 19:14:34 -0400
commit748c9e60ae65433f225f7ac49de7b596cc1148d3 (patch)
tree940f0882e4a05e7f4eecb7c35ff954cbf6c79211 /src/sisudoc/meta/metadoc_from_src_functions.d
parenta text output (and skel an outline) (diff)
text output, endnotes, add caller ocn (& some cleaning)
Diffstat (limited to 'src/sisudoc/meta/metadoc_from_src_functions.d')
-rw-r--r--src/sisudoc/meta/metadoc_from_src_functions.d20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sisudoc/meta/metadoc_from_src_functions.d b/src/sisudoc/meta/metadoc_from_src_functions.d
index 6718e82..53e494b 100644
--- a/src/sisudoc/meta/metadoc_from_src_functions.d
+++ b/src/sisudoc/meta/metadoc_from_src_functions.d
@@ -4233,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"] ~ " ≫" ~ obj.metainfo.ocn.to!string;
+ 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.text = m.hit ~ " ≫" ~ notes_[(m["notenumber"])]["ocn"];
+ }
+ }
+ 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];
}