From ef2135e4fe16604b40956a2c345cdc0ae467b65c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 24 Apr 2020 23:36:46 -0400 Subject: xmls, sqlite more with footnotes/endnotes --- src/doc_reform/io_out/cgi_sqlite_search_form.d | 9 +--- src/doc_reform/io_out/sqlite.d | 64 +++++--------------------- src/doc_reform/io_out/xmls_css.d | 54 +++++----------------- 3 files changed, 25 insertions(+), 102 deletions(-) (limited to 'src/doc_reform') 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, "$1 "); - } - 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, - (" $1 ") - ); + string[] _endnotes; + foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_note)) { + _endnotes ~= "

" + ~ "" ~ m.captures["num"] ~ "." + ~ m.captures["note"] + ~ "

"; + } + _txt = replaceAll!(m => + (" " ~ "" ~ m["num"] ~ "")) + (_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", - "

", - "", - " ", - m.captures[1], - ".", - m.captures[2], - "

" - ); - } - _txt = _txt.replaceAll( - rgx.inline_notes_al_regular_number_note, - (" $1 ") - ); - } 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; -- cgit v1.2.3