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 /src/sdp/meta/metadoc_from_src.d | |
parent | make auto numbering related (diff) |
footnotes fontface; home button text and links
Diffstat (limited to 'src/sdp/meta/metadoc_from_src.d')
-rw-r--r-- | src/sdp/meta/metadoc_from_src.d | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d index 6035825..784991c 100644 --- a/src/sdp/meta/metadoc_from_src.d +++ b/src/sdp/meta/metadoc_from_src.d @@ -3767,7 +3767,7 @@ template SiSUdocAbstraction() { static struct ObjInlineMarkupMunge { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; - string asterisks_; + string asterisks_, plus_; string obj_txt_out, tail, note; static auto rgx = Rgx(); static auto mkup = InlineMarkup(); @@ -3785,6 +3785,7 @@ template SiSUdocAbstraction() { static auto mng = InlineMarkup(); obj_txt_in = obj_txt_in.replaceAll(rgx.inline_mono, (mng.mono ~ "{$1}" ~ mng.mono)); /+ url matched +/ + obj_txt_in = obj_txt_in.replaceAll(rgx.inline_notes_al_special, ""); // TODO reinstate when special footnotes are implemented if (obj_txt_in.match(rgx.inline_url_generic)) { /+ link: naked url: http://url +/ if (obj_txt_in.match(rgx.inline_link_naked_url)) { @@ -3802,22 +3803,23 @@ template SiSUdocAbstraction() { { link which includes url as footnote }http://url~{ { http://url }http://url }~ +/ if (obj_txt_in.match(rgx.inline_link_endnote_url_helper)) { - obj_txt_in = (obj_txt_in).replaceAll( - rgx.inline_link_endnote_url_helper_punctuated, - (mkup.lnk_o ~ "$1" ~ mkup.lnk_c - ~ mkup.url_o ~ "$2" ~ mkup.url_c - ~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c - ~ mkup.url_o ~ "$2" ~ mkup.url_c - ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3") - ); - obj_txt_in = (obj_txt_in).replaceAll( - rgx.inline_link_endnote_url_helper, - (mkup.lnk_o ~ "$1" ~ mkup.lnk_c - ~ mkup.url_o ~ "$2" ~ mkup.url_c - ~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c - ~ mkup.url_o ~ "$2" ~ mkup.url_c - ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~") - ); + obj_txt_in = (obj_txt_in) + .replaceAll( + rgx.inline_link_endnote_url_helper_punctuated, + (mkup.lnk_o ~ "$1" ~ mkup.lnk_c + ~ mkup.url_o ~ "$2" ~ mkup.url_c + ~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c + ~ mkup.url_o ~ "$2" ~ mkup.url_c + ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3") + ) + .replaceAll( + rgx.inline_link_endnote_url_helper, + (mkup.lnk_o ~ "$1" ~ mkup.lnk_c + ~ mkup.url_o ~ "$2" ~ mkup.url_c + ~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c + ~ mkup.url_o ~ "$2" ~ mkup.url_c + ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~") + ); } /+ link with regular markup: { linked text or image }http://url @@ -3842,6 +3844,7 @@ template SiSUdocAbstraction() { /+ endnotes (regular) +/ bool flg_notes_reg = false; bool flg_notes_star = false; + bool flg_notes_plus = false; obj_txt_in = (obj_txt_in).replaceAll( rgx.inline_notes_curly, (mkup.en_a_o ~ " $1" ~ mkup.en_a_c) @@ -3868,6 +3871,15 @@ template SiSUdocAbstraction() { rgx.inline_al_delimiter_open_symbol_star, (mkup.en_a_o ~ replicate(asterisks_, n_foot_sp_asterisk) ~ " ") ) ~ "\n"; + } else if (n.hit.to!string.match(rgx.inline_al_delimiter_open_symbol_plus)) { + flg_notes_plus = true; + ++n_foot_sp_plus; + plus_ = "*"; + n_foot=n_foot_sp_plus; + obj_txt_out ~= n.hit.to!string.replaceFirst( + rgx.inline_al_delimiter_open_symbol_plus, + (mkup.en_a_o ~ replicate(plus_, n_foot_sp_plus) ~ " ") + ) ~ "\n"; } else if (n.hit.to!string.match(rgx.inline_al_delimiter_open_regular)) { flg_notes_reg = true; ++n_foot_reg; @@ -3888,6 +3900,7 @@ template SiSUdocAbstraction() { obj_txt_out, flg_notes_reg, flg_notes_star, + flg_notes_plus, ); return t; } @@ -3933,6 +3946,7 @@ template SiSUdocAbstraction() { obj_txt_out, ftn[1], ftn[2], + ftn[3], urls, ); return t; @@ -4143,7 +4157,8 @@ template SiSUdocAbstraction() { obj_txt["munge"] = x[0]; obj_notes_and_links["notes_reg"] = x[1]; obj_notes_and_links["notes_star"] = x[2]; - obj_notes_and_links["links"] = x[3]; + obj_notes_and_links["notes_plus"] = x[3]; + obj_notes_and_links["links"] = x[4]; break; } auto t = tuple( @@ -4360,7 +4375,7 @@ template SiSUdocAbstraction() { heading_num[3] = 0; heading_number_auto_composite = ""; } - /+ num_depth minimum 0 + /+ auto_num_depth minimum 0 (1.) default 2 (1.1.1) max 3 (1.1.1.1) implement +/ if ( conf_make_meta.make.auto_num_top_lv @@ -4398,7 +4413,7 @@ template SiSUdocAbstraction() { } if (heading_num[3] > 0) { heading_number_auto_composite - = (conf_make_meta.make.num_depth.to!uint == 3) + = (conf_make_meta.make.auto_num_depth.to!uint == 3) ? ( heading_num[0].to!string ~ "." ~ heading_num[1].to!string ~ "." ~ heading_num[2].to!string ~ "." @@ -4407,8 +4422,8 @@ template SiSUdocAbstraction() { : ""; } else if (heading_num[2] > 0) { heading_number_auto_composite - = ((conf_make_meta.make.num_depth.to!uint >= 2) - && (conf_make_meta.make.num_depth.to!uint <= 3)) + = ((conf_make_meta.make.auto_num_depth.to!uint >= 2) + && (conf_make_meta.make.auto_num_depth.to!uint <= 3)) ? ( heading_num[0].to!string ~ "." ~ heading_num[1].to!string ~ "." ~ heading_num[2].to!string @@ -4416,16 +4431,16 @@ template SiSUdocAbstraction() { : ""; } else if (heading_num[1] > 0) { heading_number_auto_composite - = ((conf_make_meta.make.num_depth.to!uint >= 1) - && (conf_make_meta.make.num_depth.to!uint <= 3)) + = ((conf_make_meta.make.auto_num_depth.to!uint >= 1) + && (conf_make_meta.make.auto_num_depth.to!uint <= 3)) ? ( heading_num[0].to!string ~ "." ~ heading_num[1].to!string ) : ""; } else if (heading_num[0] > 0) { heading_number_auto_composite - = ((conf_make_meta.make.num_depth.to!uint >= 0) - && (conf_make_meta.make.num_depth.to!uint <= 3)) + = ((conf_make_meta.make.auto_num_depth.to!uint >= 0) + && (conf_make_meta.make.auto_num_depth.to!uint <= 3)) ? (heading_num[0].to!string) : ""; } else { |