aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_in/paths_source.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2020-04-04 17:25:56 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2020-05-20 11:27:25 -0400
commitdb96528baa55151826442f61ddfea2cd006ef68d (patch)
tree1325fd983b466d8157248648b6ef8a33beee5a93 /src/doc_reform/io_in/paths_source.d
parentsql, sqlite internal site links (diff)
config, where used without document processing
Diffstat (limited to 'src/doc_reform/io_in/paths_source.d')
-rw-r--r--src/doc_reform/io_in/paths_source.d41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/doc_reform/io_in/paths_source.d b/src/doc_reform/io_in/paths_source.d
index 0cf0478..432b484 100644
--- a/src/doc_reform/io_in/paths_source.d
+++ b/src/doc_reform/io_in/paths_source.d
@@ -18,7 +18,7 @@ template PodManifest() {
mixin spineRgxIn;
static auto rgx = RgxI();
@safe auto PodManifest(O)(
- O _opt_actions,
+ O _opt_action,
string _pth=""
) {
struct ManifestFile_ {
@@ -40,10 +40,10 @@ template PodManifest() {
_manifest_path = m.captures["podpath"];
}
} else {
- if (_opt_actions.verbose || _opt_actions.very_verbose || _opt_actions.debug_do) {
+ if (_opt_action.verbose || _opt_action.very_verbose || _opt_action.debug_do) {
writeln("WARNING, src is not a pod, issue with manifest_path: ", _pth); // remove? unless can distinguish pod
}
- _manifest_path = null; // _manifest_path = "";
+ _manifest_path = "";
}
return _manifest_path;
}
@@ -73,13 +73,13 @@ template PathMatters() {
static auto rgx = RgxI();
static auto mkup = InlineMarkup();
@safe auto PathMatters(O,E)(
- O _opt_actions,
+ O _opt_action,
E _env,
string _pth,
string _fns = "",
char[][] _manifest_fn_list = [[]],
) {
- @safe auto _manifested = PodManifest!()(_opt_actions, _pth);
+ @safe auto _manifested = PodManifest!()(_opt_action, _pth);
struct ManifestMatters_ {
auto env() {
auto _env = _env;
@@ -96,7 +96,7 @@ template PathMatters() {
@safe auto opt() {
struct Opt_ {
auto action() {
- return _opt_actions;
+ return _opt_action;
}
}
return Opt_();
@@ -155,7 +155,7 @@ template PathMatters() {
}
@safe auto src() {
string _fns = _fns; // required here by dmd & not by ldc (for D:2078)
- auto _opt_actions = _opt_actions;
+ auto _opt_action = _opt_action;
auto _env = _env;
struct SRC_ {
@safe bool is_pod() {
@@ -270,7 +270,7 @@ template PathMatters() {
assert(_dir == absolute_path_to_src
.match(rgx.src_base_parent_dir_name).captures["dir"]);
}
- if (_opt_actions.debug_do) {
+ if (_opt_action.debug_do) {
writeln("--> (base_dir) ", _dir);
}
return _dir;
@@ -302,7 +302,7 @@ template PathMatters() {
} else {
_dir = ((path_and_fn.chainPath("../../")).asNormalizedPath).array;
}
- if (_opt_actions.debug_do) {
+ if (_opt_action.debug_do) {
writeln("--> (base_dir_path) ", _dir);
}
return _dir;
@@ -348,7 +348,7 @@ template PathMatters() {
} else {
_dir = (absolute_path_to_src).match(rgx.src_base_parent_dir_name).captures["dir"];
}
- if (_opt_actions.debug_do) {
+ if (_opt_action.debug_do) {
writeln("--> (base_parent_dir) ", _dir);
}
return _dir;
@@ -384,10 +384,10 @@ template PathMatters() {
struct Out_ {
@safe auto path() {
auto _output_path = _env["pwd"];
- if ((_opt_actions.output_dir_set.length > 0)
- && isValidPath(_opt_actions.output_dir_set)
+ if ((_opt_action.output_dir_set.length > 0)
+ && isValidPath(_opt_action.output_dir_set)
) {
- _output_path = ((_opt_actions.output_dir_set).asNormalizedPath).array;
+ _output_path = ((_opt_action.output_dir_set).asNormalizedPath).array;
if (!exists(_output_path)) {
try {
_output_path.mkdirRecurse;
@@ -409,10 +409,10 @@ template PathMatters() {
return ManifestMatters_();
}
}
-template ConfigFilePaths() {
+template configFilePaths() {
mixin spineRgxIn;
static auto rgx = RgxI();
- @safe auto ConfigFilePaths(M,E)(
+ @safe auto configFilePaths(M,E)(
M _manifested,
E _env,
string _cli_config_path_set = ""
@@ -465,10 +465,9 @@ template ConfigFilePaths() {
_dr_doc_conf_pwd_d,
];
}
- } else {
- _possible_config_path_locations = [
- _cli_config_path_set
- ];
+ } else if (_cli_config_path_set.isDir) {
+ _possible_config_path_locations = [_cli_config_path_set ];
+ // } else if (_cli_config_path_set.isFile) { // use file, taken care of elsewhere
}
/+ FIX clean up conf paths ↑
(compare pwd to doc path location, and build config path)
@@ -490,10 +489,10 @@ template ConfigFilePaths() {
_possible_config_path_locations = [
_dot_pwd,
_underscore_pwd,
+ _collection_root_a,
+ _collection_root_b,
_dot_home,
"/etc/dr",
- _collection_root_a, // set priority higher?
- _collection_root_b // set priority higher?
];
} else {
/+ config document (& or local site) on filesystem +/