aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output_xmls.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-03-09 16:32:41 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit73f8706880b753c9be8a27b0c28c59a3a45dfa86 (patch)
treeb76b4b5e12828812efaaa2e4d52e4a6917bb46f0 /org/output_xmls.org
parentfootnotes fontface; home button text and links (diff)
home button text, a redo
Diffstat (limited to 'org/output_xmls.org')
-rw-r--r--org/output_xmls.org46
1 files changed, 12 insertions, 34 deletions
diff --git a/org/output_xmls.org b/org/output_xmls.org
index 9a34534..0c79bf9 100644
--- a/org/output_xmls.org
+++ b/org/output_xmls.org
@@ -230,46 +230,24 @@ auto header_metadata(Dm)(
auto site_info_button(Dm)(
Dm doc_matters,
) {
- string[string][] _location = [
- [ "url" : "", "lnk" : "" ],
- [ "url" : "", "lnk" : "" ],
- [ "url" : "", "lnk" : "" ]
- ];
+ string _locations;
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;
- }
- }
+ _locations = (doc_matters.conf_make_meta.make.home_button_text)
+ .replaceAll(
+ rgx.inline_link,
+ ("<p class=\"tiny_left\"><a href=\"$2\">$1</a></p>"))
+ .replaceAll(
+ rgx.br_line, "")
+ .replaceAll(
+ rgx.br_nl, "");
} 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";
+ writeln("WARNING home button text expected");
}
string o;
o = format(q"¶<div class="flex-menu-option">
- <p class="tiny_left"><a href="%s" target="_top">
- %s
- </a></p>
- <p class="tiny_left"><a href="%s" target="_top">
- %s
- </a></p>
- <p class="tiny_left"><a href="%s" target="_top">
- %s
- </a></p>
+ %s
</div>¶",
- _location[0]["url"], _location[0]["lnk"],
- _location[1]["url"], _location[1]["lnk"],
- _location[2]["url"], _location[2]["lnk"],
+ _locations,
);
return o;
}