aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_paths.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/default_paths.org')
-rw-r--r--org/default_paths.org66
1 files changed, 61 insertions, 5 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index ff14d50..cc78c46 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -46,7 +46,7 @@ template PodManifest() {
mixin SiSUrgxInit;
static auto rgx = Rgx();
auto PodManifest(P)(
- P _pth = "",
+ P _pth
) {
struct ManifestFile_ {
auto pod_manifest_filename() {
@@ -68,8 +68,8 @@ template PodManifest() {
_manifest_path = m.captures["podpath"];
}
} else {
- writeln("WARNING, issue with manifest_path: ", _pth);
- _manifest_path = _pth; // _manifest_path = null;
+ writeln("WARNING, issue with manifest_path: ", _pth); // remove?
+ _manifest_path = null; // _manifest_path = "";
}
return _manifest_path;
}
@@ -118,7 +118,7 @@ template PathMatters() {
auto PathMatters(O,E,P,F)(
O _opt_actions,
E _env,
- P _pth = "",
+ P _pth,
F _fns = "",
char[][] _manifest_fn_list = [[]],
) {
@@ -168,6 +168,9 @@ template PathMatters() {
auto manifest_path() {
return _manifest.pod_manifest_path;
}
+ auto pod_name() { // TODO decide what returned if src_is_pod == false
+ return _manifest.pod_manifest_path.baseName;
+ }
auto manifest_file_with_path() {
return _manifest.pod_manifest_file_with_path;
}
@@ -243,7 +246,8 @@ template PathMatters() {
assert(_dir == m.captures["dir"]);
} else {
_dir = asNormalizedPath(path_and_fn.chainPath("../../../")).array;
- assert(_dir == absolute_path_to_src.match(rgx.src_base_parent_dir_name).captures["dir"]);
+ assert(_dir == absolute_path_to_src
+ .match(rgx.src_base_parent_dir_name).captures["dir"]);
}
if ((_opt_actions.debug_do)) {
writeln("--> (base_dir) ", _dir);
@@ -843,6 +847,14 @@ import sdp.meta.rgx;
#+END_SRC
** shared out path, base directory :out:
+- output paths for content, minimize chance of filename/directory collisions
+ in particular pods can contain markup that is published under a name that may
+ be used elsewere
+ - if the pod directory has a different name from the file append the pod
+ directory name to the output file name: pod_directory.markup_filename e.g.
+ sisu-manual.sisu_markup
+ - if pod and file have same name, keep name (makes no sense to repeat pod
+ name) NO sisu_markup.sisu_markup should be sisu_markup
#+name: template_paths_out
#+BEGIN_SRC d
@@ -870,6 +882,50 @@ template SiSUoutPaths() {
}
#+END_SRC
+** set
+
+#+name: template_paths_out
+#+BEGIN_SRC d
+template SiSUoutPathsFnPd() {
+ /+ TODO stuff to work out here +/
+ auto SiSUoutPathsFnPd(Fn,Pn)(
+ Fn fn_src_pth,
+ Pn pod_name
+ // Pn pod_name = "",
+ ) {
+ struct _PathsStruct {
+ string base_filename() {
+ return fn_src_pth.baseName.stripExtension;
+ }
+ string base_pod_and_filename() { // TODO
+ /+
+ - if pod,
+ - pod_name
+ - file_name
+ - if pod_name == file_name
+ - file_name
+ - else if pod_name != file_name
+ - pod_name.file_name
+ +/
+ auto _fn_src = fn_src_pth.baseName.stripExtension;
+ string _output_base_name;
+ if (!(pod_name.empty)) {
+ if (pod_name == _fn_src) {
+ _output_base_name = _fn_src;
+ } else {
+ _output_base_name = pod_name ~ "." ~ _fn_src;
+ }
+ } else {
+ _output_base_name = _fn_src;
+ }
+ return _output_base_name;
+ }
+ }
+ return _PathsStruct();
+ }
+}
+#+END_SRC
+
** _html_ :html:
#+name: template_paths_html