diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-05-15 19:05:49 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-05-16 11:58:32 -0400 |
| commit | 9d244bf416f94415faa532fc5c7d98c0213012b6 (patch) | |
| tree | 716cdba332bd79ead4504b474374d19c718ad028 /src/sisudoc | |
| parent | latex: some fixes for xelatex 2025 (diff) | |
- include all (doc abstraction) .ssp in pod zip and in digests
- fixed: for multi-language pods built with --pod2, only the last
language's .ssp file was being written into pod.zip and listed in
.digests.txt each languages' .ssp files were on disk in the pod
directory (copied during their own per-language passes) but were not
in final zip as it was being built once for each language and
writing over previous, (only the last one remaining). The solution
is to follow the pattern already used to avoid this by .sstm and
.ssi, namely wait for the last language and iterate the
manifest_list_of_languages internaly.
(assisted by Claude-Code)
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); + } + } } } } |
