From e95c49b76f4ac7bf72c383ee43a0567dfcbf1603 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 10 Sep 2018 18:15:02 -0400 Subject: 0.1.0 renamed doc-reform, doc_reform (& rad) - from sdp --- src/sdp/meta/conf_make_meta_toml.d | 77 -------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/sdp/meta/conf_make_meta_toml.d (limited to 'src/sdp/meta/conf_make_meta_toml.d') diff --git a/src/sdp/meta/conf_make_meta_toml.d b/src/sdp/meta/conf_make_meta_toml.d deleted file mode 100644 index d434f00..0000000 --- a/src/sdp/meta/conf_make_meta_toml.d +++ /dev/null @@ -1,77 +0,0 @@ -/++ - 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" - converting the metadata and make instructions to a common json format used by - program internally. Moved to associative array. -+/ -module sdp.meta.conf_make_meta_toml; -static template configParseTOMLreturnJSON() { - import - toml, - toml.json; - auto configParseTOMLreturnJSON(T)( - T _text - ){ - TOMLDocument _doc; - _doc = parseTOML(cast(string)(_text.content)); - auto _doc_json = toJSON(_doc); - return _doc_json; - } -} -static template configParseTOMLreturnSiSUstruct() { - import - toml, - toml.json; - import - sdp.meta.conf_make_meta_structs, - sdp.meta.conf_make_meta_json; - mixin contentJSONtoSiSUstruct; - auto configParseTOMLreturnSiSUstruct(CCm, T)( - CCm _make_and_meta_struct, - T _document_struct - ){ - TOMLDocument _doc = parseTOML(cast(string)(_document_struct.content)); - auto _doc_json = toJSON(_doc); - _make_and_meta_struct = contentJSONtoSiSUstruct!()(_make_and_meta_struct, _doc_json, _document_struct.filename); // struct from json - return _make_and_meta_struct; - } -} -static template docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct() { - import - std.exception, - std.regex, - std.stdio, - std.traits, - std.typecons, - std.utf, - std.conv : to; - import - toml, - toml.json; - import - sdp.meta.conf_make_meta_structs, - sdp.meta.conf_make_meta_json, - sdp.meta.rgx; - mixin SiSUrgxInit; - mixin contentJSONtoSiSUstruct; - static auto rgx = Rgx(); - auto docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct(CCm, Src)( - CCm _make_and_meta_struct, - Src header_src, - ) { - TOMLDocument _doc; - 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)); - } - auto _doc_json = toJSON(_doc); - auto _header_and_make_and_meta_struct = contentJSONtoSiSUstruct!()(_make_and_meta_struct, _doc_json, "header"); - return _header_and_make_and_meta_struct; - } -} -- cgit v1.2.3