aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/source/read_source_files.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/source/read_source_files.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/source/read_source_files.d')
-rw-r--r--src/doc_reform/source/read_source_files.d20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/doc_reform/source/read_source_files.d b/src/doc_reform/source/read_source_files.d
index b19582d..753612e 100644
--- a/src/doc_reform/source/read_source_files.d
+++ b/src/doc_reform/source/read_source_files.d
@@ -59,13 +59,20 @@ static template DocReformRawMarkupContent() {
static assert(!isTypeTuple!(tu));
images_list = tu[2].dup;
}
+ string header_type = "";
+ if (header_raw.match(rgx.yaml_config)) {
+ header_type = "yaml";
+ } else if (header_raw.match(rgx.toml_config)) {
+ header_type = "toml";
+ }
t = tuple(
header_raw,
sourcefile_body_content,
+ header_type,
insert_file_list,
images_list
);
- static assert(t.length==4);
+ static assert(t.length==5);
return t;
}
}
@@ -125,13 +132,20 @@ static template DocReformRawMarkupContent() {
auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) {
string[] file_insert_list = [];
string[] images_list = [];
- auto hc = header0Content1(source_txt_str);
- auto header = hc[0];
+ char[][] hc = header0Content1(source_txt_str);
+ char[] header = hc[0];
char[] source_txt = hc[1];
auto source_line_arr = markupSourceLineArray(source_txt);
+ string header_type = "";
+ if (header.match(rgx.yaml_config)) {
+ header_type = "yaml";
+ } else if (header.match(rgx.toml_config)) {
+ header_type = "toml";
+ }
auto t = tuple(
header,
source_line_arr,
+ header_type,
file_insert_list,
images_list
);