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/meta/conf_make_meta_toml.d | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/doc_reform/meta/conf_make_meta_toml.d') diff --git a/src/doc_reform/meta/conf_make_meta_toml.d b/src/doc_reform/meta/conf_make_meta_toml.d index 6008996..0df63d3 100644 --- a/src/doc_reform/meta/conf_make_meta_toml.d +++ b/src/doc_reform/meta/conf_make_meta_toml.d @@ -2,9 +2,9 @@ extract native/orig header return associative array
the header is passed as text (lopped off top of a sisu markup file until the - required first heading ^A~), determine whether is a native header or sdlang one - with a regex check if whether it contains the "native header" required tag/field - @title: then process accordingly as a "native header" or "sdlang header" + required first heading ^A~), determine whether is a yaml header or toml one + with a regex check if whether it contains the "yaml header" required tag/field + title: then process accordingly as a "yaml header" or "toml header" converting the metadata and make instructions to a common json format used by program internally. Moved to associative array. +/ @@ -62,18 +62,18 @@ static template docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct() { mixin contentJSONtoDocReformStruct; static auto rgx = Rgx(); auto docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct(CCm,Src,M)( - CCm _make_and_meta_struct, Src header_src, + CCm _make_and_meta_struct, M _manifest, ) { - TOMLDocument _doc; + TOMLDocument _doc_toml; if (header_src.match(rgx.toml_header_meta_title)) { debug (json) { writeln(">>> document header is toml, convert to JSON"); } - _doc = parseTOML(cast(string)(header_src)); + _doc_toml = parseTOML(cast(string)(header_src)); } - auto _doc_json = _doc.toJSON; + auto _doc_json = _doc_toml.toJSON; auto _header_and_make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, _manifest, "header"); return _header_and_make_and_meta_struct; -- cgit v1.2.3