/++
  read configuration files<BR>
  - read config files<BR>
  meta_config_files.d
+/
module sdp.output.paths_source;
import std.array,
  std.path,
  std.regex,
  std.stdio;
import sdp.meta.rgx;
template SiSUpathsSRC() {
  mixin SiSUrgxInit;
  static auto rgx = Rgx();
  auto SiSUpathsSRC(D,Fn)(
    D   _pwd,
    Fn  _fn_src_and_relative_path,
  ) {
    struct SisuSrcPaths {
      auto pwd() {
        return _pwd;
      }
      auto language() {
        // use command line info as well?
        string _k;
        if (auto m = _fn_src_and_relative_path.match(rgx.language_code_and_filename)) {
          _k = m.captures[1];
        } else {
          _k = "xx"; // original default was "en" but is not known
        }
        return _k;
      }
      auto doc_root() {
        return "sisudoc";
      }
      auto media_root() {
        return doc_root.chainPath("media").array;
      }
      auto conf_root() {
        return doc_root.chainPath("conf").array;
      }
      auto text_root() {
        return media_root.chainPath("text").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_and_relative_path).array;
      }
      auto doc_src_fn() {
        return _fn_src_and_relative_path.baseName.array;
      }
    }
    return SisuSrcPaths();
  }
}