From 24c9ed3645178a6ee2abbd9201fa4643dba068e2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 14 May 2019 11:35:24 -0400 Subject: review, reduce use of auto --- org/meta_conf_make_meta.org | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'org/meta_conf_make_meta.org') diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index a0440e3..a27a18a 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -76,8 +76,8 @@ auto _mkup = InlineMarkup(); #+name: meta_defaults_template_structs #+BEGIN_SRC d -auto url_markup(string line) { - auto line_ = line +string url_markup(string line) { + string line_ = line .replaceAll( _rgx.smid_inline_link_markup_regular, ("$1" @@ -118,30 +118,30 @@ struct ConfCompositeMakeStr { string texpdf_font; } struct confCompositeMakeBuild { - auto bold(string _mk) { + string[] bold(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "*{$1}*", "$1"]; } return _out; } - auto breaks(string _mk) { + string breaks(string _mk) { return _mk; } - auto cover_image(string _mk) { + string cover_image(string _mk) { return _mk; } - auto css(string _mk) { + string css(string _mk) { return _mk; } - auto emphasis(string _mk) { + string[] emphasis(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "!{$1}!", "$1" ]; } return _out; } - auto footer(string[] _mk) { + string[] footer(string[] _mk) { string line_; string[] _mk2; foreach (line; _mk) { @@ -149,35 +149,35 @@ struct confCompositeMakeBuild { } return _mk2; } - auto headings(string[] _mk) { + string[] headings(string[] _mk) { return _mk; } - auto home_button_image(string[] _mk) { + string[] home_button_image(string[] _mk) { return _mk; } - auto home_button_text(string _mk) { + string home_button_text(string _mk) { return url_markup(_mk); } - auto italics(string _mk) { + string[] italics(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "/{$1}/", "$1" ]; } return _out; } - auto auto_num_top_at_level(string _mk) { + string auto_num_top_at_level(string _mk) { return _mk; } - auto auto_num_top_lv(int _mk) { + int auto_num_top_lv(int _mk) { return _mk; } - auto auto_num_depth(int _mk) { + int auto_num_depth(int _mk) { return _mk; } - auto substitute(string[][] _mk) { + string[][] substitute(string[][] _mk) { return _mk; } - auto texpdf_font(string _mk) { + string texpdf_font(string _mk) { return _mk; } } @@ -326,7 +326,7 @@ struct ConfCompositePlus { #+name: meta_defaults_template_structs #+BEGIN_SRC d -static auto ptr_head_main +static string[] ptr_head_main = [ "classify", "creator", @@ -339,7 +339,7 @@ static auto ptr_head_main "rights", "title" ]; -static auto ptr_head_sub_classify +static string[] ptr_head_sub_classify = [ "dewey", "keywords", @@ -347,7 +347,7 @@ static auto ptr_head_sub_classify "subject", "topic_register" ]; -static auto ptr_head_sub_creator +static string[] ptr_head_sub_creator = [ "author", "author_email", @@ -355,7 +355,7 @@ static auto ptr_head_sub_creator "illustrator", "translator" ]; -static auto ptr_head_sub_date +static string[] ptr_head_sub_date = [ "added_to_site", "available", @@ -365,14 +365,14 @@ static auto ptr_head_sub_date "published", "valid" ]; -static auto ptr_head_sub_identifier +static string[] ptr_head_sub_identifier = [ "isbn", "oclc", "pg" ]; /+ make +/ -static auto ptr_head_sub_make +static string[] ptr_head_sub_make = [ "cover_image", "home_button_image", @@ -387,27 +387,27 @@ static auto ptr_head_sub_make "texpdf_font", "css" ]; -static auto ptr_head_sub_notes +static string[] ptr_head_sub_notes = [ "abstract", "description" ]; -static auto ptr_head_sub_original +static string[] ptr_head_sub_original = [ "language", "source", "title" ]; -static auto ptr_head_sub_publisher +static string[] ptr_head_sub_publisher = [ "name" ]; -static auto ptr_head_sub_rights +static string[] ptr_head_sub_rights = [ "copyright", "cover", "illustrations", "license" ]; -static auto ptr_head_sub_title +static string[] ptr_head_sub_title = [ "edition", "full", @@ -416,7 +416,7 @@ static auto ptr_head_sub_title "note", "sub" ]; -auto config_jsonstr = `{ +JSONValue config_jsonstr = `{ }`; #+END_SRC @@ -980,7 +980,7 @@ if (_struct_composite.meta.creator_author.empty) { } } string[] authors_arr; - auto authors_raw_arr + string[] authors_raw_arr = _struct_composite.meta.creator_author.split(_rgx.arr_delimiter); foreach (author_raw; authors_raw_arr) { authors_arr ~= author_raw.replace(_rgx.raw_author_munge, "$2 $1"); @@ -1069,7 +1069,7 @@ static template configParseTOMLreturnJSON() { ){ TOMLDocument _doc; _doc = parseTOML(cast(string)(_text.content)); - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; return _doc_json; } } @@ -1091,7 +1091,7 @@ static template configParseTOMLreturnDocReformStruct() { T _document_struct ){ TOMLDocument _doc = parseTOML(cast(string)(_document_struct.content)); - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; _make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, _document_struct.filename); // struct from json return _make_and_meta_struct; @@ -1132,7 +1132,7 @@ static template docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct() { } _doc = parseTOML(cast(string)(header_src)); } - auto _doc_json = toJSON(_doc); + auto _doc_json = _doc.toJSON; auto _header_and_make_and_meta_struct = contentJSONtoDocReformStruct!()(_make_and_meta_struct, _doc_json, "header"); return _header_and_make_and_meta_struct; -- cgit v1.2.3