aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta/rgx.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-09-24 11:13:42 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-10-17 19:07:20 -0400
commitd43281245f1732941228d79663c8e8d3280a972c (patch)
tree0d0c814b11130e87768791a793204cc3588d8941 /src/doc_reform/meta/rgx.d
parentflag --show-summary (diff)
document headers & config: yaml introduced
- as toml alternative - both toml & yaml (meta, conf, make) work
Diffstat (limited to 'src/doc_reform/meta/rgx.d')
-rw-r--r--src/doc_reform/meta/rgx.d9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d
index 926f2c6..bad5b52 100644
--- a/src/doc_reform/meta/rgx.d
+++ b/src/doc_reform/meta/rgx.d
@@ -11,6 +11,10 @@ static template DocReformRgxInit() {
static flag_action = ctRegex!(`^(--[a-z][a-z0-9-]+)$`);
static flag_action_str = ctRegex!(` (--[a-z][a-z0-9-]+)`);
static within_quotes = ctRegex!(`"(.+?)"`, "m");
+ static yaml_tag_is_str = ctRegex!(`:str$`);
+ static yaml_tag_is_int = ctRegex!(`:int$`);
+ static yaml_tag_is_map = ctRegex!(`:map$`);
+ static yaml_tag_is_seq = ctRegex!(`:seq$`);
static make_heading_delimiter = ctRegex!(`[;][ ]*`);
static arr_delimiter = ctRegex!(`[ ]*[;][ ]*`);
static name_delimiter = ctRegex!(`^([^,]+)[ ]*,[ ]+(.+?)$`);
@@ -45,7 +49,10 @@ static template DocReformRgxInit() {
static variable_doc_title = ctRegex!(`@title`);
static variable_doc_author = ctRegex!(`@author|@creator`);
static raw_author_munge = ctRegex!(`(?P<last>\S.+?),\s+(?P<first>.+)`,"i");
- static toml_header_meta_title = ctRegex!(`^\s*(title\s*=\s*"|\[title\])`, "m");
+ static toml_header_meta_title = ctRegex!(`^\s*(?:title\s*=\s*"|\[title\])`, "m");
+ static yaml_header_meta_title = ctRegex!(`^\s*(?:title\s*:\s*(?:"?\w|$))`, "m");
+ static toml_config = ctRegex!(`^\s*(?:[a-z]+\s*=\s*"|\[\w+?\])`, "m");
+ static yaml_config = ctRegex!(`^[a-z]+\s*:\s*(?:"?\w|$)`, "m");
/+ heading & paragraph operators +/
static heading_a = ctRegex!(`^:?[A][~] `, "m");
static heading = ctRegex!(`^:?([A-D1-4])[~]([a-z0-9_.-]*[?]?)\s+`,"i");