From bdb43e4e7d34ba178ec3bbc351d059c63e162d4b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 8 Mar 2018 16:58:10 -0500 Subject: footnotes fontface; home button text and links --- src/sdp/output/xmls.d | 62 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'src/sdp/output/xmls.d') diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d index 5e7f2e9..dd2ec67 100644 --- a/src/sdp/output/xmls.d +++ b/src/sdp/output/xmls.d @@ -152,12 +152,31 @@ template outputXHTMLs() { auto site_info_button(Dm)( Dm doc_matters, ) { - string _location_1_url ="http://www.sisudoc.org"; - string _location_1_lnk ="SiSU"; - string _location_2_url ="http://www.sisudoc.org"; - string _location_2_lnk ="www.sisudoc.org"; - string _location_3_url ="http://www.sisudoc.org"; - string _location_3_lnk ="sisu"; + string[string][] _location = [ + [ "url" : "", "lnk" : "" ], + [ "url" : "", "lnk" : "" ], + [ "url" : "", "lnk" : "" ] + ]; + if (doc_matters.conf_make_meta.make.home_button_text.length > 0) { + foreach(int key, string line; doc_matters.conf_make_meta.make.home_button_text) { + if (auto m = line.match(rgx.inline_link)) { + if (key < 3) { + _location[key] = [ "url" : m.captures[2], "lnk" : m.captures[1] ]; + } else { + writeln("WARNING markup error info button content too long (max length 3 used), length: ", + doc_matters.conf_make_meta.make.home_button_text.length, + " button: ", doc_matters.conf_make_meta.make.home_button_text); + } + } else { + _location[key]["url"] = ""; + _location[key]["lnk"] = line; + } + } + } else { + _location[0]["url"] = "http://www.sisudoc.org"; _location[0]["lnk"] = "SiSU"; + _location[1]["url"] = "http://www.sisudoc.org"; _location[1]["lnk"] = "www.sisudoc.org"; + _location[2]["url"] = "http://www.sisudoc.org"; _location[2]["lnk"] = "sisu"; + } string o; o = format(q"¶

@@ -170,12 +189,9 @@ template outputXHTMLs() { %s

¶", - _location_1_url, - _location_1_lnk, - _location_2_url, - _location_2_lnk, - _location_3_url, - _location_3_lnk, + _location[0]["url"], _location[0]["lnk"], + _location[1]["url"], _location[1]["lnk"], + _location[2]["url"], _location[2]["lnk"], ); return o; } @@ -330,16 +346,16 @@ template outputXHTMLs() { rgx.inline_seg_link, "$1"); } - _txt = (_txt).replaceAll( - rgx.inline_link_fn_suffix, - ("$1" ~ _suffix)); - _txt = (_txt).replaceAll( - rgx.inline_link, - ("$1")); - _txt = (_txt).replaceAll( - rgx.mark_internal_site_lnk, - "" - ); + _txt = (_txt) + .replaceAll( + rgx.inline_link_fn_suffix, + ("$1" ~ _suffix)) + .replaceAll( + rgx.inline_link, + ("$1")) + .replaceAll( + rgx.mark_internal_site_lnk, + ""); } debug(markup_links) { if (_txt.match(rgx.inline_link)) { @@ -368,6 +384,7 @@ template outputXHTMLs() { string _txt, ) { if (obj.inline_notes_reg) { + _txt = font_face(_txt); _txt = (_txt).replaceAll( rgx.inline_notes_delimiter_al_regular_number_note, (" $1 ") @@ -391,6 +408,7 @@ template outputXHTMLs() { ) { string[] _endnotes; if (obj.inline_notes_reg) { + _txt = font_face(_txt); /+ need markup for text, and separated footnote +/ foreach(m; _txt.matchAll(rgx.inline_notes_delimiter_al_regular_number_note)) { _endnotes ~= format( -- cgit v1.2.3