aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs/io_out/odt.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-30 14:32:03 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-30 22:31:56 -0400
commit36d0935c9a7521a87929d676a6b657fb033c44eb (patch)
treeacb1e27aa0a95691419e2b05f5623fbd4f1aac61 /src/sisudoc/outputs/io_out/odt.d
parentunused function removed (diff)
notes: editor's notes, ~[* ]~ & ~[+ ]~, as series
The markup documents ~[* note ]~ and ~[+ note ]~ as editor's notes, each a separately numbered series, and a bare ~[ note ]~ which sisu put in the asterisk series. They are included as notes. Each series is numbered through the document, *1, *2 ... and +1, +2 ..., apart from the author's notes. (assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/outputs/io_out/odt.d')
-rw-r--r--src/sisudoc/outputs/io_out/odt.d21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sisudoc/outputs/io_out/odt.d b/src/sisudoc/outputs/io_out/odt.d
index 40d760d..d8f6c2f 100644
--- a/src/sisudoc/outputs/io_out/odt.d
+++ b/src/sisudoc/outputs/io_out/odt.d
@@ -107,6 +107,8 @@ template formatODT() {
return _on;
}
string _footnotes()(string _txt) {
+ import std.array : replace;
+ import std.regex : replaceAll;
static auto rgx = RgxO();
static auto rgx_xhtml = RgxXHTML();
_txt = _txt.replaceAll(
@@ -124,6 +126,25 @@ template formatODT() {
"$1", "$1", "$2",
)
);
+ /+ ↓ a note of a special series (*, *1, +1 ...): the same footnote, carrying
+ its mark as the citation's label, since odf numbers a note itself unless
+ instructed otherwise. The id takes the mark spelled in letters, "*" and
+ "+" having no place in one.
+ +/
+ _txt = replaceAll!((m) {
+ string _mark = m["char"];
+ string _id = _mark.replace("*", "a").replace("+", "p");
+ return format(q"┃<text:note text:id="ftn_%s" text:note-class="footnote">
+ <text:note-citation text:label="%s">%s</text:note-citation>
+ <text:note-body>
+ <text:p text:style-name="Footnote">
+ %s
+ </text:p>
+ </text:note-body>
+ </text:note>┃",
+ _id, _mark, _mark, m["note"].strip,
+ );
+ })(_txt, rgx.inline_notes_al_special_char_note);
return _txt;
}
string _bullet(O)(const O obj) {