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 | |
parent | make auto numbering related (diff) |
footnotes fontface; home button text and links
Diffstat (limited to 'org')
-rw-r--r-- | org/default_misc.org | 1 | ||||
-rw-r--r-- | org/default_regex.org | 3 | ||||
-rw-r--r-- | org/meta_abstraction.org | 67 | ||||
-rw-r--r-- | org/meta_conf_make_meta.org | 123 | ||||
-rw-r--r-- | org/output_hub.org | 2 | ||||
-rw-r--r-- | org/output_sisupod.org | 59 | ||||
-rw-r--r-- | org/output_xmls.org | 62 | ||||
-rw-r--r-- | org/sdp.org | 2 |
8 files changed, 212 insertions, 107 deletions
diff --git a/org/default_misc.org b/org/default_misc.org index da1d0ae..a2a6a72 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -214,6 +214,7 @@ import #+name: defaults_template_markup #+BEGIN_SRC d template InternalMarkup() { + import std.array; static struct InlineMarkup { auto en_a_o = "【"; auto en_a_c = "】"; auto en_b_o = "〖"; auto en_b_c = "〗"; diff --git a/org/default_regex.org b/org/default_regex.org index 8edf0c1..59bd11e 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -127,7 +127,7 @@ static native_subhead_classify = ctRegex!(`^(?:topic_regi static native_subhead_identifier = ctRegex!(`^(?:oclc|pg|isbn)$`, "m"); static native_subhead_notes = ctRegex!(`^(?:abstract|description)$`, "m"); static native_subhead_publisher = ctRegex!(`^(?:name)$`, "m"); -static native_subhead_make = ctRegex!(`^(?:cover_image|home_button_image|home_button_text|footer|headings|num_top|num_depth|breaks|substitute|bold|italics|emphasis|texpdf_font|css)$`, "m"); +static native_subhead_make = ctRegex!(`^(?:cover_image|home_button_image|home_button_text|footer|headings|num_top|auto_num_depth|breaks|substitute|bold|italics|emphasis|texpdf_font|css)$`, "m"); #+END_SRC ** heading & paragraph operators :paragraph:operator: @@ -442,6 +442,7 @@ static src_formalised_file_path_parts = ctRegex!(`(?P<pth>(?:[/a #+BEGIN_SRC d /+ inline markup footnotes endnotes +/ static inline_notes_al = ctRegex!(`【(?:[*+]\s+|\s*)(.+?)】`, "mg"); +static inline_notes_al_special = ctRegex!(`【(?:[*+]\s+)(.+?)】`, "mg"); // TODO remove match when special footnotes are implemented static inline_notes_al_gen = ctRegex!(`【.+?】`, "m"); static inline_notes_al_gen_text = ctRegex!(`【(?P<text>.+?)】`, "m"); static inline_notes_al_gen_ref = ctRegex!(`【(?P<ref>[*+]\s+)\s*(?P<text>.+?)】`, "mg"); diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index b8ab4e6..0e379c7 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -4704,7 +4704,7 @@ pure struct OCNemitter { 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(); @@ -4728,6 +4728,7 @@ static struct ObjInlineMarkupMunge { 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)) { @@ -4745,22 +4746,23 @@ static struct ObjInlineMarkupMunge { { 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 @@ -4791,6 +4793,7 @@ static struct ObjInlineMarkupMunge { /+ 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) @@ -4817,6 +4820,15 @@ static struct ObjInlineMarkupMunge { 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; @@ -4837,6 +4849,7 @@ static struct ObjInlineMarkupMunge { obj_txt_out, flg_notes_reg, flg_notes_star, + flg_notes_plus, ); return t; } @@ -4888,6 +4901,7 @@ static struct ObjInlineMarkupMunge { obj_txt_out, ftn[1], ftn[2], |