aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/paths_source.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-04-20 13:57:03 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit9cf470e69b2d579701ee607f796de612dc600565 (patch)
treeff16c8b547767e4b441655df39511c1757f819c3 /src/sdp/paths_source.d
parentsection keys sequence (diff)
0.14.0 reorganized files, and paths
Diffstat (limited to 'src/sdp/paths_source.d')
-rw-r--r--src/sdp/paths_source.d59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/sdp/paths_source.d b/src/sdp/paths_source.d
new file mode 100644
index 0000000..f60949d
--- /dev/null
+++ b/src/sdp/paths_source.d
@@ -0,0 +1,59 @@
+/++
+ read configuration files<BR>
+ - read config files<BR>
+ ao_config_files.d
++/
+import std.array,
+ std.path,
+ std.regex,
+ std.stdio;
+import ao_rgx;
+template SiSUpathsSRC() {
+ mixin SiSUrgxInit;
+ auto rgx = Rgx();
+ auto SiSUpathsSRC(D,Fn)(
+ D _pwd,
+ Fn _fn_src,
+ ) {
+ struct SisuSrcPaths {
+ auto pwd() {
+ return _pwd;
+ }
+ auto language() {
+ // use command line info as well?
+ string _k;
+ if (auto m = _fn_src.match(rgx.language_code_and_filename)) {
+ _k = m.captures[1];
+ } else {
+ _k = "en";
+ }
+ return _k;
+ }
+ auto doc_root() {
+ return "sisudoc";
+ }
+ auto text_root() {
+ return doc_root.chainPath("text").array;
+ }
+ auto media_root() {
+ return doc_root.chainPath("docmedia").array;
+ }
+ auto conf_root() {
+ return doc_root.chainPath("conf").array;
+ }
+ auto image_root() {
+ return media_root.chainPath("image").array;
+ }
+ auto doc_src_fn_with_path_for_text_root_and_lng() {
+ return text_root.chainPath(language).array;
+ }
+ auto doc_src_with_relative_path() {
+ return pwd.chainPath(_fn_src).array;
+ }
+ auto doc_src_fn() {
+ return _fn_src.baseName.array;
+ }
+ }
+ return SisuSrcPaths();
+ }
+}