aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/spine.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-12-08 19:26:13 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2020-01-13 16:06:43 -0500
commit99de6c56f71bcc0588aa1d888a5278aba15ec237 (patch)
treedc064ccaafafac75d40f2022829b10de9d14bec4 /src/doc_reform/spine.d
parentsrc without pod.manifest, report on verbose (diff)
yaml doc headers, protect harvest
- protect harvest from missing doc header metadata - title & author required - removed crude rgx yaml check (rely on yaml parser)
Diffstat (limited to 'src/doc_reform/spine.d')
-rwxr-xr-xsrc/doc_reform/spine.d45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d
index 96ac7d4..2ee081c 100755
--- a/src/doc_reform/spine.d
+++ b/src/doc_reform/spine.d
@@ -546,21 +546,17 @@ void main(string[] args) {
{ /+ local site config +/
_conf_file_details = ConfigFilePaths!()(_manifested, _env, _opt_action.config_path_set);
auto _config_local_site_struct = readConfigSite!()(_conf_file_details);
- if (_config_local_site_struct.filetype == "yaml") {
- import doc_reform.meta.conf_make_meta_yaml;
- _make_and_meta_struct = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_make_and_meta_struct, _manifested); // - get local site config
- break;
- }
+ import doc_reform.meta.conf_make_meta_yaml;
+ _make_and_meta_struct = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_make_and_meta_struct, _manifested); // - get local site config
+ break;
}
}
}
} else {
{ /+ local site config +/
auto _config_local_site_struct = readConfigSite!()(_conf_file_details);
- if (_config_local_site_struct.filetype == "yaml") {
- import doc_reform.meta.conf_make_meta_yaml;
- _make_and_meta_struct = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_make_and_meta_struct, _manifested); // - get local site config
- }
+ import doc_reform.meta.conf_make_meta_yaml;
+ _make_and_meta_struct = _config_local_site_struct.configParseYAMLreturnSpineStruct!()(_make_and_meta_struct, _manifested); // - get local site config
}
}
foreach(arg; args[1..$]) { // refigure how args relate to _opt_action, need path from _opt_action or args early _manifested too late, work on (search for PathMatters and .harvest,
@@ -674,7 +670,6 @@ void main(string[] args) {
}
}
}
-
} catch (ErrnoException ex) {
}
}
@@ -799,7 +794,19 @@ void main(string[] args) {
spineShowConfig!()(doc_matters);
}
if (doc_matters.opt.action.harvest) {
- hvst.harvests ~= spineMetaDocHarvest!()(doc_matters, hvst);
+ auto _hvst = spineMetaDocHarvest!()(doc_matters, hvst);
+ if (
+ _hvst.title.length > 0
+ && _hvst.author_surname_fn.length > 0
+ ) {
+ hvst.harvests ~= _hvst;
+ } else {
+ if ((doc_matters.opt.action.debug_do)
+ || (doc_matters.opt.action.very_verbose)
+ ) {
+ writeln("WARNING harvest: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc);
+ }
+ }
}
/+ ↓ debugs +/
if (doc_matters.opt.action.debug_do) {
@@ -903,7 +910,19 @@ void main(string[] args) {
spineShowConfig!()(doc_matters);
}
if (doc_matters.opt.action.harvest) {
- hvst.harvests ~= spineMetaDocHarvest!()(doc_matters, hvst);
+ auto _hvst = spineMetaDocHarvest!()(doc_matters, hvst);
+ if (
+ _hvst.title.length > 0
+ && _hvst.author_surname_fn.length > 0
+ ) {
+ hvst.harvests ~= _hvst;
+ } else {
+ if ((doc_matters.opt.action.debug_do)
+ || (doc_matters.opt.action.very_verbose)
+ ) {
+ writeln("WARNING harvest: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc);
+ }
+ }
}
/+ ↓ debugs +/
if (doc_matters.opt.action.debug_do) {
@@ -958,5 +977,5 @@ void main(string[] args) {
writeln("- ", out_pth.harvest("topics.html"));
}
}
- }
+ } else { writeln("NO HARVESTS"); }
}