From 36d0935c9a7521a87929d676a6b657fb033c44eb Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Sep 2026 14:32:03 -0400 Subject: 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) --- src/sisudoc/outputs/io_out/odt.d | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/sisudoc/outputs/io_out/odt.d') 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"┃ + %s + + + %s + + + ┃", + _id, _mark, _mark, m["note"].strip, + ); + })(_txt, rgx.inline_notes_al_special_char_note); return _txt; } string _bullet(O)(const O obj) { -- cgit v1.2.3