diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2025-10-08 19:14:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2025-10-08 19:14:34 -0400 |
commit | 748c9e60ae65433f225f7ac49de7b596cc1148d3 (patch) | |
tree | 940f0882e4a05e7f4eecb7c35ff954cbf6c79211 /org/ocda_functions.org | |
parent | a text output (and skel an outline) (diff) |
text output, endnotes, add caller ocn (& some cleaning)
Diffstat (limited to 'org/ocda_functions.org')
-rw-r--r-- | org/ocda_functions.org | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/org/ocda_functions.org b/org/ocda_functions.org index cba37b9..16de3f0 100644 --- a/org/ocda_functions.org +++ b/org/ocda_functions.org @@ -4453,11 +4453,31 @@ ST_the_section build_the_blurb_section(Opt) ( 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]; } |