From e37589f5f5253d81c62f8846dbf721c23fe48d44 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 7 Oct 2021 20:39:57 -0400 Subject: configuration, hierarchy filenames & paths ... --- org/meta_conf_make_meta.org | 896 ++++++++++++++++++++++++++++---------------- 1 file changed, 571 insertions(+), 325 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 cdb7571..118219e 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -20,40 +20,175 @@ * generic ** conf yaml REFERENCE +NOTES on configuration hierarchy: +- compile time program defaults views/configuration.txt in config_d_cfte.org + - config_d_cfte.org (writes views/configuration.txt) + - compile time program defaults, set in views/configuration.txt + - found in: _cfg.* +- run time default configuration administrators config ".dr/config_site_local" + - in_source_files.org readConfigSite (reads administrators site defaults from + yaml config file) + - meta_conf_make_meta.org struct ConfCompositeSiteLocal + - administrator site defaults read from yaml configuration file + ".dr/config_site_local" + - found in: "doc_matters.conf_make_meta.conf." (incorporates _cfg.* as + initial default values that are overridden if set) + - ("conf_make_meta.make" (& "conf_make_meta.meta") also available taken from + document headers) +- command line execution configuration instruction + - spine.org (org heading: initialize settings) (command line overrides) + - command line settings/overrides + - found in: doc_matters.opt.action.* + +** table + +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cfg ctfe | config local | cli | cli-run | composite | default | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| _cfg. | ["webserv"] | -- | opt_action. | _struct_composite.conf. | default | ✓ ✗ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| www_doc_root | ["data_root_path"] | output | output_dir_set | output_path | "/srv/www/spine" | ✓ | +| | | | | | "/var/www" | | +| | | | | | "/var/www/html" | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| www_http | ["http"] | www-http | webserver_http | w_srv_http | "http" or "https" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| www_host | ["domain"] | www-host | webserver_host_name | CHECK | "localhost" | ✓ | +| | | | | | "sisudoc" | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| www_host_doc_root | [""] | www-host-doc-root | webserver_host_doc_root | w_srv_data_root_path | | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| www_url_doc_root? | | www-url-doc-root | | | "http://localhost" | | +| CHECK | | | | | "https://sisudoc.org" | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_http | [""] | cgi-http | | | | ✗ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_host | [""] | cgi-host | | | | ✗ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_bin_root | ["cgi_bin_path"] | cgi-bin-root | cgi_bin_root | cgi_bin_root | "/var/www/cgi/cgi-bin" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_filename | ["cgi_search_script"] | cgi-sqlite-search-filename | cgi_sqlite_search_filename | w_srv_cgi_search_script | "spine_search" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_url_root | ["cgi_bin_url"] | cgi-url-root | cgi_url_root | | REMOVE UNUSED | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_url_action | ["cgi_action"] | cgi-url-action | cgi_url_action | w_srv_cgi_action | "http://localhost/cgi-bin/spine-search" | ✓ | +| | | | | | "https://sisudoc.org/spine-search" | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| cgi_search_form_title | ["cgi_search_form_title"] | cgi-search-title | cgi_search_title | w_srv_cgi_search_form_title | "≅ SiSU Spine search" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| | | config | | | | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| default_language | [""] | lang | languages_set | | "all" or "en" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| default_papersize | [""] | set-papersize | latex_papersize | set_papersize | "a4"? | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| default_text_wrap | [""] | set-textwrap | text_wrap | set_text_wrap | 80 | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| default_hash_digest | [""] | set-digest | hash_digest_type | | sha258 | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| db_sqlite_path | [""] | sqlite-db-path | sqliteDB_path | w_srv_db_sqlite_path | "/var/www/sqlite" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| db_sqlite_filename | [""] | sqlite-db-filename | sqliteDB_filename | w_srv_db_sqlite_filename | "spine_search.db" | ✓ | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| +| | | | | | | | +|-----------------------+---------------------------+----------------------------+----------------------------+-----------------------------+-----------------------------------------+-----| + +** cli flag + +#+BEGIN_SRC d +string[string] settings = [ + "output" : "", + "www-http" : "", + "www-host" : "", + "www-host-doc-root" : "", + "www-url-doc-root" : "", + "cgi-http" : "", + "cgi-host" : "", + "cgi-bin-root" : "", + "cgi-sqlite-search-filename" : "", + "cgi-url-root" : "", + "cgi-url-action" : "", + "cgi-search-title" : "", + "config" : "", + "lang" : "all", + "set-papersize" : "", + "set-textwrap" : "", + "set-digest" : "", + "sqlite-db-path" : "", + "sqlite-db-filename" : "", +]; +#+END_SRC + +** conf build - views/configuration.txt REFERENCE + +- see: config_d_cfte.org + for configuration_example.txt + +#+BEGIN_SRC d +struct Cfg { + string www_http = "http"; + string www_host = "localhost"; + string www_url_doc_root = "http://localhost"; + string www_doc_root = "/srv/www/spine"; + string www_host_doc_root = "localhost"; + string cgi_bin_root = "/var/www/cgi/cgi-bin"; + string cgi_bin_subpath = ""; + string cgi_filename = "spine_search"; + string cgi_url_root = "http://localhost/"; + string cgi_port = ""; + string cgi_user = ""; + string cgi_url_action = "http://localhost/spine_search"; + string cgi_search_form_title = "≅ SiSU Spine search"; + string db_sqlite_path = "/var/www/sqlite"; + string db_sqlite_filename = "spine.search.db"; + string default_language = "en"; + string default_papersize = "a4"; + string default_text_wrap = "80"; + string default_hash_digest = "sha256"; +} +enum _cfg = Cfg(); +#+END_SRC + +** conf yaml - .dr/config_site_local REFERENCE + +#+HEADER: :tangle "../.dr/config_local_site_example" #+BEGIN_SRC yaml +# config_local_site +# read from directories ... FIX provide list flag: - act0: "--html" - act1: "--html --epub" + act0: "--html" + act1: "--html --epub" output: - path: "/var/www/html" + path: "/srv/www/spine" default: - language: "en" - papersize: "a4" - text_wrap: "80" - digest: "sha256" + language: "en" + papersize: "a4" + text_wrap: "80" + digest: "sha256" webserv: - http: "http" - host: "localhost" - data_http: "http" - data_host: "localhost" - data_root_url: "http://localhost" - data_root_path: "/var/www/html" - data_root_part: "" - images_root_part: "image" - cgi_http: "http" - cgi_host: "localhost" - cgi_bin_url: "http://localhost/cgi-bin" - cgi_bin_subpath: "cgi-bin" - cgi_bin_path: "/usr/lib/cgi-bin" - cgi_search_form_title: "≅ SiSU Spine search" - cgi_search_script: "spine_search" - cgi_search_script_raw_fn_d: "spine_search.d" - cgi_port: "" - cgi_user: "" - cgi_action: "http://localhost/cgi-bin/spine-search" - db_sqlite: "spine.search.db" - db_pg_table: "" - db_pg_user: "" + http: "https" # "http" + domain: "sisudoc" # "localhost" + data_http: "https" # "http" + data_domain: "sisudoc" # "localhost" + data_root_url: "https://sisudoc.org" # "http://localhost" + data_root_path: "/srv/www/spine" # "/var/www/html" + data_root_part: "" + images_root_part: "image" + cgi_search_form_title: "≅ SiSU Spine search" + cgi_http: "https" # "http" + cgi_domain: "sisudoc.org" # "localhost" + cgi_bin_url: "http://sisudoc.org/cgi-bin" # "http://localhost/cgi-bin" + cgi_bin_part: "cgi-bin" + cgi_bin_path: "/var/www/cgi/cgi-bin" # "/usr/lib/cgi-bin" + cgi_search_script: "spine_search" + cgi_search_script_raw_fn_d: "spine_search.d" + cgi_port: "" + cgi_user: "" + cgi_action: "https://sisudoc.org/spine_search" # "http://localhost/cgi-bin/spine-search" + db_sqlite_filename: "spine.search.db" + db_sqlite_path: "/var/www/sqlite" + db_pg_table: "" + db_pg_user: "" #+END_SRC ** imports @@ -278,7 +413,6 @@ struct ConfCompositeSiteLocal { string w_srv_cgi_host; // if not set same as webserv_host string w_srv_cgi_bin_subpath; string w_srv_cgi_bin_path; - string w_srv_cgi_search_title; string w_srv_cgi_search_script; string w_srv_cgi_search_script_raw_fn_d; string w_srv_cgi_port; @@ -426,244 +560,296 @@ template contentYAMLtoSpineStruct() { doc_reform.meta.defaults, doc_reform.meta.rgx; ConfComposite _struct_composite; - @system auto contentYAMLtoSpineStruct(C,Y,M,O)( - C _struct_composite, - Y _yaml, - M _manifested, - O _opt_action, + @system auto contentYAMLtoSpineStruct(C,Y,M,O,Cfg)( + C _struct_composite, + Y _yaml, + M _manifested, + O _opt_action, + Cfg _cfg, string _identifier ) { mixin spineRgxIn; static auto rgx = RgxI(); confCompositeMakeBuild _mk; - <> - <> - <> + if (_identifier != "header") { // called only once per run anyway + <> + } else { + <> + <> + } return _struct_composite; } } #+END_SRC -** make +** conf -#+NAME: yaml_objects_make +#+NAME: yaml_objects_conf #+BEGIN_SRC d -/+ make ------------------------------------------------------------------- +/ -if ("make" in _yaml - && _yaml["make"].type.sequence -) { - if (_yaml["make"].type.mapping - && _yaml["make"].tag.match(rgx.yaml_tag_is_map) - ) { - if ("bold" in _yaml["make"] - && _yaml["make"]["bold"].type.string - && _yaml["make"]["bold"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.bold = _yaml["make"]["bold"].get!string; - } - if ("breaks" in _yaml["make"] - && _yaml["make"]["breaks"].type.string - && _yaml["make"]["breaks"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.breaks = _yaml["make"]["breaks"].get!string; +/+ conf ------------------------------------------------------------------- +/ +/+ + _cfg. build defaults (else program runtime defaults) + local_site_configuration defaults + command line overrides ++/ +{ + if (_opt_action.webserver_http.length > 0) { + _struct_composite.conf.w_srv_http + = _opt_action.webserver_http; + } else { + _struct_composite.conf.w_srv_http + = (_cfg.www_http.empty) + ? "http" + : _cfg.www_http; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("http" in _yaml["webserv"] + && _yaml["webserv"]["http"].type.string + && _yaml["webserv"]["http"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_http + = _yaml["webserv"]["http"].get!string; + } } - if ("cover_image" in _yaml["make"] - && _yaml["make"]["cover_image"].type.string - && _yaml["make"]["cover_image"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.cover_image = _yaml["make"]["cover_image"].get!string; + } + if (_opt_action.cgi_search_title.length > 0) { + _struct_composite.conf.w_srv_cgi_search_form_title + = _opt_action.cgi_search_title; + } else { + _struct_composite.conf.w_srv_cgi_search_form_title + = (_cfg.cgi_search_form_title.empty) + ? "≅ SiSU spine search form" + : _cfg.cgi_search_form_title; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("cgi_search_form_title" in _yaml["webserv"] + && _yaml["webserv"]["cgi_search_form_title"].type.string + && _yaml["webserv"]["cgi_search_form_title"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_cgi_search_form_title + = _yaml["webserv"]["cgi_search_form_title"].get!string; + } } - if ("css" in _yaml["make"] - && _yaml["make"]["css"].type.string - && _yaml["make"]["css"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.css = _yaml["make"]["css"].get!string; + } + if (_opt_action.cgi_sqlite_search_filename.length > 0) { + _struct_composite.conf.w_srv_cgi_search_script + = _opt_action.cgi_sqlite_search_filename; + } else { + _struct_composite.conf.w_srv_cgi_search_script + = (_cfg.cgi_filename.empty) + ? "spine_search" + : _cfg.cgi_filename; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("cgi_search_script" in _yaml["webserv"] + && _yaml["webserv"]["cgi_search_script"].type.string + && _yaml["webserv"]["cgi_search_script"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_cgi_search_script + = _yaml["webserv"]["cgi_search_script"].get!string; + } } - if ("emphasis" in _yaml["make"] - && _yaml["make"]["emphasis"].type.string - && _yaml["make"]["emphasis"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.emphasis = _yaml["make"]["emphasis"].get!string; + } + if (_opt_action.sqliteDB_filename.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_filename + = _opt_action.sqliteDB_filename; + } else { + _struct_composite.conf.w_srv_db_sqlite_filename + = (_cfg.db_sqlite_filename.empty) + ? "spine.search.db" + : _cfg.db_sqlite_filename; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("db_sqlite_filename" in _yaml["webserv"] + && _yaml["webserv"]["db_sqlite_filename"].type.string + && _yaml["webserv"]["db_sqlite_filename"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_db_sqlite_filename + = _yaml["webserv"]["db_sqlite_filename"].get!string; + } } - if ("footer" in _yaml["make"] - && _yaml["make"]["footer"].type.string - && _yaml["make"]["footer"].tag.match(rgx.yaml_tag_is_str) - ) { - char[][] __match_footer_array - = (cast(char[]) _yaml["make"]["footer"].get!string) - .split(rgx.make_heading_delimiter); - _struct_composite.make_str.footer = __match_footer_array.to!(string[]); + } + if (_opt_action.sqliteDB_path.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_path + = _opt_action.sqliteDB_path; + } else { + _struct_composite.conf.w_srv_db_sqlite_path + = (_cfg.db_sqlite_path.empty) + ? "/var/www/sqlite" + : _cfg.db_sqlite_path; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("db_sqlite_path" in _yaml["webserv"] + && _yaml["webserv"]["db_sqlite_path"].type.string + && _yaml["webserv"]["db_sqlite_path"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_db_sqlite_path + = _yaml["webserv"]["db_sqlite_path"].get!string; + } } - if ("headings" in _yaml["make"] - && _yaml["make"]["headings"].type.string - && _yaml["make"]["headings"].tag.match(rgx.yaml_tag_is_str) - ) { - char[][] __match_headings_array - = (cast(char[]) _yaml["make"]["headings"].get!string) - .split(rgx.make_heading_delimiter); - _struct_composite.make_str.headings = __match_headings_array.to!(string[]); - } else if ("headings" in _yaml["make"] - && _yaml["make"]["headings"].type.string - && _yaml["make"]["headings"].tag.match(rgx.yaml_tag_is_seq) - ) { - foreach(string identify_heading_level; _yaml["make"]["headings"]) { - _struct_composite.make_str.headings ~= identify_heading_level; + } + if (_opt_action.cgi_url_action.length > 0) { + _struct_composite.conf.w_srv_cgi_action + = _opt_action.cgi_url_action; + } else { + _struct_composite.conf.w_srv_cgi_action + = (_cfg.www_url_doc_root.empty) + ? "http://locahost" // "https://sisudoc.org" + : _cfg.www_url_doc_root; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("cgi_action" in _yaml["webserv"] + && _yaml["webserv"]["cgi_action"].type.string + && _yaml["webserv"]["cgi_action"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_cgi_action + = _yaml["webserv"]["cgi_action"].get!string; + } else if (_opt_action.cgi_sqlite_search_filename.length > 0) { + _struct_composite.conf.w_srv_cgi_action + = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; } } - if ("home_button_image" in _yaml["make"] - && _yaml["make"]["home_button_image"].type.string - && _yaml["make"]["home_button_image"].tag.match(rgx.yaml_tag_is_str) - ) { - char[][] __match_home_button_image_array - = (cast(char[]) _yaml["make"]["home_button_image"].get!string) - .split(rgx.make_heading_delimiter); - _struct_composite.make_str.home_button_image = __match_home_button_image_array.to!(string[]); + } + if (!(_struct_composite.conf.output_path)) { + _struct_composite.conf.output_path = ((_manifested.output.path).asNormalizedPath).array; + } { + if (_opt_action.output_dir_set.length > 0) { + _struct_composite.conf.output_path + = (_opt_action.output_dir_set.asNormalizedPath).array; + } else { + _struct_composite.conf.output_path + = (_cfg.www_doc_root.empty) + ? "/srv/www/spine" + : _cfg.www_doc_root; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if (_yaml["output"].type.mapping + && _yaml["output"].tag.match(rgx.yaml_tag_is_map) + ) { + if ("path" in _yaml["output"] + && _yaml["output"]["path"].type.string + && _yaml["output"]["path"].tag.match(rgx.yaml_tag_is_str) + ) { + 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; + } + } + } + } } - if ("home_button_text" in _yaml["make"] - && _yaml["make"]["home_button_text"].type.string - && _yaml["make"]["home_button_text"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.home_button_text = _yaml["make"]["home_button_text"].get!string; - } else if ("home_button_text" in _yaml["make"] - && _yaml["make"]["home_button_text"].type.string - && _yaml["make"]["home_button_text"].tag.match(rgx.yaml_tag_is_seq) - ) { - _struct_composite.make_str.home_button_text = ""; - foreach(string hbt; _yaml["make"]["home_button_text"]) { - _struct_composite.make_str.home_button_text ~= hbt ~ "; "; + if (_opt_action.webserver_host_doc_root.length > 0) { // same as output_path immediately above, resolve FIX REMOVE + _struct_composite.conf.w_srv_data_root_path + = _opt_action.webserver_host_doc_root; + } else { + _struct_composite.conf.w_srv_data_root_path + = (_cfg.www_doc_root.empty) + ? "/var/www/spine" + : _cfg.www_doc_root; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("data_root_path" in _yaml["webserv"] + && _yaml["webserv"]["data_root_path"].type.string + && _yaml["webserv"]["data_root_path"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_data_root_path + = _yaml["webserv"]["data_root_path"].get!string; + } } } - if ("italics" in _yaml["make"] - && _yaml["make"]["italics"].type.string - && _yaml["make"]["italics"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.make_str.italics = _yaml["make"]["italics"].get!string; + } + if (_opt_action.cgi_bin_root.length > 0) { + _struct_composite.conf.w_srv_cgi_bin_path + = _opt_action.cgi_bin_root; + } else { + _struct_composite.conf.w_srv_cgi_bin_path + = (_cfg.cgi_bin_root.empty) + ? "/var/www/cgi/cgi-bin" + : _cfg.cgi_bin_root; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) + ) { + if ("cgi_bin_path" in _yaml["webserv"] + && _yaml["webserv"]["cgi_bin_path"].type.string + && _yaml["webserv"]["cgi_bin_path"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_cgi_bin_path + = _yaml["webserv"]["cgi_bin_path"].get!string; + } } - if ("auto_num_top_at_level" in _yaml["make"] - && _yaml["make"]["auto_num_top_at_level"].type.string - && _yaml["make"]["auto_num_top_at_level"].tag.match(rgx.yaml_tag_is_str) + } + { _struct_composite.conf.w_srv_data_root_part + = ""; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) ) { - _struct_composite.make_str.auto_num_top_at_level = _yaml["make"]["auto_num_top_at_level"].get!string; - switch (_yaml["make"]["auto_num_top_at_level"].get!string) { - case "A": - break; - case "B": _struct_composite.make_str.auto_num_top_lv = 1; - break; - case "C": _struct_composite.make_str.auto_num_top_lv = 2; - break; - case "D": _struct_composite.make_str.auto_num_top_lv = 3; - break; - case "1": _struct_composite.make_str.auto_num_top_lv = 4; - break; - case "2": _struct_composite.make_str.auto_num_top_lv = 5; - break; - case "3": _struct_composite.make_str.auto_num_top_lv = 6; - break; - case "4": _struct_composite.make_str.auto_num_top_lv = 7; - break; - default: - break; + if ("data_root_part" in _yaml["webserv"] + && _yaml["webserv"]["data_root_part"].type.string + && _yaml["webserv"]["data_root_part"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_data_root_part = _yaml["webserv"]["data_root_part"].get!string; } } - if ("auto_num_depth" in _yaml["make"] - && _yaml["make"]["auto_num_depth"].type.string - && _yaml["make"]["auto_num_depth"].tag.match(rgx.yaml_tag_is_int) - ) { // not sure implemented for documents - _struct_composite.make_str.auto_num_depth = _yaml["make"]["auto_num_depth"].get!int; - } else if ("auto_num_depth" in _yaml["make"] - && _yaml["make"]["auto_num_depth"].type.string - && _yaml["make"]["auto_num_depth"].tag.match(rgx.yaml_tag_is_str) - ) { // not sure implemented for documents - _struct_composite.make_str.auto_num_depth = _yaml["make"]["auto_num_depth"].get!int; - } - if ("texpdf_font" in _yaml["make"] - && _yaml["make"]["texpdf_font"].type.string + } + { _struct_composite.conf.w_srv_images_root_part + = "image"; + if (("webserv" in _yaml && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) ) { - _struct_composite.make_str.texpdf_font = _yaml["make"]["texpdf_font"].get!string; + if ("images_root_part" in _yaml["webserv"] + && _yaml["webserv"]["images_root_part"].type.string + && _yaml["webserv"]["images_root_part"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.conf.w_srv_images_root_part = _yaml["webserv"]["images_root_part"].get!string; + } } } - _struct_composite.make.bold = _mk.bold(_struct_composite.make_str.bold); - _struct_composite.make.breaks = _mk.breaks(_struct_composite.make_str.breaks); - _struct_composite.make.cover_image = _mk.cover_image(_struct_composite.make_str.cover_image); - _struct_composite.make.css = _mk.css(_struct_composite.make_str.css); - _struct_composite.make.emphasis = _mk.emphasis(_struct_composite.make_str.emphasis); - _struct_composite.make.footer = _mk.footer(_struct_composite.make_str.footer); - _struct_composite.make.headings = _mk.headings(_struct_composite.make_str.headings); - _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image); - _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text); - _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics); - _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level); - _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv); - _struct_composite.make.auto_num_depth = _mk.auto_num_depth(_struct_composite.make_str.auto_num_depth); - _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute); - _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font); } - -#+END_SRC - -** conf - -#+NAME: yaml_objects_conf -#+BEGIN_SRC d -/+ conf ------------------------------------------------------------------- +/ -if ("webserv" in _yaml - && _yaml["webserv"].type.sequence -) { - if (_yaml["webserv"].type.mapping - && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map) - ) { - if ("http" in _yaml["webserv"] - && _yaml["webserv"]["http"].type.string - && _yaml["webserv"]["http"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_http = _yaml["webserv"]["http"].get!string; - } // else { set default? } +if (("webserv" in _yaml + && _yaml["webserv"].type.sequence) + && (_yaml["webserv"].type.mapping + && _yaml["webserv"].tag.match(rgx.yaml_tag_is_map)) +) { // cannot be used as is with opt_action FIX look at remaining, decide what to do later if ("data_http" in _yaml["webserv"] && _yaml["webserv"]["data_http"].type.string && _yaml["webserv"]["data_http"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_data_http = _yaml["webserv"]["data_http"].get!string; } + // if (_opt_action.*.length > 0) { if ("cgi_http" in _yaml["webserv"] && _yaml["webserv"]["cgi_http"].type.string && _yaml["webserv"]["cgi_http"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_cgi_http = _yaml["webserv"]["cgi_http"].get!string; } + // if (_opt_action.*.length > 0) { if ("host" in _yaml["webserv"] && _yaml["webserv"]["host"].type.string && _yaml["webserv"]["host"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_host = _yaml["webserv"]["host"].get!string; } - // if ("data_root_url" in _yaml["webserv"] - // && _yaml["webserv"]["data_root_url"].type.string - // && _yaml["webserv"]["data_root_url"].tag.match(rgx.yaml_tag_is_str) - // ) { - // _struct_composite.conf.w_srv_data_root_url = _yaml["webserv"]["data_root_url"].get!string; - // if (auto m = _struct_composite.conf.w_srv_data_root_url.match(rgx.webserv_url_doc_root)) { - // _struct_composite.conf.w_srv_url_host = m.captures[2].to!string; - // _struct_composite.conf.w_srv_url_doc_path = m.captures[3].to!string; - // } - // } - if ("data_root_path" in _yaml["webserv"] - && _yaml["webserv"]["data_root_path"].type.string - && _yaml["webserv"]["data_root_path"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_data_root_path = _yaml["webserv"]["data_root_path"].get!string; - } - if ("data_root_part" in _yaml["webserv"] - && _yaml["webserv"]["data_root_part"].type.string - && _yaml["webserv"]["data_root_part"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_data_root_part = _yaml["webserv"]["data_root_part"].get!string; - } - if ("images_root_part" in _yaml["webserv"] - && _yaml["webserv"]["images_root_part"].type.string - && _yaml["webserv"]["images_root_part"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_images_root_part = _yaml["webserv"]["images_root_part"].get!string; - } if ("data_root_url" in _yaml["webserv"] && _yaml["webserv"]["data_root_url"].type.string && _yaml["webserv"]["data_root_url"].tag.match(rgx.yaml_tag_is_str) @@ -688,59 +874,12 @@ if ("webserv" in _yaml } else { // composite construct _struct_composite.conf.w_srv_cgi_host = _struct_composite.conf.w_srv_host; } - if ("cgi_search_form_title" in _yaml["webserv"] - && _yaml["webserv"]["cgi_search_form_title"].type.string - && _yaml["webserv"]["cgi_search_form_title"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_search_form_title = _yaml["webserv"]["cgi_search_form_title"].get!string; - } if ("cgi_bin_subpath" in _yaml["webserv"] && _yaml["webserv"]["cgi_bin_subpath"].type.string && _yaml["webserv"]["cgi_bin_subpath"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_cgi_bin_subpath = _yaml["webserv"]["cgi_bin_subpath"].get!string; } - if ("cgi_bin_path" in _yaml["webserv"] - && _yaml["webserv"]["cgi_bin_path"].type.string - && _yaml["webserv"]["cgi_bin_path"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_bin_path = _yaml["webserv"]["cgi_bin_path"].get!string; - } - if (_opt_action.cgi_search_title.length > 0) { - _struct_composite.conf.w_srv_cgi_search_title = _opt_action.cgi_search_title; - } else if ("cgi_search_title" in _yaml["webserv"] - && _yaml["webserv"]["cgi_search_title"].type.string - && _yaml["webserv"]["cgi_search_title"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_search_title = _yaml["webserv"]["cgi_search_title"].get!string; - } else { - _struct_composite.conf.w_srv_cgi_search_title = "≅ SiSU spine search form"; - } - if (_opt_action.cgi_sqlite_search_filename.length > 0) { - _struct_composite.conf.w_srv_cgi_search_script = _opt_action.cgi_sqlite_search_filename; - } else if ("cgi_search_script" in _yaml["webserv"] - && _yaml["webserv"]["cgi_search_script"].type.string - && _yaml["webserv"]["cgi_search_script"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_search_script = _yaml["webserv"]["cgi_search_script"].get!string; - } else { - _struct_composite.conf.w_srv_cgi_search_script = "spine_search"; - } - if (_opt_action.cgi_sqlite_search_filename_d.length > 0) { - _struct_composite.conf.w_srv_cgi_search_script_raw_fn_d = _opt_action.cgi_sqlite_search_filename_d; - } else if ("cgi_search_script_raw_fn_d" in _yaml["webserv"] - && _yaml["webserv"]["cgi_search_script_raw_fn_d"].type.string - && _yaml["webserv"]["cgi_search_script_raw_fn_d"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_search_script_raw_fn_d = _yaml["webserv"]["cgi_search_script_raw_fn_d"].get!string; - } else if ("cgi_search_script" in _yaml["webserv"] - && _yaml["webserv"]["cgi_search_script"].type.string - && _yaml["webserv"]["cgi_search_script"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_search_script_raw_fn_d = (_yaml["webserv"]["cgi_search_script"].get!string).translate(['-' : "_"]) ~ ".d"; - } else { - _struct_composite.conf.w_srv_cgi_search_script_raw_fn_d = "spine_search.d"; - } if ("cgi_port" in _yaml["webserv"] && _yaml["webserv"]["cgi_port"].type.string && _yaml["webserv"]["cgi_port"].tag.match(rgx.yaml_tag_is_str) @@ -769,66 +908,14 @@ if ("webserv" in _yaml : _struct_composite.conf.w_srv_host ~ _struct_composite.conf.w_srv_cgi_bin_subpath; } - if (_opt_action.cgi_url_action.length > 0) { - _struct_composite.conf.w_srv_cgi_action = _opt_action.cgi_url_action; - } else if ("cgi_action" in _yaml["webserv"] - && _yaml["webserv"]["cgi_action"].type.string - && _yaml["webserv"]["cgi_action"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_cgi_action = _yaml["webserv"]["cgi_action"].get!string; - } else if (_opt_action.cgi_sqlite_search_filename.length > 0) { // WORKON - _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; - } else { // action is composite, build - } // if ("cgi_file_links" in _yaml["webserv"] // && _yaml["webserv"]["cgi_file_links"].type.string // && _yaml["webserv"]["cgi_file_links"].tag.match(rgx.yaml_tag_is_str) // ) { // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string; // } - if (_opt_action.sqliteDB_filename.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqliteDB_filename; - } else if ("db_sqlite_filename" in _yaml["webserv"] - && _yaml["webserv"]["db_sqlite_filename"].type.string - && _yaml["webserv"]["db_sqlite_filename"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_db_sqlite_filename = _yaml["webserv"]["db_sqlite_filename"].get!string; - } else { // set default ? - } - if (_opt_action.sqliteDB_path.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqliteDB_path; - } else if ("db_sqlite_path" in _yaml["webserv"] - && _yaml["webserv"]["db_sqlite_path"].type.string - && _yaml["webserv"]["db_sqlite_path"].tag.match(rgx.yaml_tag_is_str) - ) { - _struct_composite.conf.w_srv_db_sqlite_path = _yaml["webserv"]["db_sqlite_path"].get!string; - } else { // set default ? - } - } -} -if (!(_struct_composite.conf.output_path)) { - _struct_composite.conf.output_path = ((_manifested.output.path).asNormalizedPath).array; -} -if (_opt_action.output_dir_set.length > 0) { - _struct_composite.conf.output_path = (_opt_action.output_dir_set.asNormalizedPath).array; -} else if ("output" in _yaml - && _yaml["output"].type.sequence -) { - if (_yaml["output"].type.mapping - && _yaml["output"].tag.match(rgx.yaml_tag_is_map) - ) { - if ("path" in _yaml["output"] - && _yaml["output"]["path"].type.string - && _yaml["output"]["path"].tag.match(rgx.yaml_tag_is_str) - ) { - 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; - } - } - } } +// make (in: conf, make, meta)? if ("processing" in _yaml && _yaml["processing"].type.sequence ) { @@ -1054,6 +1141,163 @@ if ("search" in _yaml } #+END_SRC +** make + +#+NAME: yaml_objects_make +#+BEGIN_SRC d +/+ make ------------------------------------------------------------------- +/ +if ("make" in _yaml + && _yaml["make"].type.sequence +) { + if (_yaml["make"].type.mapping + && _yaml["make"].tag.match(rgx.yaml_tag_is_map) + ) { + if ("bold" in _yaml["make"] + && _yaml["make"]["bold"].type.string + && _yaml["make"]["bold"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.bold = _yaml["make"]["bold"].get!string; + } + if ("breaks" in _yaml["make"] + && _yaml["make"]["breaks"].type.string + && _yaml["make"]["breaks"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.breaks = _yaml["make"]["breaks"].get!string; + } + if ("cover_image" in _yaml["make"] + && _yaml["make"]["cover_image"].type.string + && _yaml["make"]["cover_image"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.cover_image = _yaml["make"]["cover_image"].get!string; + } + if ("css" in _yaml["make"] + && _yaml["make"]["css"].type.string + && _yaml["make"]["css"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.css = _yaml["make"]["css"].get!string; + } + if ("emphasis" in _yaml["make"] + && _yaml["make"]["emphasis"].type.string + && _yaml["make"]["emphasis"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.emphasis = _yaml["make"]["emphasis"].get!string; + } + if ("footer" in _yaml["make"] + && _yaml["make"]["footer"].type.string + && _yaml["make"]["footer"].tag.match(rgx.yaml_tag_is_str) + ) { + char[][] __match_footer_array + = (cast(char[]) _yaml["make"]["footer"].get!string) + .split(rgx.make_heading_delimiter); + _struct_composite.make_str.footer = __match_footer_array.to!(string[]); + } + if ("headings" in _yaml["make"] + && _yaml["make"]["headings"].type.string + && _yaml["make"]["headings"].tag.match(rgx.yaml_tag_is_str) + ) { + char[][] __match_headings_array + = (cast(char[]) _yaml["make"]["headings"].get!string) + .split(rgx.make_heading_delimiter); + _struct_composite.make_str.headings = __match_headings_array.to!(string[]); + } else if ("headings" in _yaml["make"] + && _yaml["make"]["headings"].type.string + && _yaml["make"]["headings"].tag.match(rgx.yaml_tag_is_seq) + ) { + foreach(string identify_heading_level; _yaml["make"]["headings"]) { + _struct_composite.make_str.headings ~= identify_heading_level; + } + } + if ("home_button_image" in _yaml["make"] + && _yaml["make"]["home_button_image"].type.string + && _yaml["make"]["home_button_image"].tag.match(rgx.yaml_tag_is_str) + ) { + char[][] __match_home_button_image_array + = (cast(char[]) _yaml["make"]["home_button_image"].get!string) + .split(rgx.make_heading_delimiter); + _struct_composite.make_str.home_button_image = __match_home_button_image_array.to!(string[]); + } + if ("home_button_text" in _yaml["make"] + && _yaml["make"]["home_button_text"].type.string + && _yaml["make"]["home_button_text"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.home_button_text = _yaml["make"]["home_button_text"].get!string; + } else if ("home_button_text" in _yaml["make"] + && _yaml["make"]["home_button_text"].type.string + && _yaml["make"]["home_button_text"].tag.match(rgx.yaml_tag_is_seq) + ) { + _struct_composite.make_str.home_button_text = ""; + foreach(string hbt; _yaml["make"]["home_button_text"]) { + _struct_composite.make_str.home_button_text ~= hbt ~ "; "; + } + } + if ("italics" in _yaml["make"] + && _yaml["make"]["italics"].type.string + && _yaml["make"]["italics"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.italics = _yaml["make"]["italics"].get!string; + } + if ("auto_num_top_at_level" in _yaml["make"] + && _yaml["make"]["auto_num_top_at_level"].type.string + && _yaml["make"]["auto_num_top_at_level"].tag.match(rgx.yaml_tag_is_str) + ) { + _struct_composite.make_str.auto_num_top_at_level = _yaml["make"]["auto_num_top_at_level"].get!string; + switch (_yaml["make"]["auto_num_top_at_level"].get!string) { + case "A": + break; + case "B": _struct_composite.make_str.auto_num_top_lv = 1; + break; + case "C": _struct_composite.make_str.auto_num_top_lv = 2; + break; + case "D": _struct_composite.make_str.auto_num_top_lv = 3; + break; + case "1": _struct_composite.make_str.auto_num_top_lv = 4; + break; + case "2": _struct_composite.make_str.auto_num_top_lv = 5; + break; + case "3": _struct_composite.make_str.auto_num_top_lv = 6; + break; + case "4": _struct_composite.make_str.auto_num_top_lv = 7; + break; + default: + break; + } + } + if ("auto_num_depth" in _yaml["make"] + && _yaml["make"]["auto_num_depth"].type.string + && _yaml["make"]["auto_num_depth"].tag.match(rgx.yaml_tag_is_int) + ) { // not sure implemented for documents + _struct_composite.make_str.auto_num_depth = _yaml["make"]["auto_num_depth"].get!int; + } else if ("auto_num_depth" in _yaml["make"] + && _yaml["make"]["auto_num_depth"].type.string + && _yaml["make"]["auto_num_depth"].tag.match(rgx.yaml_tag_is_str) + ) { // not sure implemented for documents + _struct_composite.make_str.auto_num_depth = _yaml["make"]["auto_num_depth"].get!int; + } + if ("texpdf_font" in _yaml["make"] + && _yaml["make"]["texpdf_font"].type.string + ) { + _struct_composite.make_str.texpdf_font = _yaml["make"]["texpdf_font"].get!string; + } + } + _struct_composite.make.bold = _mk.bold(_struct_composite.make_str.bold); + _struct_composite.make.breaks = _mk.breaks(_struct_composite.make_str.breaks); + _struct_composite.make.cover_image = _mk.cover_image(_struct_composite.make_str.cover_image); + _struct_composite.make.css = _mk.css(_struct_composite.make_str.css); + _struct_composite.make.emphasis = _mk.emphasis(_struct_composite.make_str.emphasis); + _struct_composite.make.footer = _mk.footer(_struct_composite.make_str.footer); + _struct_composite.make.headings = _mk.headings(_struct_composite.make_str.headings); + _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image); + _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text); + _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics); + _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level); + _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv); + _struct_composite.make.auto_num_depth = _mk.auto_num_depth(_struct_composite.make_str.auto_num_depth); + _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute); + _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font); +} + +#+END_SRC + ** meta #+NAME: yaml_objects_meta @@ -2112,11 +2356,12 @@ template configParseYAMLreturnSpineStruct() { doc_reform.meta.conf_make_meta_structs, doc_reform.meta.conf_make_meta_json; mixin contentYAMLtoSpineStruct; - @system auto configParseYAMLreturnSpineStruct(T,CCm,M,O)( + @system auto configParseYAMLreturnSpineStruct(T,CCm,M,O,Cfg)( T _document_struct, CCm _make_and_meta_struct, M _manifested, - O _opt_action + O _opt_action, + Cfg _cfg ){ Node _yaml; if (_document_struct.content.length > 0) { @@ -2129,7 +2374,7 @@ template configParseYAMLreturnSpineStruct() { } try { _make_and_meta_struct - = contentYAMLtoSpineStruct!()(_make_and_meta_struct, _yaml, _manifested, _opt_action, _document_struct.filename); + = contentYAMLtoSpineStruct!()(_make_and_meta_struct, _yaml, _manifested, _opt_action, _cfg, _document_struct.filename); } catch (Throwable) { import std.stdio; writeln("ERROR failed to convert yaml to struct: ", _document_struct.filename); @@ -2163,11 +2408,12 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() { mixin spineRgxIn; mixin contentJSONtoSpineStruct; static auto rgx = RgxI(); - @system auto docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(CCm,Src,M,O)( + @system auto docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(CCm,Src,M,O,Cfg)( Src header_src, CCm _make_and_meta_struct, M _manifested, O _opt_action, + Cfg _cfg, ) { Node _yaml; try { @@ -2175,7 +2421,7 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() { if (("title" in _yaml) && ("creator" in _yaml)) {} else { // need test for _yaml content (does not work) writeln("ERROR failed to read document header, yaml header does not contain essential information related to title and author"); } - return contentYAMLtoSpineStruct!()(_make_and_meta_struct, _yaml, _manifested, _opt_action, "header"); + return contentYAMLtoSpineStruct!()(_make_and_meta_struct, _yaml, _manifested, _opt_action, _cfg, "header"); } catch (Throwable) { writeln("ERROR failed to read document header, header not parsed as yaml: ", _manifested.src.filename); return _make_and_meta_struct; -- cgit v1.2.3