aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2024-12-20 23:59:59 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2024-12-21 00:06:58 -0500
commit369a5b0cae522c49cbbfe7b14d5e3042128a5434 (patch)
tree42a5e65c663a7fd87acb9007ffa0b3f327216f87
parentnix build, flake.nix ldc2-1.40.0 (diff)
refactor yaml extraction code fileHEADmain
-rw-r--r--org/meta_conf_make_meta.org1041
-rw-r--r--org/spine.org16
-rw-r--r--src/sisudoc/meta/conf_make_meta_yaml.d1009
-rw-r--r--src/sisudoc/meta/metadoc.d16
4 files changed, 729 insertions, 1353 deletions
diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org
index 9c62322..0bfb6ee 100644
--- a/org/meta_conf_make_meta.org
+++ b/org/meta_conf_make_meta.org
@@ -15,18 +15,6 @@
#+PROPERTY: header-args+ :mkdirp yes
#+OPTIONS: H:3 num:nil toc:t \n:t ::t |:t ^:nil -:t f:t *:t
-#+NAME: meta_check_input_markup
-#+BEGIN_SRC d
-string check_input_markup()(
- string _txt,
-) {
- _txt = _txt
- .replaceAll(regex(r"\\"), mkup.br_line_inline)
- .strip;
- return _txt;
-}
-#+END_SRC
-
- [[./doc-reform.org][doc-reform.org]] [[./][org/]]
* generic
@@ -553,6 +541,73 @@ JSONValue config_jsonstr = `{
#+END_SRC
* YAML to spineStruct :module:conf_make_meta:yaml:
+
+** check markup
+
+#+NAME: meta_check_input_markup
+#+BEGIN_SRC d
+string check_input_markup()(
+ string _txt,
+) {
+ _txt = _txt
+ .replaceAll(regex(r"\\"), mkup.br_line_inline)
+ .strip;
+ return _txt;
+}
+#+END_SRC
+
+** extract yaml
+
+#+NAME: meta_extract_yaml
+#+BEGIN_SRC d
+@system string _get_yaml_node_string(Y)(
+ Y _yaml,
+ string _return,
+ string _title,
+ string _subtitle,
+ bool _munge=false
+) {
+ if ((_title in _yaml && _yaml[_title].type.sequence)
+ && (_yaml[_title].type.mapping
+ && _yaml[_title].tag.match(rgx_y.yaml_tag_is_map))
+ ) {
+ if (_subtitle in _yaml[_title]
+ && _yaml[_title][_subtitle].type.string
+ && _yaml[_title][_subtitle].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _return = (!(_munge))
+ ? _yaml[_title][_subtitle].get!string
+ : check_input_markup(_yaml[_title][_subtitle].get!string);
+ }
+ }
+ return _return;
+}
+@system int _get_yaml_node_int(Y)(
+ Y _yaml,
+ int _return,
+ string _title,
+ string _subtitle
+) {
+ if ((_title in _yaml && _yaml[_title].type.sequence)
+ && (_yaml[_title].type.mapping
+ && _yaml[_title].tag.match(rgx_y.yaml_tag_is_map))
+ ) {
+ if (_subtitle in _yaml[_title]
+ && _yaml[_title][_subtitle].type.string
+ && _yaml[_title][_subtitle].tag.match(rgx_y.yaml_tag_is_int)
+ ) {
+ _return = _yaml[_title][_subtitle].get!int;
+ } else if (_subtitle in _yaml[_title]
+ && _yaml[_title][_subtitle].type.string
+ && _yaml[_title][_subtitle].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _return = _yaml[_title][_subtitle].get!int;
+ }
+ }
+ return _return;
+}
+#+END_SRC
+
** _module template_
#+HEADER: :tangle "../src/sisudoc/meta/conf_make_meta_yaml.d"
@@ -583,7 +638,7 @@ template contentYAMLtoSpineStruct() {
sisudoc.meta.rgx_yaml,
sisudoc.meta.rgx;
ConfComposite _struct_composite;
- @system auto contentYAMLtoSpineStruct(C,Y,M,O,Cfg)(
+ @system ConfComposite contentYAMLtoSpineStruct(C,Y,M,O,Cfg)(
C _struct_composite,
Y _yaml,
M _manifested,
@@ -596,10 +651,11 @@ template contentYAMLtoSpineStruct() {
mixin spineRgxYamlTags;
static auto rgx_y = RgxYaml();
<<meta_check_input_markup>>
+ <<meta_extract_yaml>>
confCompositeMakeBuild _mk;
if (_identifier != "header") { // called only once per run anyway
<<yaml_objects_conf>>
- } else {
+ } else { // !(_identifier != "header")
<<yaml_objects_make>>
<<yaml_objects_meta>>
}
@@ -614,6 +670,7 @@ template contentYAMLtoSpineStruct() {
#+NAME: yaml_objects_conf
#+BEGIN_SRC d
+string _init_string;
/+ conf ------------------------------------------------------------------- +/
/+
_cfg. build defaults (else program runtime defaults)
@@ -622,145 +679,52 @@ template contentYAMLtoSpineStruct() {
+/
{
if (_opt_action.webserver_http.length > 0) {
- _struct_composite.conf.w_srv_http
- = _opt_action.webserver_http;
+ _struct_composite.conf.w_srv_http = _opt_action.webserver_http;
} else {
- _struct_composite.conf.w_srv_http
- = (_cfg.http_request_type.empty)
- ? "http"
- : _cfg.http_request_type;
- if (("webserv" in _yaml && _yaml["webserv"].type.sequence)
- && (_yaml["webserv"].type.mapping
- && _yaml["webserv"].tag.match(rgx_y.yaml_tag_is_map))
- ) {
- if ("http" in _yaml["webserv"]
- && _yaml["webserv"]["http"].type.string
- && _yaml["webserv"]["http"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_http
- = _yaml["webserv"]["http"].get!string;
- }
- }
+ _init_string = (_cfg.http_request_type.empty) ? "http" : _cfg.http_request_type;
+ _struct_composite.conf.w_srv_http = _get_yaml_node_string(_yaml, _init_string, "webserv", "http");
}
if (_opt_action.cgi_search_title.length > 0) {
- _struct_composite.conf.w_srv_cgi_search_form_title
- = _opt_action.cgi_search_title;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_search_form_title
- = _yaml["webserv"]["cgi_search_form_title"].get!string;
- }
- }
+ _init_string = (_cfg.cgi_search_form_title.empty) ? "≅ SiSU spine search form" : _cfg.cgi_search_form_title;
+ _struct_composite.conf.w_srv_cgi_search_form_title = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_search_form_title");
}
if (_opt_action.cgi_sqlite_search_filename.length > 0) {
- _struct_composite.conf.w_srv_cgi_search_script
- = _opt_action.cgi_sqlite_search_filename;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_search_script
- = _yaml["webserv"]["cgi_search_script"].get!string;
- }
- }
+ _init_string = (_cfg.cgi_filename.empty) ? "spine_search" : _cfg.cgi_filename;
+ _struct_composite.conf.w_srv_cgi_search_script = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_search_script");
}
if (_opt_action.sqliteDB_filename.length > 0) {
- _struct_composite.conf.w_srv_db_sqlite_filename
- = _opt_action.sqliteDB_filename;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_db_sqlite_filename
- = _yaml["webserv"]["db_sqlite_filename"].get!string;
- }
- }
+ _init_string = (_cfg.db_sqlite_filename.empty) ? "spine.search.db" : _cfg.db_sqlite_filename;
+ _struct_composite.conf.w_srv_db_sqlite_filename = _get_yaml_node_string(_yaml, _init_string, "webserv", "db_sqlite_filename");
}
if (_opt_action.sqliteDB_path.length > 0) {
- _struct_composite.conf.w_srv_db_sqlite_path
- = _opt_action.sqliteDB_path;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_db_sqlite_path
- = _yaml["webserv"]["db_sqlite_path"].get!string;
- }
- }
+ _init_string = (_cfg.db_sqlite_path.empty) ? "/var/www/sqlite" : _cfg.db_sqlite_path;
+ _struct_composite.conf.w_srv_db_sqlite_path = _get_yaml_node_string(_yaml, _init_string, "webserv", "db_sqlite_path");
}
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_y.yaml_tag_is_map))
- ) {
- if ("cgi_action" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_action"].type.string
- && _yaml["webserv"]["cgi_action"].tag.match(rgx_y.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;
- }
+ _init_string = (_cfg.www_url_doc_root.empty) ? "http://locahost" : _cfg.www_url_doc_root; // "https://sisudoc.org"
+ _struct_composite.conf.w_srv_cgi_action = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_action");
+ 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; // not yet right
}
}
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;
+ _struct_composite.conf.output_path = (_opt_action.output_dir_set.asNormalizedPath).array;
} else {
- _struct_composite.conf.output_path
- = (_cfg.processing_path_doc_root.empty)
- ? "/srv/www/spine"
- : _cfg.processing_path_doc_root;
+ _struct_composite.conf.output_path = (_cfg.processing_path_doc_root.empty) ? "/srv/www/spine" : _cfg.processing_path_doc_root;
if (("webserv" in _yaml && _yaml["webserv"].type.sequence)
&& (_yaml["webserv"].type.mapping
&& _yaml["webserv"].tag.match(rgx_y.yaml_tag_is_map))
@@ -782,75 +746,23 @@ template contentYAMLtoSpineStruct() {
}
}
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;
+ _struct_composite.conf.w_srv_data_root_path = _opt_action.webserver_host_doc_root;
} else {
- _struct_composite.conf.w_srv_data_root_path
- = (_cfg.processing_path_doc_root.empty)
- ? "/var/www/spine"
- : _cfg.processing_path_doc_root;
- if (("webserv" in _yaml && _yaml["webserv"].type.sequence)
- && (_yaml["webserv"].type.mapping
- && _yaml["webserv"].tag.match(rgx_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_data_root_path
- = _yaml["webserv"]["data_root_path"].get!string;
- }
- }
+ _init_string = (_cfg.processing_path_doc_root.empty) ? "/var/www/spine" : _cfg.processing_path_doc_root;
+ _struct_composite.conf.w_srv_data_root_path = _get_yaml_node_string(_yaml, _init_string, "webserv", "data_root_path");
}
}
if (_opt_action.cgi_bin_root.length > 0) {
- _struct_composite.conf.w_srv_cgi_bin_path
- = _opt_action.cgi_bin_root;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_bin_path
- = _yaml["webserv"]["cgi_bin_path"].get!string;
- }
- }
- }
- { _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_y.yaml_tag_is_map))
- ) {
- if ("data_root_part" in _yaml["webserv"]
- && _yaml["webserv"]["data_root_part"].type.string
- && _yaml["webserv"]["data_root_part"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_data_root_part = _yaml["webserv"]["data_root_part"].get!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_y.yaml_tag_is_map))
- ) {
- if ("images_root_part" in _yaml["webserv"]
- && _yaml["webserv"]["images_root_part"].type.string
- && _yaml["webserv"]["images_root_part"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_images_root_part = _yaml["webserv"]["images_root_part"].get!string;
- }
- }
+ _init_string = (_cfg.cgi_bin_root.empty) ? "/var/www/cgi/cgi-bin" : _cfg.cgi_bin_root;
+ _struct_composite.conf.w_srv_cgi_bin_path = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_bin_path");
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "data_root_part");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_data_root_part = _init_string; }
+ } {
+ _init_string = "image"; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "images_root_part");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_images_root_part = _init_string; }
}
}
if (("webserv" in _yaml
@@ -858,106 +770,68 @@ if (("webserv" in _yaml
&& (_yaml["webserv"].type.mapping
&& _yaml["webserv"].tag.match(rgx_y.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_y.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_y.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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_data_root_url = _yaml["webserv"]["data_root_url"].get!string;
- _struct_composite.conf.w_srv_data_root_url_html =
- _yaml["webserv"]["data_root_url"].get!string
- ~ _struct_composite.conf.w_srv_data_root_part ~ "/"
- ~ _manifested.src.language ~ "/"
- ~ "html";
- } else {
- _struct_composite.conf.w_srv_data_root_url = _struct_composite.conf.w_srv_data_root_part;
- _struct_composite.conf.w_srv_data_root_url_html =
- _struct_composite.conf.w_srv_data_root_part ~ "/"
- ~ _manifested.src.language ~ "/"
- ~ "html";
- }
- if ("cgi_host" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_host"].type.string
- && _yaml["webserv"]["cgi_host"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_host = _yaml["webserv"]["cgi_host"].get!string;
- } else { // composite construct
- _struct_composite.conf.w_srv_cgi_host = _struct_composite.conf.w_srv_host;
- }
- if ("cgi_bin_subpath" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_bin_subpath"].type.string
- && _yaml["webserv"]["cgi_bin_subpath"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_bin_subpath = _yaml["webserv"]["cgi_bin_subpath"].get!string;
- }
- if ("cgi_port" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_port"].type.string
- && _yaml["webserv"]["cgi_port"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_port = _yaml["webserv"]["cgi_port"].get!string;
- }
- if ("cgi_user" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_user"].type.string
- && _yaml["webserv"]["cgi_user"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_user = _yaml["webserv"]["cgi_user"].get!string;
- }
- if ("cgi_bin_url" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_bin_url"].type.string
- && _yaml["webserv"]["cgi_bin_url"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_bin_url = _yaml["webserv"]["cgi_bin_url"].get!string;
- } else {
- _struct_composite.conf.w_srv_cgi_bin_url =
- (_struct_composite.conf.w_srv_cgi_http.empty)
- ? _struct_composite.conf.w_srv_http
- :_struct_composite.conf.w_srv_cgi_http
- ~ "://"
- ~ (_struct_composite.conf.w_srv_cgi_host.empty)
- ? _struct_composite.conf.w_srv_cgi_host
- : _struct_composite.conf.w_srv_host
- ~ _struct_composite.conf.w_srv_cgi_bin_subpath;
- }
- // if ("cgi_file_links" in _yaml["webserv"]
- // && _yaml["webserv"]["cgi_file_links"].type.string
- // && _yaml["webserv"]["cgi_file_links"].tag.match(rgx_y.yaml_tag_is_str)
- // ) {
- // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string;
- // }
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "data_http");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_data_http = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_http");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_http = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "host");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_host = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_bin_subpath");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_bin_subpath = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_port");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_port = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_user");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_user = _init_string; }
+ }
+ if ("data_root_url" in _yaml["webserv"]
+ && _yaml["webserv"]["data_root_url"].type.string
+ && _yaml["webserv"]["data_root_url"].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _struct_composite.conf.w_srv_data_root_url = _yaml["webserv"]["data_root_url"].get!string;
+ _struct_composite.conf.w_srv_data_root_url_html =
+ _yaml["webserv"]["data_root_url"].get!string
+ ~ _struct_composite.conf.w_srv_data_root_part ~ "/"
+ ~ _manifested.src.language ~ "/"
+ ~ "html";
+ } else {
+ _struct_composite.conf.w_srv_data_root_url = _struct_composite.conf.w_srv_data_root_part;
+ _struct_composite.conf.w_srv_data_root_url_html =
+ _struct_composite.conf.w_srv_data_root_part ~ "/"
+ ~ _manifested.src.language ~ "/"
+ ~ "html";
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_host");
+ _struct_composite.conf.w_srv_cgi_host = (!(_init_string.empty)) ? _init_string : _struct_composite.conf.w_srv_host;
+ }
+ if ("cgi_bin_url" in _yaml["webserv"]
+ && _yaml["webserv"]["cgi_bin_url"].type.string
+ && _yaml["webserv"]["cgi_bin_url"].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _struct_composite.conf.w_srv_cgi_bin_url = _yaml["webserv"]["cgi_bin_url"].get!string;
+ } else {
+ _struct_composite.conf.w_srv_cgi_bin_url =
+ (_struct_composite.conf.w_srv_cgi_http.empty) ? _struct_composite.conf.w_srv_http :_struct_composite.conf.w_srv_cgi_http
+ ~ "://"
+ ~ (_struct_composite.conf.w_srv_cgi_host.empty) ? _struct_composite.conf.w_srv_cgi_host : _struct_composite.conf.w_srv_host
+ ~ _struct_composite.conf.w_srv_cgi_bin_subpath;
+ }
+ // if ("cgi_file_links" in _yaml["webserv"]
+ // && _yaml["webserv"]["cgi_file_links"].type.string
+ // && _yaml["webserv"]["cgi_file_links"].tag.match(rgx_y.yaml_tag_is_str)
+ // ) {
+ // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string;
+ // }
}
// make (in: conf, make, meta)?
-if ("processing" in _yaml
- && _yaml["processing"].type.sequence
-) {
- if (_yaml["processing"].type.mapping
- && _yaml["processing"].tag.match(rgx_y.yaml_tag_is_map)
- ) {
- if ("concord_max" in _yaml["processing"]
- && _yaml["processing"]["concord_max"].type.string
- && _yaml["processing"]["concord_max"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.processing_concord_max = _yaml["processing"]["concord_max"].get!string;
- }
- }
+{
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "processing", "concord_max");
+ if (!(_init_string.empty)) { _struct_composite.conf.processing_concord_max = _init_string; }
}
if ("flag" in _yaml
&& _yaml["flag"].type.sequence
@@ -965,65 +839,36 @@ if ("flag" in _yaml
if (_yaml["flag"].type.mapping
&& _yaml["flag"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("act0" in _yaml["flag"]
- && _yaml["flag"]["act0"].type.string
- && _yaml["flag"]["act0"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act0 = _yaml["flag"]["act0"].get!string;
- }
- if ("act1" in _yaml["flag"]
- && _yaml["flag"]["act1"].type.string
- && _yaml["flag"]["act1"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act1 = _yaml["flag"]["act1"].get!string;
- }
- if ("act2" in _yaml["flag"]
- && _yaml["flag"]["act2"].type.string
- && _yaml["flag"]["act2"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act2 = _yaml["flag"]["act2"].get!string;
- }
- if ("act3" in _yaml["flag"]
- && _yaml["flag"]["act3"].type.string
- && _yaml["flag"]["act3"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act3 = _yaml["flag"]["act3"].get!string;
- }
- if ("act4" in _yaml["flag"]
- && _yaml["flag"]["act4"].type.string
- && _yaml["flag"]["act4"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act4 = _yaml["flag"]["act4"].get!string;
- }
- if ("act5" in _yaml["flag"]
- && _yaml["flag"]["act5"].type.string
- && _yaml["flag"]["act5"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act5 = _yaml["flag"]["act5"].get!string;
- }
- if ("act6" in _yaml["flag"]
- && _yaml["flag"]["act6"].type.string
- && _yaml["flag"]["act6"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act6 = _yaml["flag"]["act6"].get!string;
- }
- if ("act7" in _yaml["flag"]
- && _yaml["flag"]["act7"].type.string
- && _yaml["flag"]["act7"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act7 = _yaml["flag"]["act7"].get!string;
- }
- if ("act8" in _yaml["flag"]
- && _yaml["flag"]["act8"].type.string
- && _yaml["flag"]["act8"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act8 = _yaml["flag"]["act8"].get!string;
- }
- if ("act9" in _yaml["flag"]
- && _yaml["flag"]["act9"].type.string
- && _yaml["flag"]["act9"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act9 = _yaml["flag"]["act9"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act0");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act0 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act1");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act1 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act2");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act2 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act3");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act3 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act4");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act4 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act5");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act5 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act6");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act6 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act7");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act7 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act8");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act8 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act9");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act9 = _init_string; }
}
}
}
@@ -1089,20 +934,11 @@ string[] selected_papersize(string _sizes_str) {
}
string _set_papersize;
if (_opt_action.latex_papersize.length > 0) {
- _set_papersize
- = _opt_action.latex_papersize;
+ _set_papersize = _opt_action.latex_papersize;
} else {
- _set_papersize
- = (_cfg.default_papersize.empty)
- ? "a4,letter.portrait"
- : _cfg.default_papersize;
- if ("papersize" in _yaml["default"]
- && _yaml["default"]["papersize"].type.string
- && _yaml["default"]["papersize"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _set_papersize
- = _yaml["default"]["papersize"].get!string;
- }
+ _set_papersize = (_cfg.default_papersize.empty) ? "a4,letter.portrait" : _cfg.default_papersize;
+ _init_string = _set_papersize; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "papersize");
+ if (!(_init_string.empty)) { _set_papersize = _init_string; }
}
_struct_composite.conf.set_papersize = selected_papersize(_set_papersize);
if (
@@ -1111,29 +947,18 @@ if (
&& _yaml["default"].type.mapping
&& _yaml["default"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("text_wrap" in _yaml["default"]
- && _yaml["default"]["text_wrap"].type.string
- && _yaml["default"]["text_wrap"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_text_wrap = _yaml["default"]["text_wrap"].get!string;
- }
- if ("emphasis" in _yaml["default"]
- && _yaml["default"]["emphasis"].type.string
- && _yaml["default"]["emphasis"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_emphasis = _yaml["default"]["emphasis"].get!string;
- }
- if ("language" in _yaml["default"]
- && _yaml["default"]["language"].type.string
- && _yaml["default"]["language"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_language = _yaml["default"]["language"].get!string;
- }
- if ("digest" in _yaml["default"]
- && _yaml["default"]["digest"].type.string
- && _yaml["default"]["digest"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_digest = _yaml["default"]["digest"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "text_wrap");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_text_wrap = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "emphasis");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_emphasis = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "language");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_language = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "digest");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_digest = _init_string; }
}
}
if ("search" in _yaml
@@ -1142,29 +967,18 @@ if ("search" in _yaml
if (_yaml["search"].type.mapping
&& _yaml["search"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("flag" in _yaml["search"]
- && _yaml["search"]["flag"].type.string
- && _yaml["search"]["flag"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_flag = _yaml["search"]["flag"].get!string;
- }
- if ("action" in _yaml["search"]
- && _yaml["search"]["action"].type.string
- && _yaml["search"]["action"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_action = _yaml["search"]["action"].get!string;
- }
- if ("db" in _yaml["search"]
- && _yaml["search"]["db"].type.string
- && _yaml["search"]["db"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_db = _yaml["search"]["db"].get!string;
- }
- if ("title" in _yaml["search"]
- && _yaml["search"]["title"].type.string
- && _yaml["search"]["title"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_title = _yaml["search"]["title"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "flag");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_flag = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "action");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_action = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "db");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_db = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "title");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_title = _init_string; }
}
}
}
@@ -1174,6 +988,8 @@ if ("search" in _yaml
#+NAME: yaml_objects_make
#+BEGIN_SRC d
+string _init_string;
+int _init_int;
/+ make ------------------------------------------------------------------- +/
if ("make" in _yaml
&& _yaml["make"].type.sequence
@@ -1181,41 +997,24 @@ if ("make" in _yaml
if (_yaml["make"].type.mapping
&& _yaml["make"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("doc_type" in _yaml["make"]
- && _yaml["make"]["doc_type"].type.string
- && _yaml["make"]["doc_type"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.doc_type = _yaml["make"]["doc_type"].get!string;
- }
- if ("breaks" in _yaml["make"]
- && _yaml["make"]["breaks"].type.string
- && _yaml["make"]["breaks"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.breaks = _yaml["make"]["breaks"].get!string;
- }
- if ("bold" in _yaml["make"]
- && _yaml["make"]["bold"].type.string
- && _yaml["make"]["bold"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.bold = _yaml["make"]["bold"].get!string;
- }
- if ("cover_image" in _yaml["make"]
- && _yaml["make"]["cover_image"].type.string
- && _yaml["make"]["cover_image"].tag.match(rgx_y.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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.emphasis = _yaml["make"]["emphasis"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "doc_type");
+ if (!(_init_string.empty)) { _struct_composite.make_str.doc_type = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "breaks");
+ if (!(_init_string.empty)) { _struct_composite.make_str.breaks = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "bold");
+ if (!(_init_string.empty)) { _struct_composite.make_str.bold = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "cover_image");
+ if (!(_init_string.empty)) { _struct_composite.make_str.cover_image = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "css");
+ if (!(_init_string.empty)) { _struct_composite.make_str.css = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "emphasis");
+ if (!(_init_string.empty)) { _struct_composite.make_str.emphasis = _init_string; }
}
if ("footer" in _yaml["make"]
&& _yaml["make"]["footer"].type.string
@@ -1307,16 +1106,9 @@ if ("make" in _yaml
break;
}
}
- if ("auto_num_depth" in _yaml["make"]
- && _yaml["make"]["auto_num_depth"].type.string
- && _yaml["make"]["auto_num_depth"].tag.match(rgx_y.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_y.yaml_tag_is_str)
- ) { // not sure implemented for documents
- _struct_composite.make_str.auto_num_depth = _yaml["make"]["auto_num_depth"].get!int;
+ {
+ _init_int = _get_yaml_node_int(_yaml, 99, "make", "auto_num_depth");
+ if (!(_init_int == 99)) { _struct_composite.make_str.auto_num_depth = _init_int; }
}
if ("texpdf_font" in _yaml["make"]
&& _yaml["make"]["texpdf_font"].type.string
@@ -1355,29 +1147,18 @@ if (_struct_composite.meta.creator_author.empty) {
if (_yaml["creator"].type.mapping
&& _yaml["creator"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("author" in _yaml["creator"]
- && _yaml["creator"]["author"].type.string
- && _yaml["creator"]["author"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_author = _yaml["creator"]["author"].get!string;
- }
- if ("email" in _yaml["creator"]
- && _yaml["creator"]["email"].type.string
- && _yaml["creator"]["email"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_author_email = _yaml["creator"]["email"].get!string;
- }
- if ("illustrator" in _yaml["creator"]
- && _yaml["creator"]["illustrator"].type.string
- && _yaml["creator"]["illustrator"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_illustrator = _yaml["creator"]["illustrator"].get!string;
- }
- if ("translator" in _yaml["creator"]
- && _yaml["creator"]["translator"].type.string
- && _yaml["creator"]["translator"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_translator = _yaml["creator"]["translator"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "author");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_author = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "email");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_author_email = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "illustrator");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_illustrator = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "translator");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_translator = _init_string; }
}
} else if (_yaml["creator"].type.string
&& _yaml["creator"].tag.match(rgx_y.yaml_tag_is_str)
@@ -1433,43 +1214,27 @@ if (_struct_composite.meta.title_main.empty) {
) {
_struct_composite.meta.title_main = _yaml["title"]["title"].get!string;
}
- if ("edition" in _yaml["title"]
- && _yaml["title"]["edition"].type.string
- && _yaml["title"]["edition"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_edition = _yaml["title"]["edition"].get!string;
- }
- if ("full" in _yaml["title"]
- && _yaml["title"]["full"].type.string
- && _yaml["title"]["full"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_full = _yaml["title"]["full"].get!string;
- }
- if ("language" in _yaml["title"]
- && _yaml["title"]["language"].type.string
- && _yaml["title"]["language"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_language = _yaml["title"]["language"].get!string;
- }
- if ("note" in _yaml["title"]
- && _yaml["title"]["note"].type.string
- && _yaml["title"]["note"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_note = _yaml["title"]["note"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "edition");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_edition = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "full");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_full = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "language");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_language = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "note");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_note = _init_string; }
}
- if ("subtitle" in _yaml["title"]
- && _yaml["title"]["subtitle"].type.string
- && _yaml["title"]["subtitle"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_subtitle = _yaml["title"]["subtitle"].get!string;
- } else if ("sub" in _yaml["title"]
- && _yaml["title"]["sub"].type.string
- && _yaml["title"]["sub"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_subtitle = _yaml["title"]["sub"].get!string;
+ if ("subtitle" in _yaml["title"]) {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "subtitle");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_subtitle = _init_string; }
+ } else if ("sub" in _yaml["title"]) {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "sub");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_subtitle = _init_string; }
}
- } else if (
- _yaml["title"].type.string
+ } else if (_yaml["title"].type.string
&& _yaml["title"].tag.match(rgx_y.yaml_tag_is_str)
) {
_struct_composite.meta.title_main = _yaml["title"].get!string;
@@ -1494,23 +1259,15 @@ if ("classify" in _yaml
if (_yaml["classify"].type.mapping
&& _yaml["classify"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("dewey" in _yaml["classify"]
- && _yaml["classify"]["dewey"].type.string
- && _yaml["classify"]["dewey"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.classify_dewey = _yaml["classify"]["dewey"].get!string;
- }
- if ("loc" in _yaml["classify"]
- && _yaml["classify"]["loc"].type.string
- && _yaml["classify"]["loc"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.classify_loc = _yaml["classify"]["loc"].get!string;
- }
- if ("keywords" in _yaml["classify"]
- && _yaml["classify"]["keywords"].type.string
- && _yaml["classify"]["keywords"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.classify_keywords = _yaml["classify"]["keywords"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "classify", "dewey");
+ if (!(_init_string.empty)) { _struct_composite.meta.classify_dewey = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "classify", "loc");
+ if (!(_init_string.empty)) { _struct_composite.meta.classify_loc = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "classify", "keywords");
+ if (!(_init_string.empty)) { _struct_composite.meta.classify_keywords = _init_string; }
}
if ("topic_register" in _yaml["classify"]
&& _yaml["classify"]["topic_register"].type.string
@@ -1564,47 +1321,27 @@ if ("date" in _yaml
if (_yaml["date"].type.mapping
&& _yaml["date"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("added_to_site" in _yaml["date"]
- && _yaml["date"]["added_to_site"].type.string
- && _yaml["date"]["added_to_site"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_added_to_site = _yaml["date"]["added_to_site"].get!string;
- }
- if ("available" in _yaml["date"]
- && _yaml["date"]["available"].type.string
- && _yaml["date"]["available"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_available = _yaml["date"]["available"].get!string;
- }
- if ("created" in _yaml["date"]
- && _yaml["date"]["created"].type.string
- && _yaml["date"]["created"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_created = _yaml["date"]["created"].get!string;
- }
- if ("issued" in _yaml["date"]
- && _yaml["date"]["issued"].type.string
- && _yaml["date"]["issued"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_issued = _yaml["date"]["issued"].get!string;
- }
- if ("modified" in _yaml["date"]
- && _yaml["date"]["modified"].type.string
- && _yaml["date"]["modified"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_modified = _yaml["date"]["modified"].get!string;
- }
- if ("published" in _yaml["date"]
- && _yaml["date"]["published"].type.string
- && _yaml["date"]["published"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_published = _yaml["date"]["published"].get!string;
- }
- if ("valid" in _yaml["date"]
- && _yaml["date"]["valid"].type.string
- && _yaml["date"]["valid"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_valid = _yaml["date"]["valid"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "added_to_site");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_added_to_site = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "available");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_available = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "created");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_created = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "issued");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_issued = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "modified");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_modified = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "published");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_published = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "valid");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_valid = _init_string; }
}
}
}
@@ -1620,23 +1357,15 @@ if ("notes" in _yaml
if (_yaml["notes"].type.mapping
&& _yaml["notes"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("abstract" in _yaml["notes"]
- && _yaml["notes"]["abstract"].type.string
- && _yaml["notes"]["abstract"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.notes_abstract = _yaml["notes"]["abstract"].get!string;
- }
- if ("description" in _yaml["notes"]
- && _yaml["notes"]["description"].type.string
- && _yaml["notes"]["description"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.notes_description = _yaml["notes"]["description"].get!string;
- }
- if ("summary" in _yaml["notes"]
- && _yaml["notes"]["summary"].type.string
- && _yaml["notes"]["summary"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.notes_summary = _yaml["notes"]["summary"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "notes", "abstract");
+ if (!(_init_string.empty)) { _struct_composite.meta.notes_abstract = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "notes", "description");
+ if (!(_init_string.empty)) { _struct_composite.meta.notes_description = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "notes", "summary");
+ if (!(_init_string.empty)) { _struct_composite.meta.notes_summary = _init_string; }
}
}
}
@@ -1646,29 +1375,18 @@ if ("original" in _yaml
if (_yaml["original"].type.mapping
&& _yaml["original"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("language" in _yaml["original"]
- && _yaml["original"]["language"].type.string
- && _yaml["original"]["language"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_language = _yaml["original"]["language"].get!string;
- }
- if ("language_char" in _yaml["original"]
- && _yaml["original"]["language_char"].type.string
- && _yaml["original"]["language_char"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_language_char = _yaml["original"]["language_char"].get!string;
- }
- if ("source" in _yaml["original"]
- && _yaml["original"]["source"].type.string
- && _yaml["original"]["source"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_source = _yaml["original"]["source"].get!string;
- }
- if ("title" in _yaml["original"]
- && _yaml["original"]["title"].type.string
- && _yaml["original"]["title"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_title = _yaml["original"]["title"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "language");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_language = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "language_char");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_language_char = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "source");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_source = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "title");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_title = _init_string; }
}
}
}
@@ -1683,59 +1401,34 @@ if ("rights" in _yaml
if (_yaml["rights"].type.mapping
&& _yaml["rights"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("copyright" in _yaml["rights"]
- && _yaml["rights"]["copyright"].type.string
- && _yaml["rights"]["copyright"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright = check_input_markup(_yaml["rights"]["copyright"].get!string);
- }
- if ("copyright_text" in _yaml["rights"]
- && _yaml["rights"]["copyright_text"].type.string
- && _yaml["rights"]["copyright_text"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_text = _yaml["rights"]["copyright_text"].get!string;
- }
- if ("copyright_audio" in _yaml["rights"]
- && _yaml["rights"]["copyright_audio"].type.string
- && _yaml["rights"]["copyright_audio"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_audio = _yaml["rights"]["copyright_audio"].get!string;
- }
- if ("copyright_cover" in _yaml["rights"]
- && _yaml["rights"]["copyright_cover"].type.string
- && _yaml["rights"]["copyright_cover"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_cover = _yaml["rights"]["copyright_cover"].get!string;
- }
- if ("copyright_illustrations" in _yaml["rights"]
- && _yaml["rights"]["copyright_illustrations"].type.string
- && _yaml["rights"]["copyright_illustrations"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_illustrations = _yaml["rights"]["copyright_illustrations"].get!string;
- }
- if ("copyright_photographs" in _yaml["rights"]
- && _yaml["rights"]["copyright_photographs"].type.string
- && _yaml["rights"]["copyright_photographs"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_photographs = _yaml["rights"]["copyright_photographs"].get!string;
- }
- if ("copyright_translation" in _yaml["rights"]
- && _yaml["rights"]["copyright_translation"].type.string
- && _yaml["rights"]["copyright_translation"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_translation = _yaml["rights"]["copyright_translation"].get!string;
- }
- if ("copyright_video" in _yaml["rights"]
- && _yaml["rights"]["copyright_video"].type.string
- && _yaml["rights"]["copyright_video"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_video = _yaml["rights"]["copyright_video"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright", true);
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_text");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_text = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_audio");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_audio = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_cover");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_cover = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_illustrations");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_illustrations = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_photographs");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_photographs = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_translation");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_translation = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_video");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_video = _init_string; }
}
- if ("license" in _yaml["rights"]
- && _yaml["rights"]["license"].type.string
- && _yaml["rights"]["license"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_license = check_input_markup(_yaml["rights"]["license"].get!string);
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "license", true);
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_license = _init_string; }
}
}
}
@@ -2427,12 +2120,12 @@ template configParseYAMLreturnSpineStruct() {
sisudoc.meta.conf_make_meta_structs,
sisudoc.meta.conf_make_meta_json;
mixin contentYAMLtoSpineStruct;
- @system auto configParseYAMLreturnSpineStruct(T,CCm,M,O,Cfg)(
- T _document_struct,
- CCm _make_and_meta_struct,
- M _manifested,
- O _opt_action,
- Cfg _cfg
+ @system ConfComposite configParseYAMLreturnSpineStruct(T,M,O,Cfg)(
+ T _document_struct,
+ ConfComposite _make_and_meta_struct,
+ M _manifested,
+ O _opt_action,
+ Cfg _cfg
){
Node _yaml;
if (_document_struct.content.length > 0) {
@@ -2465,7 +2158,7 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() {
std.exception,
std.regex,
std.stdio,
- std.traits,
+ // std.traits,
std.typecons,
std.utf,
std.conv : to;
@@ -2481,12 +2174,12 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() {
static auto rgx = RgxI();
mixin spineRgxYamlTags;
static auto rgx_y = RgxYaml();
- @system auto docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(CCm,Src,M,O,Cfg)(
- Src header_src,
- CCm _make_and_meta_struct,
- M _manifested,
- O _opt_action,
- Cfg _cfg,
+ @system ConfComposite docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(Src,M,O,Cfg)(
+ Src header_src,
+ ConfComposite _make_and_meta_struct,
+ M _manifested,
+ O _opt_action,
+ Cfg _cfg,
) {
Node _yaml;
try {
diff --git a/org/spine.org b/org/spine.org
index d185adb..ac9eb55 100644
--- a/org/spine.org
+++ b/org/spine.org
@@ -1467,13 +1467,13 @@ template spineAbstraction() {
<<spine_metadoc_mixin>>
enum makeMeta { make, meta }
enum docAbst { doc_abstract_obj, doc_has }
- @system auto spineAbstraction(E,P,O,Cfg,M,S)(
- E _env,
- P program_info,
- O _opt_action,
- Cfg _cfg,
- M _manifest,
- S _make_and_meta_struct
+ @system auto spineAbstraction(E,P,O,Cfg,M)(
+ E _env,
+ P program_info,
+ O _opt_action,
+ Cfg _cfg,
+ M _manifest,
+ ConfComposite _make_and_meta_struct
){
<<spine_conf_files_in_yaml>>
<<spine_each_file_do_read_and_split_dr_markup_file_content_into_header_and_body>>
@@ -1691,7 +1691,7 @@ auto generated_time() {
#+NAME: spine_each_file_do_document_matters_2_meta
#+BEGIN_SRC d
-auto conf_make_meta() {
+ConfComposite conf_make_meta() {
return _make_and_meta_struct;
}
auto doc_digest() {
diff --git a/src/sisudoc/meta/conf_make_meta_yaml.d b/src/sisudoc/meta/conf_make_meta_yaml.d
index 5712bcf..ee44200 100644
--- a/src/sisudoc/meta/conf_make_meta_yaml.d
+++ b/src/sisudoc/meta/conf_make_meta_yaml.d
@@ -71,7 +71,7 @@ template contentYAMLtoSpineStruct() {
sisudoc.meta.rgx_yaml,
sisudoc.meta.rgx;
ConfComposite _struct_composite;
- @system auto contentYAMLtoSpineStruct(C,Y,M,O,Cfg)(
+ @system ConfComposite contentYAMLtoSpineStruct(C,Y,M,O,Cfg)(
C _struct_composite,
Y _yaml,
M _manifested,
@@ -91,8 +91,55 @@ template contentYAMLtoSpineStruct() {
.strip;
return _txt;
}
+ @system string _get_yaml_node_string(Y)(
+ Y _yaml,
+ string _return,
+ string _title,
+ string _subtitle,
+ bool _munge=false
+ ) {
+ if ((_title in _yaml && _yaml[_title].type.sequence)
+ && (_yaml[_title].type.mapping
+ && _yaml[_title].tag.match(rgx_y.yaml_tag_is_map))
+ ) {
+ if (_subtitle in _yaml[_title]
+ && _yaml[_title][_subtitle].type.string
+ && _yaml[_title][_subtitle].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _return = (!(_munge))
+ ? _yaml[_title][_subtitle].get!string
+ : check_input_markup(_yaml[_title][_subtitle].get!string);
+ }
+ }
+ return _return;
+ }
+ @system int _get_yaml_node_int(Y)(
+ Y _yaml,
+ int _return,
+ string _title,
+ string _subtitle
+ ) {
+ if ((_title in _yaml && _yaml[_title].type.sequence)
+ && (_yaml[_title].type.mapping
+ && _yaml[_title].tag.match(rgx_y.yaml_tag_is_map))
+ ) {
+ if (_subtitle in _yaml[_title]
+ && _yaml[_title][_subtitle].type.string
+ && _yaml[_title][_subtitle].tag.match(rgx_y.yaml_tag_is_int)
+ ) {
+ _return = _yaml[_title][_subtitle].get!int;
+ } else if (_subtitle in _yaml[_title]
+ && _yaml[_title][_subtitle].type.string
+ && _yaml[_title][_subtitle].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _return = _yaml[_title][_subtitle].get!int;
+ }
+ }
+ return _return;
+ }
confCompositeMakeBuild _mk;
if (_identifier != "header") { // called only once per run anyway
+ string _init_string;
/+ conf ------------------------------------------------------------------- +/
/+
_cfg. build defaults (else program runtime defaults)
@@ -101,145 +148,52 @@ template contentYAMLtoSpineStruct() {
+/
{
if (_opt_action.webserver_http.length > 0) {
- _struct_composite.conf.w_srv_http
- = _opt_action.webserver_http;
+ _struct_composite.conf.w_srv_http = _opt_action.webserver_http;
} else {
- _struct_composite.conf.w_srv_http
- = (_cfg.http_request_type.empty)
- ? "http"
- : _cfg.http_request_type;
- if (("webserv" in _yaml && _yaml["webserv"].type.sequence)
- && (_yaml["webserv"].type.mapping
- && _yaml["webserv"].tag.match(rgx_y.yaml_tag_is_map))
- ) {
- if ("http" in _yaml["webserv"]
- && _yaml["webserv"]["http"].type.string
- && _yaml["webserv"]["http"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_http
- = _yaml["webserv"]["http"].get!string;
- }
- }
+ _init_string = (_cfg.http_request_type.empty) ? "http" : _cfg.http_request_type;
+ _struct_composite.conf.w_srv_http = _get_yaml_node_string(_yaml, _init_string, "webserv", "http");
}
if (_opt_action.cgi_search_title.length > 0) {
- _struct_composite.conf.w_srv_cgi_search_form_title
- = _opt_action.cgi_search_title;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_search_form_title
- = _yaml["webserv"]["cgi_search_form_title"].get!string;
- }
- }
+ _init_string = (_cfg.cgi_search_form_title.empty) ? "≅ SiSU spine search form" : _cfg.cgi_search_form_title;
+ _struct_composite.conf.w_srv_cgi_search_form_title = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_search_form_title");
}
if (_opt_action.cgi_sqlite_search_filename.length > 0) {
- _struct_composite.conf.w_srv_cgi_search_script
- = _opt_action.cgi_sqlite_search_filename;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_search_script
- = _yaml["webserv"]["cgi_search_script"].get!string;
- }
- }
+ _init_string = (_cfg.cgi_filename.empty) ? "spine_search" : _cfg.cgi_filename;
+ _struct_composite.conf.w_srv_cgi_search_script = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_search_script");
}
if (_opt_action.sqliteDB_filename.length > 0) {
- _struct_composite.conf.w_srv_db_sqlite_filename
- = _opt_action.sqliteDB_filename;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_db_sqlite_filename
- = _yaml["webserv"]["db_sqlite_filename"].get!string;
- }
- }
+ _init_string = (_cfg.db_sqlite_filename.empty) ? "spine.search.db" : _cfg.db_sqlite_filename;
+ _struct_composite.conf.w_srv_db_sqlite_filename = _get_yaml_node_string(_yaml, _init_string, "webserv", "db_sqlite_filename");
}
if (_opt_action.sqliteDB_path.length > 0) {
- _struct_composite.conf.w_srv_db_sqlite_path
- = _opt_action.sqliteDB_path;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_db_sqlite_path
- = _yaml["webserv"]["db_sqlite_path"].get!string;
- }
- }
+ _init_string = (_cfg.db_sqlite_path.empty) ? "/var/www/sqlite" : _cfg.db_sqlite_path;
+ _struct_composite.conf.w_srv_db_sqlite_path = _get_yaml_node_string(_yaml, _init_string, "webserv", "db_sqlite_path");
}
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_y.yaml_tag_is_map))
- ) {
- if ("cgi_action" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_action"].type.string
- && _yaml["webserv"]["cgi_action"].tag.match(rgx_y.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;
- }
+ _init_string = (_cfg.www_url_doc_root.empty) ? "http://locahost" : _cfg.www_url_doc_root; // "https://sisudoc.org"
+ _struct_composite.conf.w_srv_cgi_action = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_action");
+ 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; // not yet right
}
}
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;
+ _struct_composite.conf.output_path = (_opt_action.output_dir_set.asNormalizedPath).array;
} else {
- _struct_composite.conf.output_path
- = (_cfg.processing_path_doc_root.empty)
- ? "/srv/www/spine"
- : _cfg.processing_path_doc_root;
+ _struct_composite.conf.output_path = (_cfg.processing_path_doc_root.empty) ? "/srv/www/spine" : _cfg.processing_path_doc_root;
if (("webserv" in _yaml && _yaml["webserv"].type.sequence)
&& (_yaml["webserv"].type.mapping
&& _yaml["webserv"].tag.match(rgx_y.yaml_tag_is_map))
@@ -261,75 +215,23 @@ template contentYAMLtoSpineStruct() {
}
}
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;
+ _struct_composite.conf.w_srv_data_root_path = _opt_action.webserver_host_doc_root;
} else {
- _struct_composite.conf.w_srv_data_root_path
- = (_cfg.processing_path_doc_root.empty)
- ? "/var/www/spine"
- : _cfg.processing_path_doc_root;
- if (("webserv" in _yaml && _yaml["webserv"].type.sequence)
- && (_yaml["webserv"].type.mapping
- && _yaml["webserv"].tag.match(rgx_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_data_root_path
- = _yaml["webserv"]["data_root_path"].get!string;
- }
- }
+ _init_string = (_cfg.processing_path_doc_root.empty) ? "/var/www/spine" : _cfg.processing_path_doc_root;
+ _struct_composite.conf.w_srv_data_root_path = _get_yaml_node_string(_yaml, _init_string, "webserv", "data_root_path");
}
}
if (_opt_action.cgi_bin_root.length > 0) {
- _struct_composite.conf.w_srv_cgi_bin_path
- = _opt_action.cgi_bin_root;
+ _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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_bin_path
- = _yaml["webserv"]["cgi_bin_path"].get!string;
- }
- }
- }
- { _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_y.yaml_tag_is_map))
- ) {
- if ("data_root_part" in _yaml["webserv"]
- && _yaml["webserv"]["data_root_part"].type.string
- && _yaml["webserv"]["data_root_part"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_data_root_part = _yaml["webserv"]["data_root_part"].get!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_y.yaml_tag_is_map))
- ) {
- if ("images_root_part" in _yaml["webserv"]
- && _yaml["webserv"]["images_root_part"].type.string
- && _yaml["webserv"]["images_root_part"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_images_root_part = _yaml["webserv"]["images_root_part"].get!string;
- }
- }
+ _init_string = (_cfg.cgi_bin_root.empty) ? "/var/www/cgi/cgi-bin" : _cfg.cgi_bin_root;
+ _struct_composite.conf.w_srv_cgi_bin_path = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_bin_path");
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "data_root_part");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_data_root_part = _init_string; }
+ } {
+ _init_string = "image"; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "images_root_part");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_images_root_part = _init_string; }
}
}
if (("webserv" in _yaml
@@ -337,106 +239,68 @@ template contentYAMLtoSpineStruct() {
&& (_yaml["webserv"].type.mapping
&& _yaml["webserv"].tag.match(rgx_y.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_y.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_y.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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_data_root_url = _yaml["webserv"]["data_root_url"].get!string;
- _struct_composite.conf.w_srv_data_root_url_html =
- _yaml["webserv"]["data_root_url"].get!string
- ~ _struct_composite.conf.w_srv_data_root_part ~ "/"
- ~ _manifested.src.language ~ "/"
- ~ "html";
- } else {
- _struct_composite.conf.w_srv_data_root_url = _struct_composite.conf.w_srv_data_root_part;
- _struct_composite.conf.w_srv_data_root_url_html =
- _struct_composite.conf.w_srv_data_root_part ~ "/"
- ~ _manifested.src.language ~ "/"
- ~ "html";
- }
- if ("cgi_host" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_host"].type.string
- && _yaml["webserv"]["cgi_host"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_host = _yaml["webserv"]["cgi_host"].get!string;
- } else { // composite construct
- _struct_composite.conf.w_srv_cgi_host = _struct_composite.conf.w_srv_host;
- }
- if ("cgi_bin_subpath" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_bin_subpath"].type.string
- && _yaml["webserv"]["cgi_bin_subpath"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_bin_subpath = _yaml["webserv"]["cgi_bin_subpath"].get!string;
- }
- if ("cgi_port" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_port"].type.string
- && _yaml["webserv"]["cgi_port"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_port = _yaml["webserv"]["cgi_port"].get!string;
- }
- if ("cgi_user" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_user"].type.string
- && _yaml["webserv"]["cgi_user"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_user = _yaml["webserv"]["cgi_user"].get!string;
- }
- if ("cgi_bin_url" in _yaml["webserv"]
- && _yaml["webserv"]["cgi_bin_url"].type.string
- && _yaml["webserv"]["cgi_bin_url"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.w_srv_cgi_bin_url = _yaml["webserv"]["cgi_bin_url"].get!string;
- } else {
- _struct_composite.conf.w_srv_cgi_bin_url =
- (_struct_composite.conf.w_srv_cgi_http.empty)
- ? _struct_composite.conf.w_srv_http
- :_struct_composite.conf.w_srv_cgi_http
- ~ "://"
- ~ (_struct_composite.conf.w_srv_cgi_host.empty)
- ? _struct_composite.conf.w_srv_cgi_host
- : _struct_composite.conf.w_srv_host
- ~ _struct_composite.conf.w_srv_cgi_bin_subpath;
- }
- // if ("cgi_file_links" in _yaml["webserv"]
- // && _yaml["webserv"]["cgi_file_links"].type.string
- // && _yaml["webserv"]["cgi_file_links"].tag.match(rgx_y.yaml_tag_is_str)
- // ) {
- // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string;
- // }
- }
- // make (in: conf, make, meta)?
- if ("processing" in _yaml
- && _yaml["processing"].type.sequence
- ) {
- if (_yaml["processing"].type.mapping
- && _yaml["processing"].tag.match(rgx_y.yaml_tag_is_map)
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "data_http");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_data_http = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_http");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_http = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "host");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_host = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_bin_subpath");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_bin_subpath = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_port");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_port = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_user");
+ if (!(_init_string.empty)) { _struct_composite.conf.w_srv_cgi_user = _init_string; }
+ }
+ if ("data_root_url" in _yaml["webserv"]
+ && _yaml["webserv"]["data_root_url"].type.string
+ && _yaml["webserv"]["data_root_url"].tag.match(rgx_y.yaml_tag_is_str)
) {
- if ("concord_max" in _yaml["processing"]
- && _yaml["processing"]["concord_max"].type.string
- && _yaml["processing"]["concord_max"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.processing_concord_max = _yaml["processing"]["concord_max"].get!string;
- }
+ _struct_composite.conf.w_srv_data_root_url = _yaml["webserv"]["data_root_url"].get!string;
+ _struct_composite.conf.w_srv_data_root_url_html =
+ _yaml["webserv"]["data_root_url"].get!string
+ ~ _struct_composite.conf.w_srv_data_root_part ~ "/"
+ ~ _manifested.src.language ~ "/"
+ ~ "html";
+ } else {
+ _struct_composite.conf.w_srv_data_root_url = _struct_composite.conf.w_srv_data_root_part;
+ _struct_composite.conf.w_srv_data_root_url_html =
+ _struct_composite.conf.w_srv_data_root_part ~ "/"
+ ~ _manifested.src.language ~ "/"
+ ~ "html";
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "webserv", "cgi_host");
+ _struct_composite.conf.w_srv_cgi_host = (!(_init_string.empty)) ? _init_string : _struct_composite.conf.w_srv_host;
}
+ if ("cgi_bin_url" in _yaml["webserv"]
+ && _yaml["webserv"]["cgi_bin_url"].type.string
+ && _yaml["webserv"]["cgi_bin_url"].tag.match(rgx_y.yaml_tag_is_str)
+ ) {
+ _struct_composite.conf.w_srv_cgi_bin_url = _yaml["webserv"]["cgi_bin_url"].get!string;
+ } else {
+ _struct_composite.conf.w_srv_cgi_bin_url =
+ (_struct_composite.conf.w_srv_cgi_http.empty) ? _struct_composite.conf.w_srv_http :_struct_composite.conf.w_srv_cgi_http
+ ~ "://"
+ ~ (_struct_composite.conf.w_srv_cgi_host.empty) ? _struct_composite.conf.w_srv_cgi_host : _struct_composite.conf.w_srv_host
+ ~ _struct_composite.conf.w_srv_cgi_bin_subpath;
+ }
+ // if ("cgi_file_links" in _yaml["webserv"]
+ // && _yaml["webserv"]["cgi_file_links"].type.string
+ // && _yaml["webserv"]["cgi_file_links"].tag.match(rgx_y.yaml_tag_is_str)
+ // ) {
+ // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string;
+ // }
+ }
+ // make (in: conf, make, meta)?
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "processing", "concord_max");
+ if (!(_init_string.empty)) { _struct_composite.conf.processing_concord_max = _init_string; }
}
if ("flag" in _yaml
&& _yaml["flag"].type.sequence
@@ -444,65 +308,36 @@ template contentYAMLtoSpineStruct() {
if (_yaml["flag"].type.mapping
&& _yaml["flag"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("act0" in _yaml["flag"]
- && _yaml["flag"]["act0"].type.string
- && _yaml["flag"]["act0"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act0 = _yaml["flag"]["act0"].get!string;
- }
- if ("act1" in _yaml["flag"]
- && _yaml["flag"]["act1"].type.string
- && _yaml["flag"]["act1"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act1 = _yaml["flag"]["act1"].get!string;
- }
- if ("act2" in _yaml["flag"]
- && _yaml["flag"]["act2"].type.string
- && _yaml["flag"]["act2"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act2 = _yaml["flag"]["act2"].get!string;
- }
- if ("act3" in _yaml["flag"]
- && _yaml["flag"]["act3"].type.string
- && _yaml["flag"]["act3"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act3 = _yaml["flag"]["act3"].get!string;
- }
- if ("act4" in _yaml["flag"]
- && _yaml["flag"]["act4"].type.string
- && _yaml["flag"]["act4"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act4 = _yaml["flag"]["act4"].get!string;
- }
- if ("act5" in _yaml["flag"]
- && _yaml["flag"]["act5"].type.string
- && _yaml["flag"]["act5"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act5 = _yaml["flag"]["act5"].get!string;
- }
- if ("act6" in _yaml["flag"]
- && _yaml["flag"]["act6"].type.string
- && _yaml["flag"]["act6"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act6 = _yaml["flag"]["act6"].get!string;
- }
- if ("act7" in _yaml["flag"]
- && _yaml["flag"]["act7"].type.string
- && _yaml["flag"]["act7"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act7 = _yaml["flag"]["act7"].get!string;
- }
- if ("act8" in _yaml["flag"]
- && _yaml["flag"]["act8"].type.string
- && _yaml["flag"]["act8"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act8 = _yaml["flag"]["act8"].get!string;
- }
- if ("act9" in _yaml["flag"]
- && _yaml["flag"]["act9"].type.string
- && _yaml["flag"]["act9"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.flag_act9 = _yaml["flag"]["act9"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act0");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act0 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act1");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act1 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act2");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act2 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act3");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act3 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act4");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act4 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act5");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act5 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act6");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act6 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act7");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act7 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act8");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act8 = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "flag", "act9");
+ if (!(_init_string.empty)) { _struct_composite.conf.flag_act9 = _init_string; }
}
}
}
@@ -568,20 +403,11 @@ template contentYAMLtoSpineStruct() {
}
string _set_papersize;
if (_opt_action.latex_papersize.length > 0) {
- _set_papersize
- = _opt_action.latex_papersize;
+ _set_papersize = _opt_action.latex_papersize;
} else {
- _set_papersize
- = (_cfg.default_papersize.empty)
- ? "a4,letter.portrait"
- : _cfg.default_papersize;
- if ("papersize" in _yaml["default"]
- && _yaml["default"]["papersize"].type.string
- && _yaml["default"]["papersize"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _set_papersize
- = _yaml["default"]["papersize"].get!string;
- }
+ _set_papersize = (_cfg.default_papersize.empty) ? "a4,letter.portrait" : _cfg.default_papersize;
+ _init_string = _set_papersize; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "papersize");
+ if (!(_init_string.empty)) { _set_papersize = _init_string; }
}
_struct_composite.conf.set_papersize = selected_papersize(_set_papersize);
if (
@@ -590,29 +416,18 @@ template contentYAMLtoSpineStruct() {
&& _yaml["default"].type.mapping
&& _yaml["default"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("text_wrap" in _yaml["default"]
- && _yaml["default"]["text_wrap"].type.string
- && _yaml["default"]["text_wrap"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_text_wrap = _yaml["default"]["text_wrap"].get!string;
- }
- if ("emphasis" in _yaml["default"]
- && _yaml["default"]["emphasis"].type.string
- && _yaml["default"]["emphasis"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_emphasis = _yaml["default"]["emphasis"].get!string;
- }
- if ("language" in _yaml["default"]
- && _yaml["default"]["language"].type.string
- && _yaml["default"]["language"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_language = _yaml["default"]["language"].get!string;
- }
- if ("digest" in _yaml["default"]
- && _yaml["default"]["digest"].type.string
- && _yaml["default"]["digest"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.set_digest = _yaml["default"]["digest"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "text_wrap");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_text_wrap = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "emphasis");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_emphasis = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "language");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_language = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "default", "digest");
+ if (!(_init_string.empty)) { _struct_composite.conf.set_digest = _init_string; }
}
}
if ("search" in _yaml
@@ -621,33 +436,24 @@ template contentYAMLtoSpineStruct() {
if (_yaml["search"].type.mapping
&& _yaml["search"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("flag" in _yaml["search"]
- && _yaml["search"]["flag"].type.string
- && _yaml["search"]["flag"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_flag = _yaml["search"]["flag"].get!string;
- }
- if ("action" in _yaml["search"]
- && _yaml["search"]["action"].type.string
- && _yaml["search"]["action"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_action = _yaml["search"]["action"].get!string;
- }
- if ("db" in _yaml["search"]
- && _yaml["search"]["db"].type.string
- && _yaml["search"]["db"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_db = _yaml["search"]["db"].get!string;
- }
- if ("title" in _yaml["search"]
- && _yaml["search"]["title"].type.string
- && _yaml["search"]["title"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.conf.search_title = _yaml["search"]["title"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "flag");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_flag = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "action");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_action = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "db");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_db = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "search", "title");
+ if (!(_init_string.empty)) { _struct_composite.conf.search_title = _init_string; }
}
}
}
- } else {
+ } else { // !(_identifier != "header")
+ string _init_string;
+ int _init_int;
/+ make ------------------------------------------------------------------- +/
if ("make" in _yaml
&& _yaml["make"].type.sequence
@@ -655,41 +461,24 @@ template contentYAMLtoSpineStruct() {
if (_yaml["make"].type.mapping
&& _yaml["make"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("doc_type" in _yaml["make"]
- && _yaml["make"]["doc_type"].type.string
- && _yaml["make"]["doc_type"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.doc_type = _yaml["make"]["doc_type"].get!string;
- }
- if ("breaks" in _yaml["make"]
- && _yaml["make"]["breaks"].type.string
- && _yaml["make"]["breaks"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.breaks = _yaml["make"]["breaks"].get!string;
- }
- if ("bold" in _yaml["make"]
- && _yaml["make"]["bold"].type.string
- && _yaml["make"]["bold"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.bold = _yaml["make"]["bold"].get!string;
- }
- if ("cover_image" in _yaml["make"]
- && _yaml["make"]["cover_image"].type.string
- && _yaml["make"]["cover_image"].tag.match(rgx_y.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_y.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_y.yaml_tag_is_str)
- ) {
- _struct_composite.make_str.emphasis = _yaml["make"]["emphasis"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "doc_type");
+ if (!(_init_string.empty)) { _struct_composite.make_str.doc_type = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "breaks");
+ if (!(_init_string.empty)) { _struct_composite.make_str.breaks = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "bold");
+ if (!(_init_string.empty)) { _struct_composite.make_str.bold = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "cover_image");
+ if (!(_init_string.empty)) { _struct_composite.make_str.cover_image = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "css");
+ if (!(_init_string.empty)) { _struct_composite.make_str.css = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "make", "emphasis");
+ if (!(_init_string.empty)) { _struct_composite.make_str.emphasis = _init_string; }
}
if ("footer" in _yaml["make"]
&& _yaml["make"]["footer"].type.string
@@ -781,16 +570,9 @@ template contentYAMLtoSpineStruct() {
break;
}
}
- if ("auto_num_depth" in _yaml["make"]
- && _yaml["make"]["auto_num_depth"].type.string
- && _yaml["make"]["auto_num_depth"].tag.match(rgx_y.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_y.yaml_tag_is_str)
- ) { // not sure implemented for documents
- _struct_composite.make_str.auto_num_depth = _yaml["make"]["auto_num_depth"].get!int;
+ {
+ _init_int = _get_yaml_node_int(_yaml, 99, "make", "auto_num_depth");
+ if (!(_init_int == 99)) { _struct_composite.make_str.auto_num_depth = _init_int; }
}
if ("texpdf_font" in _yaml["make"]
&& _yaml["make"]["texpdf_font"].type.string
@@ -823,29 +605,18 @@ template contentYAMLtoSpineStruct() {
if (_yaml["creator"].type.mapping
&& _yaml["creator"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("author" in _yaml["creator"]
- && _yaml["creator"]["author"].type.string
- && _yaml["creator"]["author"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_author = _yaml["creator"]["author"].get!string;
- }
- if ("email" in _yaml["creator"]
- && _yaml["creator"]["email"].type.string
- && _yaml["creator"]["email"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_author_email = _yaml["creator"]["email"].get!string;
- }
- if ("illustrator" in _yaml["creator"]
- && _yaml["creator"]["illustrator"].type.string
- && _yaml["creator"]["illustrator"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_illustrator = _yaml["creator"]["illustrator"].get!string;
- }
- if ("translator" in _yaml["creator"]
- && _yaml["creator"]["translator"].type.string
- && _yaml["creator"]["translator"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.creator_translator = _yaml["creator"]["translator"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "author");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_author = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "email");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_author_email = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "illustrator");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_illustrator = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "creator", "translator");
+ if (!(_init_string.empty)) { _struct_composite.meta.creator_translator = _init_string; }
}
} else if (_yaml["creator"].type.string
&& _yaml["creator"].tag.match(rgx_y.yaml_tag_is_str)
@@ -901,43 +672,27 @@ template contentYAMLtoSpineStruct() {
) {
_struct_composite.meta.title_main = _yaml["title"]["title"].get!string;
}
- if ("edition" in _yaml["title"]
- && _yaml["title"]["edition"].type.string
- && _yaml["title"]["edition"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_edition = _yaml["title"]["edition"].get!string;
- }
- if ("full" in _yaml["title"]
- && _yaml["title"]["full"].type.string
- && _yaml["title"]["full"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_full = _yaml["title"]["full"].get!string;
- }
- if ("language" in _yaml["title"]
- && _yaml["title"]["language"].type.string
- && _yaml["title"]["language"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_language = _yaml["title"]["language"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "edition");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_edition = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "full");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_full = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "language");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_language = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "note");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_note = _init_string; }
}
- if ("note" in _yaml["title"]
- && _yaml["title"]["note"].type.string
- && _yaml["title"]["note"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_note = _yaml["title"]["note"].get!string;
+ if ("subtitle" in _yaml["title"]) {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "subtitle");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_subtitle = _init_string; }
+ } else if ("sub" in _yaml["title"]) {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "title", "sub");
+ if (!(_init_string.empty)) { _struct_composite.meta.title_subtitle = _init_string; }
}
- if ("subtitle" in _yaml["title"]
- && _yaml["title"]["subtitle"].type.string
- && _yaml["title"]["subtitle"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_subtitle = _yaml["title"]["subtitle"].get!string;
- } else if ("sub" in _yaml["title"]
- && _yaml["title"]["sub"].type.string
- && _yaml["title"]["sub"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.title_subtitle = _yaml["title"]["sub"].get!string;
- }
- } else if (
- _yaml["title"].type.string
+ } else if (_yaml["title"].type.string
&& _yaml["title"].tag.match(rgx_y.yaml_tag_is_str)
) {
_struct_composite.meta.title_main = _yaml["title"].get!string;
@@ -962,23 +717,15 @@ template contentYAMLtoSpineStruct() {
if (_yaml["classify"].type.mapping
&& _yaml["classify"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("dewey" in _yaml["classify"]
- && _yaml["classify"]["dewey"].type.string
- && _yaml["classify"]["dewey"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.classify_dewey = _yaml["classify"]["dewey"].get!string;
- }
- if ("loc" in _yaml["classify"]
- && _yaml["classify"]["loc"].type.string
- && _yaml["classify"]["loc"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.classify_loc = _yaml["classify"]["loc"].get!string;
- }
- if ("keywords" in _yaml["classify"]
- && _yaml["classify"]["keywords"].type.string
- && _yaml["classify"]["keywords"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.classify_keywords = _yaml["classify"]["keywords"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "classify", "dewey");
+ if (!(_init_string.empty)) { _struct_composite.meta.classify_dewey = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "classify", "loc");
+ if (!(_init_string.empty)) { _struct_composite.meta.classify_loc = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "classify", "keywords");
+ if (!(_init_string.empty)) { _struct_composite.meta.classify_keywords = _init_string; }
}
if ("topic_register" in _yaml["classify"]
&& _yaml["classify"]["topic_register"].type.string
@@ -1032,47 +779,27 @@ template contentYAMLtoSpineStruct() {
if (_yaml["date"].type.mapping
&& _yaml["date"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("added_to_site" in _yaml["date"]
- && _yaml["date"]["added_to_site"].type.string
- && _yaml["date"]["added_to_site"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_added_to_site = _yaml["date"]["added_to_site"].get!string;
- }
- if ("available" in _yaml["date"]
- && _yaml["date"]["available"].type.string
- && _yaml["date"]["available"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_available = _yaml["date"]["available"].get!string;
- }
- if ("created" in _yaml["date"]
- && _yaml["date"]["created"].type.string
- && _yaml["date"]["created"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_created = _yaml["date"]["created"].get!string;
- }
- if ("issued" in _yaml["date"]
- && _yaml["date"]["issued"].type.string
- && _yaml["date"]["issued"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_issued = _yaml["date"]["issued"].get!string;
- }
- if ("modified" in _yaml["date"]
- && _yaml["date"]["modified"].type.string
- && _yaml["date"]["modified"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_modified = _yaml["date"]["modified"].get!string;
- }
- if ("published" in _yaml["date"]
- && _yaml["date"]["published"].type.string
- && _yaml["date"]["published"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_published = _yaml["date"]["published"].get!string;
- }
- if ("valid" in _yaml["date"]
- && _yaml["date"]["valid"].type.string
- && _yaml["date"]["valid"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.date_valid = _yaml["date"]["valid"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "added_to_site");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_added_to_site = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "available");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_available = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "created");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_created = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "issued");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_issued = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "modified");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_modified = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "published");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_published = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "date", "valid");
+ if (!(_init_string.empty)) { _struct_composite.meta.date_valid = _init_string; }
}
}
}
@@ -1088,23 +815,15 @@ template contentYAMLtoSpineStruct() {
if (_yaml["notes"].type.mapping
&& _yaml["notes"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("abstract" in _yaml["notes"]
- && _yaml["notes"]["abstract"].type.string
- && _yaml["notes"]["abstract"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.notes_abstract = _yaml["notes"]["abstract"].get!string;
- }
- if ("description" in _yaml["notes"]
- && _yaml["notes"]["description"].type.string
- && _yaml["notes"]["description"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.notes_description = _yaml["notes"]["description"].get!string;
- }
- if ("summary" in _yaml["notes"]
- && _yaml["notes"]["summary"].type.string
- && _yaml["notes"]["summary"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.notes_summary = _yaml["notes"]["summary"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "notes", "abstract");
+ if (!(_init_string.empty)) { _struct_composite.meta.notes_abstract = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "notes", "description");
+ if (!(_init_string.empty)) { _struct_composite.meta.notes_description = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "notes", "summary");
+ if (!(_init_string.empty)) { _struct_composite.meta.notes_summary = _init_string; }
}
}
}
@@ -1114,29 +833,18 @@ template contentYAMLtoSpineStruct() {
if (_yaml["original"].type.mapping
&& _yaml["original"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("language" in _yaml["original"]
- && _yaml["original"]["language"].type.string
- && _yaml["original"]["language"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_language = _yaml["original"]["language"].get!string;
- }
- if ("language_char" in _yaml["original"]
- && _yaml["original"]["language_char"].type.string
- && _yaml["original"]["language_char"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_language_char = _yaml["original"]["language_char"].get!string;
- }
- if ("source" in _yaml["original"]
- && _yaml["original"]["source"].type.string
- && _yaml["original"]["source"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_source = _yaml["original"]["source"].get!string;
- }
- if ("title" in _yaml["original"]
- && _yaml["original"]["title"].type.string
- && _yaml["original"]["title"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.original_title = _yaml["original"]["title"].get!string;
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "language");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_language = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "language_char");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_language_char = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "source");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_source = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "original", "title");
+ if (!(_init_string.empty)) { _struct_composite.meta.original_title = _init_string; }
}
}
}
@@ -1151,59 +859,34 @@ template contentYAMLtoSpineStruct() {
if (_yaml["rights"].type.mapping
&& _yaml["rights"].tag.match(rgx_y.yaml_tag_is_map)
) {
- if ("copyright" in _yaml["rights"]
- && _yaml["rights"]["copyright"].type.string
- && _yaml["rights"]["copyright"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright = check_input_markup(_yaml["rights"]["copyright"].get!string);
- }
- if ("copyright_text" in _yaml["rights"]
- && _yaml["rights"]["copyright_text"].type.string
- && _yaml["rights"]["copyright_text"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_text = _yaml["rights"]["copyright_text"].get!string;
- }
- if ("copyright_audio" in _yaml["rights"]
- && _yaml["rights"]["copyright_audio"].type.string
- && _yaml["rights"]["copyright_audio"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_audio = _yaml["rights"]["copyright_audio"].get!string;
- }
- if ("copyright_cover" in _yaml["rights"]
- && _yaml["rights"]["copyright_cover"].type.string
- && _yaml["rights"]["copyright_cover"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_cover = _yaml["rights"]["copyright_cover"].get!string;
- }
- if ("copyright_illustrations" in _yaml["rights"]
- && _yaml["rights"]["copyright_illustrations"].type.string
- && _yaml["rights"]["copyright_illustrations"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_illustrations = _yaml["rights"]["copyright_illustrations"].get!string;
- }
- if ("copyright_photographs" in _yaml["rights"]
- && _yaml["rights"]["copyright_photographs"].type.string
- && _yaml["rights"]["copyright_photographs"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_photographs = _yaml["rights"]["copyright_photographs"].get!string;
- }
- if ("copyright_translation" in _yaml["rights"]
- && _yaml["rights"]["copyright_translation"].type.string
- && _yaml["rights"]["copyright_translation"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_translation = _yaml["rights"]["copyright_translation"].get!string;
- }
- if ("copyright_video" in _yaml["rights"]
- && _yaml["rights"]["copyright_video"].type.string
- && _yaml["rights"]["copyright_video"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_copyright_video = _yaml["rights"]["copyright_video"].get!string;
- }
- if ("license" in _yaml["rights"]
- && _yaml["rights"]["license"].type.string
- && _yaml["rights"]["license"].tag.match(rgx_y.yaml_tag_is_str)
- ) {
- _struct_composite.meta.rights_license = check_input_markup(_yaml["rights"]["license"].get!string);
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright", true);
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_text");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_text = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_audio");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_audio = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_cover");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_cover = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_illustrations");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_illustrations = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_photographs");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_photographs = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_translation");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_translation = _init_string; }
+ } {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "copyright_video");
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_copyright_video = _init_string; }
+ }
+ {
+ _init_string = ""; _init_string = _get_yaml_node_string(_yaml, _init_string, "rights", "license", true);
+ if (!(_init_string.empty)) { _struct_composite.meta.rights_license = _init_string; }
}
}
}
@@ -1217,12 +900,12 @@ template configParseYAMLreturnSpineStruct() {
sisudoc.meta.conf_make_meta_structs,
sisudoc.meta.conf_make_meta_json;
mixin contentYAMLtoSpineStruct;
- @system auto configParseYAMLreturnSpineStruct(T,CCm,M,O,Cfg)(
- T _document_struct,
- CCm _make_and_meta_struct,
- M _manifested,
- O _opt_action,
- Cfg _cfg
+ @system ConfComposite configParseYAMLreturnSpineStruct(T,M,O,Cfg)(
+ T _document_struct,
+ ConfComposite _make_and_meta_struct,
+ M _manifested,
+ O _opt_action,
+ Cfg _cfg
){
Node _yaml;
if (_document_struct.content.length > 0) {
@@ -1249,7 +932,7 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() {
std.exception,
std.regex,
std.stdio,
- std.traits,
+ // std.traits,
std.typecons,
std.utf,
std.conv : to;
@@ -1265,12 +948,12 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() {
static auto rgx = RgxI();
mixin spineRgxYamlTags;
static auto rgx_y = RgxYaml();
- @system auto docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(CCm,Src,M,O,Cfg)(
- Src header_src,
- CCm _make_and_meta_struct,
- M _manifested,
- O _opt_action,
- Cfg _cfg,
+ @system ConfComposite docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(Src,M,O,Cfg)(
+ Src header_src,
+ ConfComposite _make_and_meta_struct,
+ M _manifested,
+ O _opt_action,
+ Cfg _cfg,
) {
Node _yaml;
try {
diff --git a/src/sisudoc/meta/metadoc.d b/src/sisudoc/meta/metadoc.d
index 25f28b6..901588c 100644
--- a/src/sisudoc/meta/metadoc.d
+++ b/src/sisudoc/meta/metadoc.d
@@ -68,13 +68,13 @@ template spineAbstraction() {
mixin outputHub;
enum makeMeta { make, meta }
enum docAbst { doc_abstract_obj, doc_has }
- @system auto spineAbstraction(E,P,O,Cfg,M,S)(
- E _env,
- P program_info,
- O _opt_action,
- Cfg _cfg,
- M _manifest,
- S _make_and_meta_struct
+ @system auto spineAbstraction(E,P,O,Cfg,M)(
+ E _env,
+ P program_info,
+ O _opt_action,
+ Cfg _cfg,
+ M _manifest,
+ ConfComposite _make_and_meta_struct
){
{ /+ document config/make file +/
auto _config_document_struct = readConfigDoc!()(_manifest, _env);
@@ -190,7 +190,7 @@ template spineAbstraction() {
~ ":" ~ _st.second.to!string;
return _time;
}
- auto conf_make_meta() {
+ ConfComposite conf_make_meta() {
return _make_and_meta_struct;
}
auto doc_digest() {