diff options
Diffstat (limited to 'src/sisudoc')
| -rw-r--r-- | src/sisudoc/io_out/source_pod.d | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/src/sisudoc/io_out/source_pod.d b/src/sisudoc/io_out/source_pod.d index 138f105..b015a04 100644 --- a/src/sisudoc/io_out/source_pod.d +++ b/src/sisudoc/io_out/source_pod.d @@ -195,29 +195,38 @@ template spinePod() { } } { // bundle abstraction .ssp file (only for --pod2) if (doc_matters.opt.action.pod2) { - import sisudoc.io_out.paths_output; - auto out_pth = spineOutPaths!()(doc_matters.output_path, doc_matters.src.language); - string abstraction_dir = ((out_pth.output_base.chainPath("abstraction")).asNormalizedPath).array; - string ssp_filename = doc_matters.src.doc_uid_out ~ ".ssp"; - string fn_src_in = ((abstraction_dir.chainPath(ssp_filename)).asNormalizedPath).array.to!string; - auto fn_src_out_pod_zip_base - = pths_pod.abstraction_root(doc_matters.src.filename).zpod.to!string - ~ "/" ~ ssp_filename; - auto fn_src_out_filesystem - = pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod.to!string - ~ "/" ~ ssp_filename; - if (exists(fn_src_in)) { - debug(io) { writeln("(io debug) src out found: ", fn_src_in); } - { // take DIGEST write to pod file digests.txt - auto data = (cast(byte[]) (fn_src_in).read); - _digests[doc_matters.src.language]["ssp"] ~= data.sha256Of.toHexString - ~ "::" ~ data.length.to!string ~ " - " ~ ssp_filename ~ "\n"; - } - fn_src_in.copy(fn_src_out_filesystem); - zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip); - } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { - writeln("WARNING (io) src out NOT found (abstraction): ", fn_src_in); + if (doc_matters.src.language == doc_matters.pod.manifest_list_of_languages[$-1]) { // wait until all language versions of .ssp generated + import sisudoc.io_out.paths_output; + /+ doc_uid_out for any language follows the same pattern, differing + only in the trailing ".{lng}". Strip the current language to + reuse the base across all languages. +/ + string _doc_uid_base + = doc_matters.src.doc_uid_out[0 .. $ - doc_matters.src.lng.length]; + foreach (_lang; doc_matters.pod.manifest_list_of_languages) { // do for all language versions + auto out_pth_lng = spineOutPaths!()(doc_matters.output_path, _lang); + string abstraction_dir = ((out_pth_lng.output_base.chainPath("abstraction")).asNormalizedPath).array; + string ssp_filename = _doc_uid_base ~ _lang ~ ".ssp"; + string fn_src_in = ((abstraction_dir.chainPath(ssp_filename)).asNormalizedPath).array.to!string; + auto fn_src_out_pod_zip_base + = pths_pod.abstraction_root(doc_matters.src.filename).zpod.to!string + ~ "/" ~ ssp_filename; + auto fn_src_out_filesystem + = pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod.to!string + ~ "/" ~ ssp_filename; + if (exists(fn_src_in)) { + debug(io) { writeln("(io debug) src out found: ", fn_src_in); } + { // take DIGEST write to pod file digests.txt + auto data = (cast(byte[]) (fn_src_in).read); + _digests[_lang]["ssp"] ~= data.sha256Of.toHexString + ~ "::" ~ data.length.to!string ~ " - " ~ ssp_filename ~ "\n"; + } + fn_src_in.copy(fn_src_out_filesystem); + zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip); + } else { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { + writeln("WARNING (io) src out NOT found (abstraction): ", fn_src_in); + } + } } } } |
