diff options
author | Ralph Amissah <ralph@amissah.com> | 2018-03-08 16:58:10 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | bdb43e4e7d34ba178ec3bbc351d059c63e162d4b (patch) | |
tree | 138c149ef8919ec7b6a19e77946304238edc3a8e /org/output_xmls.org | |
parent | make auto numbering related (diff) |
footnotes fontface; home button text and links
Diffstat (limited to 'org/output_xmls.org')
-rw-r--r-- | org/output_xmls.org | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/org/output_xmls.org b/org/output_xmls.org index 4a0babb..9a34534 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -230,12 +230,31 @@ auto header_metadata(Dm)( 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"> @@ -248,12 +267,9 @@ auto site_info_button(Dm)( %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; } @@ -439,16 +455,16 @@ auto inline_links(O)( 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)) { @@ -483,6 +499,7 @@ auto inline_notes_scroll(O)( 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\"> <sup>$1</sup> </note></a>") @@ -512,6 +529,7 @@ auto inline_notes_seg(O)( ) { 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( |