aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output/xmls.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-03-08 16:58:10 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitbdb43e4e7d34ba178ec3bbc351d059c63e162d4b (patch)
tree138c149ef8919ec7b6a19e77946304238edc3a8e /src/sdp/output/xmls.d
parentmake auto numbering related (diff)
footnotes fontface; home button text and links
Diffstat (limited to 'src/sdp/output/xmls.d')
-rw-r--r--src/sdp/output/xmls.d62
1 files changed, 40 insertions, 22 deletions
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"¶<div class="flex-menu-option">
<p class="tiny_left"><a href="%s" target="_top">
@@ -170,12 +189,9 @@ template outputXHTMLs() {
%s
</a></p>
</div>¶",
- _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,
- ("<a href=\"$2\">$1</a>"));
- _txt = (_txt).replaceAll(
- rgx.mark_internal_site_lnk,
- ""
- );
+ _txt = (_txt)
+ .replaceAll(
+ rgx.inline_link_fn_suffix,
+ ("$1" ~ _suffix))
+ .replaceAll(
+ rgx.inline_link,
+ ("<a href=\"$2\">$1</a>"))
+ .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,
("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup> </note></a>")
@@ -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(