diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-10-22 19:32:45 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-11-18 14:59:47 -0500 |
commit | 02714184258c9be072857ddcc03bc114b2e843d1 (patch) | |
tree | 9818170940f4db2334c54059869819f07f57a10d /src/doc_reform/meta | |
parent | multilingual pods, zipped source (diff) |
cosmetic
Diffstat (limited to 'src/doc_reform/meta')
-rw-r--r-- | src/doc_reform/meta/conf_make_meta_json.d | 4 | ||||
-rw-r--r-- | src/doc_reform/meta/conf_make_meta_yaml.d | 22 | ||||
-rw-r--r-- | src/doc_reform/meta/metadoc.d | 2 | ||||
-rw-r--r-- | src/doc_reform/meta/metadoc_from_src.d | 10 |
4 files changed, 16 insertions, 22 deletions
diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d index 7ad4744..0a3c4c2 100644 --- a/src/doc_reform/meta/conf_make_meta_json.d +++ b/src/doc_reform/meta/conf_make_meta_json.d @@ -21,7 +21,7 @@ static template contentJSONtoDocReformStruct() { doc_reform.meta.defaults, doc_reform.meta.rgx; ConfCompositePlus _struct_composite; - auto contentJSONtoDocReformStruct(C,J,M)(C _struct_composite, J _json, M _manifest, string _identifier) { + auto contentJSONtoDocReformStruct(C,J,M)(C _struct_composite, J _json, M _manifested, string _identifier) { mixin DocReformRgxInit; static auto rgx = Rgx(); debug (json) { @@ -547,7 +547,7 @@ static template contentJSONtoDocReformStruct() { ) { _struct_composite.meta.date_valid = _json.object["date"]["valid"].str; } - _struct_composite.meta.language_document_char = _manifest.src.language; + _struct_composite.meta.language_document_char = _manifested.src.language; } if ("links" in _json.object) {} if ("notes" in _json.object) { diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index f36a7cf..8b76a3e 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -24,14 +24,11 @@ static template contentYAMLtoDocReformStruct() { auto contentYAMLtoDocReformStruct(C,Y,M)( C _struct_composite, Y _yaml, - M _manifest, + M _manifested, string _identifier ) { mixin DocReformRgxInit; static auto rgx = Rgx(); - debug (yaml) { - writeln(">> --------------------------- >>"); - } confCompositeMakeBuild _mk; /+ make ------------------------------------------------------------------- +/ if ("make" in _yaml @@ -238,7 +235,7 @@ static template contentYAMLtoDocReformStruct() { } } if (!(_struct_composite.conf.output_path)) { - _struct_composite.conf.output_path = ((_manifest.output.path).asNormalizedPath).array; + _struct_composite.conf.output_path = ((_manifested.output.path).asNormalizedPath).array; } if ("output" in _yaml && _yaml["output"].type.sequence @@ -250,7 +247,7 @@ static template contentYAMLtoDocReformStruct() { && _yaml["output"]["path"].type.string && _yaml["output"]["path"].tag.match(rgx.yaml_tag_is_str) ) { - if (_manifest.output.path == _manifest.env.pwd + if (_manifested.output.path == _manifested.env.pwd && _yaml["output"]["path"].get!string.length > 0 ) { _struct_composite.conf.output_path = (((_yaml["output"]["path"].get!string).expandTilde).asNormalizedPath).array; @@ -645,7 +642,7 @@ static template contentYAMLtoDocReformStruct() { } } } - _struct_composite.meta.language_document_char = _manifest.src.language; // move + _struct_composite.meta.language_document_char = _manifested.src.language; // move if ("links" in _yaml) { // if ("" in _yaml["links"]) { // _struct_composite.meta.links_ = _yaml["links"][""].str; @@ -782,11 +779,11 @@ static template configParseYAMLreturnDocReformStruct() { auto configParseYAMLreturnDocReformStruct(T,CCm,M)( T _document_struct, CCm _make_and_meta_struct, - M _manifest + M _manifested ){ Node yaml_root = Loader.fromString(_document_struct.content).load(); _make_and_meta_struct - = contentYAMLtoDocReformStruct!()(_make_and_meta_struct, yaml_root, _manifest, _document_struct.filename); // struct from yaml + = contentYAMLtoDocReformStruct!()(_make_and_meta_struct, yaml_root, _manifested, _document_struct.filename); // struct from yaml return _make_and_meta_struct; } } @@ -811,18 +808,15 @@ static template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() { auto docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(CCm,Src,M)( Src header_src, CCm _make_and_meta_struct, - M _manifest, + M _manifested, ) { Node _yaml_root; if (header_src.match(rgx.yaml_header_meta_title)) { - debug (yaml) { - writeln(">>> document header is yaml, consider converting to JSON"); - } import dyaml; _yaml_root = Loader.fromString(header_src).load(); } auto _header_and_make_and_meta_struct - = contentYAMLtoDocReformStruct!()(_make_and_meta_struct, _yaml_root, _manifest, "header"); + = contentYAMLtoDocReformStruct!()(_make_and_meta_struct, _yaml_root, _manifested, "header"); return _header_and_make_and_meta_struct; } } diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index 115ab9f..69f7142 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -37,7 +37,7 @@ template DocReformAbstraction() { M _manifest ){ ConfCompositePlus _make_and_meta_struct; - { /+ document config file +/ + { /+ document config/make file +/ auto _config_document_struct = readConfigDoc!()(_manifest, _env); if (_config_document_struct.filetype == "yaml") { import doc_reform.meta.conf_make_meta_yaml; diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index ec1e01a..f5e0b81 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -313,7 +313,7 @@ template DocReformDocAbstraction() { char[][] markup_sourcefile_content, CMM conf_make_meta, Opt opt_action, - Mf manifest_matter, + Mf manifested, bool _new_doc ) { static auto rgx = Rgx(); @@ -1777,7 +1777,7 @@ template DocReformDocAbstraction() { return images_; } string[] segnames_0_to_4; - auto _image_dimensions(O,M)(O obj, M manifest_matter) { + auto _image_dimensions(O,M)(O obj, M manifested) { if (obj.has.image_without_dimensions) { import std.math; import imageformats; @@ -1786,9 +1786,9 @@ template DocReformDocAbstraction() { int max_width = 640; foreach (m; obj.text.matchAll(rgx.inline_image_without_dimensions)) { debug(images) { - writeln(manifest_matter.src.image_dir_path ~ "/" ~ m["img"]); + writeln(manifested.src.image_dir_path ~ "/" ~ m["img"]); } - read_image_info(manifest_matter.src.image_dir_path ~ "/" ~ m["img"], w, h, chans); + read_image_info(manifested.src.image_dir_path ~ "/" ~ m["img"], w, h, chans); // calculate, decide max width and proportionally reduce to keep w & h within it debug(images) { writeln("width: ", w, ", height: ", h); @@ -1923,7 +1923,7 @@ template DocReformDocAbstraction() { obj = obj.obj_heading_ancestors(lv_ancestors_txt); } else if (obj.metainfo.is_a == "para") { _images ~= extract_images(obj.text); - obj = _image_dimensions(obj, manifest_matter); + obj = _image_dimensions(obj, manifested); } obj = _links(obj); } |