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.org54
1 files changed, 53 insertions, 1 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index af96bea..308475a 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -204,6 +204,7 @@ template PathMatters() {
return Pod_();
}
auto src() {
+ string _sep = "␣";
struct SRC_ {
auto is_pod() {
auto _src_is_pod = (_manifest.pod_manifest_path.length > 0) ? true : false;
@@ -212,19 +213,70 @@ template PathMatters() {
auto path_and_fn() {
return _fns;
}
+ auto pod_name() { /+ work on +/
+ auto _pod_name = (is_pod)
+ ? _manifest.pod_manifest_path
+ : "";
+ return _pod_name;
+ }
auto filename() {
auto _fn = (path_and_fn).baseName;
return _fn;
}
+ auto filename_base() {
+ auto _fn = filename.stripExtension;
+ return _fn;
+ }
+ auto filename_extension() {
+ auto _ext = filename.match(rgx.src_pth_sst_or_ssm).captures["extension"];
+ return _ext;
+ }
auto lng() {
string _k;
- if (auto m = (path_and_fn).match(rgx.language_code_and_filename)) {
+ if (auto m = path_and_fn.match(rgx.language_code_and_filename)) {
_k = m.captures[1];
} else {
_k = "en";
}
return _k;
}
+ auto docname_composite_unique_per_src_doc() {
+ /+
+ z pod name if any + src filename + lng code
+ filename ~ "." ~ lng
+ * unique per src doc
+ used by
+ - sqlite discrete index (multilingual, each language of a document)
+ +/
+ string _fn;
+ if (pod_name.baseName == filename_base) {
+ _fn = filename_base ~ _sep ~ filename_extension ~ _sep ~ lng;
+ } else if (!(pod_name.empty)) {
+ _fn = pod_name.baseName ~ _sep ~ filename_base ~ _sep ~ filename_extension ~ _sep ~ lng;
+ } else {
+ _fn = "_" ~ _sep ~ filename_base ~ _sep ~ filename_extension ~ _sep ~ lng;
+ }
+ return _fn;
+ }
+ auto docname_composite_unique_per_src_pod() {
+ /+
+ z pod name if any + src filename (without lng code)
+ filename ~ _sep ~ lng
+ * unique per src pod
+ used by
+ - sisupod (multilingual collection)
+ - sqlite discrete index (multilingual collection)
+ +/
+ string _fn;
+ if (pod_name.baseName == filename_base) {
+ _fn = filename_base ~ _sep ~ filename_extension;
+ } else if (!(pod_name.empty)) {
+ _fn = pod_name.baseName ~ _sep ~ filename_base ~ _sep ~ filename_extension;
+ } else {
+ _fn = "_" ~ _sep ~ filename_base ~ _sep ~ filename_extension;
+ }
+ return _fn;
+ }
auto language() {
return lng();
}