aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-07-09 15:17:01 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-10-17 19:07:20 -0400
commit10d0d040b11f17e7de7498e85f0c28a698ccc663 (patch)
tree00e660458847cc41c4c63a435d3380ed22ca1149
parentharvest authors, paths (diff)
xmls, special footnotes? minor step
-rw-r--r--org/default_regex.org1
-rw-r--r--org/output_xmls.org31
-rw-r--r--src/doc_reform/meta/rgx.d1
-rw-r--r--src/doc_reform/output/rgx.d1
-rw-r--r--src/doc_reform/output/xmls.d31
5 files changed, 65 insertions, 0 deletions
diff --git a/org/default_regex.org b/org/default_regex.org
index 5ddde3f..08fa141 100644
--- a/org/default_regex.org
+++ b/org/default_regex.org
@@ -521,6 +521,7 @@ static inline_notes_al_regular = ctRegex!(`【(.+?)】`,
static inline_notes_al_gen_text = ctRegex!(`【(?P<text>.+?)】`, "m");
static inline_notes_al_gen_ref = ctRegex!(`【(?P<ref>[*+]\s+)\s*(?P<text>.+?)】`, "mg");
static inline_notes_al_regular_number_note = ctRegex!(`【(?P<num>\d+)\s+(?P<note>.+?)\s*】`, "mg");
+static inline_notes_al_special_char_note = ctRegex!(`【(?P<char>(?:[*]|[+])+)\s+(?P<note>.+?)】`, "mg");
static inline_al_delimiter_open_regular = ctRegex!(`【\s`, "m");
static inline_al_delimiter_open_symbol_star = ctRegex!(`【[*]\s`, "m");
static inline_al_delimiter_open_symbol_plus = ctRegex!(`【[+]\s`, "m");
diff --git a/org/output_xmls.org b/org/output_xmls.org
index 0777b21..e994647 100644
--- a/org/output_xmls.org
+++ b/org/output_xmls.org
@@ -573,6 +573,13 @@ string inline_notes_scroll(O,M)(
("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
);
}
+ if (obj.has.inline_notes_star) {
+ _txt = font_face(_txt);
+ _txt = _txt.replaceAll(
+ rgx.inline_notes_al_special_char_note,
+ ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
+ );
+ }
debug(markup_endnotes) {
if (_txt.match(rgx.inline_notes_al_regular_number_note)) {
writeln(__LINE__, " (missed) markup endnote: ", obj.metainfo.is_a, ": ", obj.text);
@@ -597,6 +604,30 @@ auto inline_notes_seg(O,M)(
M doc_matters,
) {
string[] _endnotes;
+ if (obj.has.inline_notes_star) {
+ _txt = font_face(_txt);
+ /+ need markup for text, and separated footnote +/
+ foreach(m; _txt.matchAll(rgx.inline_notes_al_special_char_note)) {
+ _endnotes ~= format(
+ "%s%s%s%s\n %s%s%s%s%s\n %s\n%s",
+ "<p class=\"endnote\">",
+ "<a href=\"#noteref_",
+ m.captures[1],
+ "\">",
+ "<note id=\"note_",
+ m.captures[1],
+ "\">&#160;<sup>",
+ m.captures[1],
+ ".</sup></note></a>",
+ m.captures[2],
+ "</p>"
+ );
+ }
+ _txt = _txt.replaceAll(
+ rgx.inline_notes_al_special_char_note,
+ ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
+ );
+ }
if (obj.has.inline_notes_reg) {
_txt = font_face(_txt);
/+ need markup for text, and separated footnote +/
diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d
index 949a665..4f93c06 100644
--- a/src/doc_reform/meta/rgx.d
+++ b/src/doc_reform/meta/rgx.d
@@ -252,6 +252,7 @@ static template DocReformRgxInit() {
static inline_notes_al_gen_text = ctRegex!(`【(?P<text>.+?)】`, "m");
static inline_notes_al_gen_ref = ctRegex!(`【(?P<ref>[*+]\s+)\s*(?P<text>.+?)】`, "mg");
static inline_notes_al_regular_number_note = ctRegex!(`【(?P<num>\d+)\s+(?P<note>.+?)\s*】`, "mg");
+ static inline_notes_al_special_char_note = ctRegex!(`【(?P<char>(?:[*]|[+])+)\s+(?P<note>.+?)】`, "mg");
static inline_al_delimiter_open_regular = ctRegex!(`【\s`, "m");
static inline_al_delimiter_open_symbol_star = ctRegex!(`【[*]\s`, "m");
static inline_al_delimiter_open_symbol_plus = ctRegex!(`【[+]\s`, "m");
diff --git a/src/doc_reform/output/rgx.d b/src/doc_reform/output/rgx.d
index e5689c1..c0d8bf0 100644
--- a/src/doc_reform/output/rgx.d
+++ b/src/doc_reform/output/rgx.d
@@ -56,6 +56,7 @@ static template DocReformOutputRgxInit() {
static inline_notes_al_gen_text = ctRegex!(`【(?P<text>.+?)】`, "m");
static inline_notes_al_gen_ref = ctRegex!(`【(?P<ref>[*+]\s+)\s*(?P<text>.+?)】`, "mg");
static inline_notes_al_regular_number_note = ctRegex!(`【(?P<num>\d+)\s+(?P<note>.+?)\s*】`, "mg");
+ static inline_notes_al_special_char_note = ctRegex!(`【(?P<char>(?:[*]|[+])+)\s+(?P<note>.+?)】`, "mg");
static inline_al_delimiter_open_regular = ctRegex!(`【\s`, "m");
static inline_al_delimiter_open_symbol_star = ctRegex!(`【[*]\s`, "m");
static inline_al_delimiter_open_symbol_plus = ctRegex!(`【[+]\s`, "m");
diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d
index de68d05..3bf20cc 100644
--- a/src/doc_reform/output/xmls.d
+++ b/src/doc_reform/output/xmls.d
@@ -448,6 +448,13 @@ template outputXHTMLs() {
("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
);
}
+ if (obj.has.inline_notes_star) {
+ _txt = font_face(_txt);
+ _txt = _txt.replaceAll(
+ rgx.inline_notes_al_special_char_note,
+ ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
+ );
+ }
debug(markup_endnotes) {
if (_txt.match(rgx.inline_notes_al_regular_number_note)) {
writeln(__LINE__, " (missed) markup endnote: ", obj.metainfo.is_a, ": ", obj.text);
@@ -466,6 +473,30 @@ template outputXHTMLs() {
M doc_matters,
) {
string[] _endnotes;
+ if (obj.has.inline_notes_star) {
+ _txt = font_face(_txt);
+ /+ need markup for text, and separated footnote +/
+ foreach(m; _txt.matchAll(rgx.inline_notes_al_special_char_note)) {
+ _endnotes ~= format(
+ "%s%s%s%s\n %s%s%s%s%s\n %s\n%s",
+ "<p class=\"endnote\">",
+ "<a href=\"#noteref_",
+ m.captures[1],
+ "\">",
+ "<note id=\"note_",
+ m.captures[1],
+ "\">&#160;<sup>",
+ m.captures[1],
+ ".</sup></note></a>",
+ m.captures[2],
+ "</p>"
+ );
+ }
+ _txt = _txt.replaceAll(
+ rgx.inline_notes_al_special_char_note,
+ ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
+ );
+ }
if (obj.has.inline_notes_reg) {
_txt = font_face(_txt);
/+ need markup for text, and separated footnote +/