From d43281245f1732941228d79663c8e8d3280a972c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 24 Sep 2019 11:13:42 -0400 Subject: document headers & config: yaml introduced - as toml alternative - both toml & yaml (meta, conf, make) work --- src/doc_reform/source/read_source_files.d | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/doc_reform/source/read_source_files.d') 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 ); -- cgit v1.2.3