diff options
Diffstat (limited to 'src/sisudoc/io_out')
| -rw-r--r-- | src/sisudoc/io_out/source_pod.d | 39 | 
1 files changed, 21 insertions, 18 deletions
| diff --git a/src/sisudoc/io_out/source_pod.d b/src/sisudoc/io_out/source_pod.d index a6253ab..640e7d2 100644 --- a/src/sisudoc/io_out/source_pod.d +++ b/src/sisudoc/io_out/source_pod.d @@ -73,7 +73,7 @@ template spinePod() {      auto lang = Lang();      static auto rgx_files = RgxFiles();      assert (doc_matters.src.filename.match(rgx_files.src_fn)); -    if (doc_matters.opt.action.pod) { +    if (doc_matters.opt.action.source_or_pod) {        try {          {            podArchive_directory_tree(doc_matters, pths_pod); @@ -139,8 +139,8 @@ template spinePod() {    }    auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {      auto pth_dr_doc_src = doc_matters.src_path_info; -    if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { -      writeln(__LINE__, ": ", +    if (doc_matters.opt.action.vox_gt2) { // correct +      writeln(__LINE__, ":", __FILE__, ":\n",          doc_matters.src.filename, " -> ",          pths_pod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod        ); @@ -150,7 +150,7 @@ template spinePod() {      string[string][string] _digests;      { // bundle images - get digest        foreach (image; doc_matters.srcs.image_list) { -        debug(podimages) { +        if (doc_matters.opt.action.vox_gt2) {            writeln(              pth_dr_doc_src.image_root.to!string, "/", image, " -> ",              pths_pod.image_root(doc_matters.src.filename).zpod, "/", image @@ -173,7 +173,7 @@ template spinePod() {            if (doc_matters.opt.action.source_or_pod) {              fn_src_in.copy(fn_src_out_filesystem);            } -          if (doc_matters.opt.action.pod) { +          if (doc_matters.opt.action.source_or_pod) {              zip = podArchive("file_path_bin", fn_src_in, fn_src_out_pod_zip_base, zip);            }          } else { @@ -197,7 +197,7 @@ template spinePod() {          if (doc_matters.opt.action.source_or_pod) {            fn_src_in.copy(fn_src_out_filesystem);          } -        if (doc_matters.opt.action.pod) { +        if (doc_matters.opt.action.source_or_pod) {            zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip);          }        } else { @@ -242,7 +242,7 @@ template spinePod() {            if (doc_matters.opt.action.source_or_pod) {              pod_filelist_yaml_string.writeln(_pm);            } -          if (doc_matters.opt.action.pod) { +          if (doc_matters.opt.action.source_or_pod) {              zip = podArchive("string", _pm, fn_src_out_pod_zip_base, zip);            }          } @@ -262,11 +262,14 @@ template spinePod() {            string fn_src_out_filesystem_lng              = pths_pod.fn_doc(doc_matters.src.filename, _lang).filesystem_open_zpod.to!string;            string _sstm = (doc_matters.pod.manifest_path ~ "/media/text/" ~ _lang ~ "/" ~ doc_matters.src.filename); -          // writeln(_sstm); -          if (exists(_sstm)) { // what of language? -            debug(io) { writeln("(io debug) src in found: ", _sstm); } +          string _pth_file_sstm; +          if (exists(_sstm))   { _pth_file_sstm = _sstm; +          } else if (exists(fn_src_in)) { _pth_file_sstm = fn_src_in; +          } +          if (exists(_pth_file_sstm)) { // what of language? +            debug(io) { writeln("(io debug) src in found: ", _pth_file_sstm); }              { // take DIGEST write to pod file digests.txt -              auto data = (cast(byte[]) (_sstm).read); +              auto data = (cast(byte[]) (_pth_file_sstm).read);                _digests[_lang]["sstm"] ~= data.sha256Of.toHexString ~ "::" ~ data.length.to!string ~ " - " ~ doc_matters.src.filename ~ " - [" ~ _lang ~ "]";                // writeln(data.sha256Of.toHexString, "::", data.length, " - ", doc_matters.src.filename);              } @@ -274,11 +277,11 @@ template spinePod() {              filelist_src_zpod_arr ~= fn_src_out_inside_pod;              string _pod_to_markup_file = doc_matters.src.pod_name ~ "/" ~ "media/text/" ~ _lang ~ "/" ~ doc_matters.src.filename;              if (doc_matters.opt.action.source_or_pod) { -              _sstm.copy(fn_src_out_filesystem_lng); +              _pth_file_sstm.copy(fn_src_out_filesystem_lng);              } -            if (doc_matters.opt.action.pod) { +            if (doc_matters.opt.action.source_or_pod) {                auto _rgx_sstm = regex(r"(?P<path_to_pod>\S+?)(?P<podname>[a-z_-]+)/(?P<from_root>media/text/)(?P<language>\S+?)/(?P<filename>\S+?\.ss[mt])"); -              if (auto _x = _sstm.match(_rgx_sstm)){ +              if (auto _x = _pth_file_sstm.match(_rgx_sstm)){                  if (doc_matters.src.lng == doc_matters.pod.manifest_list_of_languages[$-1]) { // again wait until all language versions of .ssm parsed                    string _path_to_pod = _x.captures["path_to_pod"];                    string _podname = _x.captures["podname"]; @@ -293,12 +296,12 @@ template spinePod() {                    }                  }                } else { -                zip = podArchive("file_path_text", _sstm, fn_src_out_pod_zip_base, zip); +                zip = podArchive("file_path_text", _pth_file_sstm, fn_src_out_pod_zip_base, zip);                }              }            } else {              if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt1) { -              writeln("WARNING (io) src in NOT found (markup source): ", _sstm); +              writeln("WARNING (io) src in NOT found (markup source): \n", _sstm, "or in", fn_src_in);              }            }          } @@ -342,7 +345,7 @@ template spinePod() {                        ).filesystem_open_zpod.to!string;                      _pth_mkup_src_in.copy(fn_src_out_filesystem); // check why here, thought dealt with elsewhere                    } -                  if (doc_matters.opt.action.pod) { +                  if (doc_matters.opt.action.source_or_pod) {                       zip = podArchive("file_path_text", _pth_mkup_src_in, _pth_mkup_src_out, zip);                    }                  } else { @@ -376,7 +379,7 @@ template spinePod() {                if (doc_matters.opt.action.source_or_pod) {                  fn_src_in.copy(fn_src_out_filesystem);                } -              if (doc_matters.opt.action.pod) { +              if (doc_matters.opt.action.source_or_pod) {                  zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip);                }              } else { | 
