From 6f27312b0e61932d820b991a15c44845ff2cee75 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 26 Feb 2017 18:27:08 -0500 Subject: 0.13.5 defaults regex reorganised; some work on (x)html output --- org/defaults.org | 51 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 19 deletions(-) (limited to 'org/defaults.org') diff --git a/org/defaults.org b/org/defaults.org index 616921b..5ba63df 100644 --- a/org/defaults.org +++ b/org/defaults.org @@ -585,20 +585,6 @@ static levels_numbered = ctRegex!(`^[0-9]$`); static levels_numbered_headings = ctRegex!(`^[0-7]$`); #+END_SRC -*** filename (and path) matching (including markup insert file) :insert:file:path:filename: - -#+name: ao_rgx -#+BEGIN_SRC d -static src_pth = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[tm])$`); -static src_fn = - ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); -static src_fn_master = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssm)$`); -static src_fn_text = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]sst)$`); -static src_fn_insert = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssi)$`); -static src_fn_find_inserts = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[im])$`); -static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[ti])$`); -#+END_SRC - *** comments :comment: #+name: ao_rgx @@ -672,7 +658,7 @@ static para_bullet = ctRegex!(`^_[*] `); static para_bullet_indent = ctRegex!(`^_([1-9])[*] `); static para_indent = ctRegex!(`^_([1-9]) `); static para_indent_hang = ctRegex!(`^_([0-9])_([0-9]) `); -static para_attribs = ctRegex!(`^_(([0-9])(_([0-9]))?|_([1-9])?[*]) `); +static para_attribs = ctRegex!(`^_(?:(?:[0-9])(?:_([0-9]))?|(?:[1-9])?[*]) `); #+END_SRC *** blocked markup :block:tic: @@ -764,8 +750,9 @@ static note_ref = ctRegex!(`^\S+?noteref_( #+name: ao_rgx #+BEGIN_SRC d -static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg"); -static inline_link_naked_url = ctRegex!(`(?P^|[ ])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!]?(?:[ ]|$))`, "mg"); +static inline_url_generic = ctRegex!(`(?:^|[}(\[ ])(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]`, "mg"); +static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg"); +static inline_link_naked_url = ctRegex!(`(?P^|[ ])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!'"]?(?:[ ]|$))`, "mg"); static inline_link_markup_regular = ctRegex!(`(?P^|[ ])\{\s*(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!]?(?:[ ]|$))`, "mg"); static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!]?(?:[ ]|$))`, "mg"); static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg"); @@ -1028,12 +1015,12 @@ http://dlang.org/phobos/std_regex.html *** 0. code template: :rgx: #+name: tangle_ao_rgx -#+BEGIN_SRC d :tangle ../src/sdp/ao_rgx.d +#+BEGIN_SRC d :tangle ../src/sdp/output_rgx.d /++ regex: regular expressions used in sisu document parser +/ template SiSUoutputRgxInit() { - private import output_defaults; + private import defaults; struct Rgx { <> } @@ -1167,6 +1154,21 @@ template SiSUlanguageCodes() { #+END_SRC ** 1. ctRegex :regex: + +*** filename (and path) matching (including markup insert file) :insert:file:path:filename: + +#+name: prgmkup_rgx +#+BEGIN_SRC d +static src_pth = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[tm])$`); +static src_fn = + ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); +static src_fn_master = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssm)$`); +static src_fn_text = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]sst)$`); +static src_fn_insert = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssi)$`); +static src_fn_find_inserts = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[im])$`); +static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[ti])$`); +#+END_SRC + *** inline (internal program) markup footnotes endnotes :inline:footnote: #+name: prgmkup_rgx @@ -1187,6 +1189,17 @@ static inline_text_and_note_al = ctRegex!(`(?P.+?) static inline_text_and_note_al_ = ctRegex!(`(.+?(?:【[*+]*\s+.+?】|$))`, "mg"); #+END_SRC +#+name: prgmkup_rgx +#+BEGIN_SRC d +/+ inline markup footnotes endnotes +/ +static inline_link = ctRegex!(`┥(.+?)┝┤(.+?)├`, "mg"); +static inline_a_url = ctRegex!(`(┤)(\S+?)(├)`, "mg"); +static fn_suffix = ctRegex!(`\.fnSuffix`, "mg"); +static inline_link_fn_suffix = ctRegex!(`¤(.+?)(\.fnSuffix)`, "mg"); +static inline_seg_link = ctRegex!(`(¤)(?:.+?)\.fnSuffix`, "mg"); +static mark_internal_site_lnk = ctRegex!(`¤`, "mg"); +#+END_SRC + * +set colors for terminal+ (unused) :colors:terminal: #+name: ao_ansi_colors -- cgit v1.2.3