aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2020-04-24 23:36:46 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2020-05-20 11:27:26 -0400
commitef2135e4fe16604b40956a2c345cdc0ae467b65c (patch)
treec14dcacf4608d23eb5a7afd622c1e1af4b648ab6
parentfootnote/endnote fix (diff)
xmls, sqlite more with footnotes/endnotes
-rw-r--r--org/out_cgi_search_sqlite.org9
-rw-r--r--org/out_sqlite.org70
-rw-r--r--org/out_xmls_css.org18
-rw-r--r--src/doc_reform/io_out/cgi_sqlite_search_form.d9
-rw-r--r--src/doc_reform/io_out/sqlite.d64
-rw-r--r--src/doc_reform/io_out/xmls_css.d54
6 files changed, 42 insertions, 182 deletions
diff --git a/org/out_cgi_search_sqlite.org b/org/out_cgi_search_sqlite.org
index ec1878f..f9b90d0 100644
--- a/org/out_cgi_search_sqlite.org
+++ b/org/out_cgi_search_sqlite.org
@@ -1362,13 +1362,8 @@ string show_matched_objects (string fn) {
line-height : 120%%%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%%%;
- line-height : 120%%%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
diff --git a/org/out_sqlite.org b/org/out_sqlite.org
index 77172e2..a35bcf1 100644
--- a/org/out_sqlite.org
+++ b/org/out_sqlite.org
@@ -510,15 +510,6 @@ string munge_html(M,O)(
string _notes;
string _urls;
string _txt = _html_font_face(_html_special_characters(obj.text));
- if (_txt.matchFirst(rgx.inline_notes_al_gen)) {
- foreach (m; _txt.matchAll(rgx.inline_notes_al_gen_text)) {
- _notes ~= "\n" ~ m["text"];
- }
- _txt = _txt.replaceAll(rgx.inline_notes_al_gen_ref, "<sup>$1</sup> ");
- }
- if (_notes.length > 0) {
- _txt ~= _notes;
- }
{ /+ debug +/
if (doc_matters.opt.action.debug_do
&& doc_matters.opt.action.verbose) {
@@ -732,11 +723,17 @@ string inline_notes_scroll(M,O)(
string _txt,
) {
if (obj.has.inline_notes_reg) {
- // _txt = font_face(_txt);
- _txt = _txt.replaceAll(
- rgx.inline_notes_al_regular_number_note,
- ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
- );
+ string[] _endnotes;
+ foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_note)) {
+ _endnotes ~= "<p class=\"endnote\">"
+ ~ "<sup>" ~ m.captures["num"] ~ ".</sup>"
+ ~ m.captures["note"]
+ ~ "</p>";
+ }
+ _txt = replaceAll!(m =>
+ ("&#160;" ~ "<sup>" ~ m["num"] ~ "</sup>"))
+ (_txt, rgx.inline_notes_al_regular_number_note)
+ ~ _endnotes.join("\n");
}
debug(markup_endnotes) {
if (_txt.match(rgx.inline_notes_al_regular_number_note)) {
@@ -752,51 +749,6 @@ string inline_notes_scroll(M,O)(
}
#+END_SRC
-******** seg
-
-#+NAME: sanitize_and_munge_inline_html
-#+BEGIN_SRC d
-Tuple!(string, string[]) inline_notes_seg(M,O)(
- M doc_matters,
- const O obj,
- string _txt,
-) {
- string[] _endnotes;
- if (obj.has.inline_notes_reg) {
- /+ need markup for text, and separated footnote +/
- foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_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_regular_number_note,
- ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
- );
- } else if (_txt.match(rgx.inline_notes_al_regular_number_note)) {
- debug(markup) {
- writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text);
- }
- }
- Tuple!(string, string[]) t = tuple(
- _txt,
- _endnotes,
- );
- return t;
-}
-#+END_SRC
-
******* inline markup
#+NAME: sanitize_and_munge_inline_html
diff --git a/org/out_xmls_css.org b/org/out_xmls_css.org
index 7e5ed46..fa06ebf 100644
--- a/org/out_xmls_css.org
+++ b/org/out_xmls_css.org
@@ -408,13 +408,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
@@ -1327,13 +1322,8 @@ Consider what if anything should be used here
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
diff --git a/src/doc_reform/io_out/cgi_sqlite_search_form.d b/src/doc_reform/io_out/cgi_sqlite_search_form.d
index 9349096..cfd1b4d 100644
--- a/src/doc_reform/io_out/cgi_sqlite_search_form.d
+++ b/src/doc_reform/io_out/cgi_sqlite_search_form.d
@@ -1043,13 +1043,8 @@ void cgi_function_intro(Cgi cgi) {
line-height : 120%%%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%%%;
- line-height : 120%%%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d
index 1b010d2..d4fac70 100644
--- a/src/doc_reform/io_out/sqlite.d
+++ b/src/doc_reform/io_out/sqlite.d
@@ -203,15 +203,6 @@ template SQLiteFormatAndLoadObject() {
string _notes;
string _urls;
string _txt = _html_font_face(_html_special_characters(obj.text));
- if (_txt.matchFirst(rgx.inline_notes_al_gen)) {
- foreach (m; _txt.matchAll(rgx.inline_notes_al_gen_text)) {
- _notes ~= "\n" ~ m["text"];
- }
- _txt = _txt.replaceAll(rgx.inline_notes_al_gen_ref, "<sup>$1</sup> ");
- }
- if (_notes.length > 0) {
- _txt ~= _notes;
- }
{ /+ debug +/
if (doc_matters.opt.action.debug_do
&& doc_matters.opt.action.verbose) {
@@ -386,11 +377,17 @@ template SQLiteFormatAndLoadObject() {
string _txt,
) {
if (obj.has.inline_notes_reg) {
- // _txt = font_face(_txt);
- _txt = _txt.replaceAll(
- rgx.inline_notes_al_regular_number_note,
- ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
- );
+ string[] _endnotes;
+ foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_note)) {
+ _endnotes ~= "<p class=\"endnote\">"
+ ~ "<sup>" ~ m.captures["num"] ~ ".</sup>"
+ ~ m.captures["note"]
+ ~ "</p>";
+ }
+ _txt = replaceAll!(m =>
+ ("&#160;" ~ "<sup>" ~ m["num"] ~ "</sup>"))
+ (_txt, rgx.inline_notes_al_regular_number_note)
+ ~ _endnotes.join("\n");
}
debug(markup_endnotes) {
if (_txt.match(rgx.inline_notes_al_regular_number_note)) {
@@ -404,45 +401,6 @@ template SQLiteFormatAndLoadObject() {
}
return _txt;
}
- Tuple!(string, string[]) inline_notes_seg(M,O)(
- M doc_matters,
- const O obj,
- string _txt,
- ) {
- string[] _endnotes;
- if (obj.has.inline_notes_reg) {
- /+ need markup for text, and separated footnote +/
- foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_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_regular_number_note,
- ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
- );
- } else if (_txt.match(rgx.inline_notes_al_regular_number_note)) {
- debug(markup) {
- writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text);
- }
- }
- Tuple!(string, string[]) t = tuple(
- _txt,
- _endnotes,
- );
- return t;
- }
string xml_type="seg"; /+ set html document type to be linked to here (seg|scroll) +/
string inline_markup(M,O)(
M doc_matters,
diff --git a/src/doc_reform/io_out/xmls_css.d b/src/doc_reform/io_out/xmls_css.d
index e882b4d..69c68ad 100644
--- a/src/doc_reform/io_out/xmls_css.d
+++ b/src/doc_reform/io_out/xmls_css.d
@@ -688,13 +688,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
@@ -1401,13 +1396,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
@@ -2115,13 +2105,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
@@ -2754,13 +2739,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
@@ -3394,13 +3374,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;
@@ -3923,13 +3898,8 @@ template spineCss() {
line-height : 120%%;
text-align : left;
margin-right : 15mm;
- }
- p.endnote_indent {
- font-size : 96%%;
- line-height : 120%%;
- text-align : left;
- margin-left : 2em;
- margin-right : 15mm;
+ padding-left : 1em;
+ text-indent : -1em;
}
p.center {
text-align : center;