aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/ocda/meta/metadoc_from_src_functions.d')
-rw-r--r--src/sisudoc/ocda/meta/metadoc_from_src_functions.d39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
index c5a63cd..922f389 100644
--- a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
+++ b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
@@ -2340,7 +2340,7 @@ template docAbstractionFunctions() {
// ↓ - object inline munge
static struct ObjInlineMarkupMunge {
string[string] obj_txt;
- int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus;
+ int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus, n_foot_ed_asterisk, n_foot_ed_plus;
string asterisks_, plus_;
string obj_txt_out, tail, note;
static auto rgx = RgxI();
@@ -2351,6 +2351,8 @@ template docAbstractionFunctions() {
n_foot_reg = 0;
n_foot_sp_asterisk = 0;
n_foot_sp_plus = 0;
+ n_foot_ed_asterisk = 0;
+ n_foot_ed_plus = 0;
}
static auto images()(string obj_txt_in) {
static auto mng = InlineMarkup();
@@ -2381,13 +2383,13 @@ template docAbstractionFunctions() {
bool flg_notes_reg = false;
bool flg_notes_star = false;
bool flg_notes_plus = false;
+ if (!(stage_reset_note_numbers) && reset_note_numbers) {
+ stage_reset_note_numbers = true;
+ }
obj_txt_in = obj_txt_in.replaceAll(
rgx.inline_notes_curly,
(mkup.en_a_o ~ " $1" ~ mkup.en_a_c)
);
- if (!(stage_reset_note_numbers) && reset_note_numbers) {
- stage_reset_note_numbers = true;
- }
obj_txt_out = "";
if (obj_txt_in.match(rgx.inline_notes_al_gen)) {
string[] _tmp_txt;
@@ -2398,6 +2400,8 @@ template docAbstractionFunctions() {
n_foot_reg = 0;
n_foot_sp_asterisk = 0;
n_foot_sp_plus = 0;
+ n_foot_ed_asterisk = 0;
+ n_foot_ed_plus = 0;
}
stage_reset_note_numbers = false;
foreach(n; m) {
@@ -2439,6 +2443,33 @@ template docAbstractionFunctions() {
} else {
obj_txt_out = obj_txt_in;
}
+ /+ ↓ editor's notes: ~[* note ]~ and ~[+ note ]~, and a bare ~[ note ]~,
+ which joins the asterisk series as it did in sisu. Each series is
+ numbered through the document, apart from the author's notes:
+ *1, *2 ... and +1, +2 ...
+ .
+ Placed after the author's notes rather than before, so that the reset
+ above, made once per document at its first note, has happened by the
+ time these are counted.
+ +/
+ if (obj_txt_out.match(rgx.inline_notes_square)) {
+ if (stage_reset_note_numbers) {
+ n_foot = 0;
+ n_foot_reg = 0;
+ n_foot_sp_asterisk = 0;
+ n_foot_sp_plus = 0;
+ n_foot_ed_asterisk = 0;
+ n_foot_ed_plus = 0;
+ stage_reset_note_numbers = false;
+ }
+ obj_txt_out = replaceAll!((m) {
+ string _series = (m["series"] == "+") ? "+" : "*";
+ int _n = (_series == "+") ? ++n_foot_ed_plus : ++n_foot_ed_asterisk;
+ if (_series == "+") { flg_notes_plus = true; }
+ return mkup.en_a_o ~ _series ~ _n.to!string ~ " " ~ m["note"] ~ mkup.en_a_c;
+ })(obj_txt_out, rgx.inline_notes_square);
+ flg_notes_star = true;
+ }
ST_txtPlusHasFootnotes ret;
{
ret.obj_txt = obj_txt_out;