diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sisudoc/outputs/io_out/source_pod.d | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/sisudoc/outputs/io_out/source_pod.d b/src/sisudoc/outputs/io_out/source_pod.d index bfbad70..4730bf2 100644 --- a/src/sisudoc/outputs/io_out/source_pod.d +++ b/src/sisudoc/outputs/io_out/source_pod.d @@ -58,6 +58,7 @@ template spinePod() { import std.conv : to; import sisudoc.ocda.meta.rgx_files; import sisudoc.outputs.io_out; + import sisudoc.ocda.io_in.carried_names; import sisudoc.outputs.io_out.zip_pod; import sisudoc.outputs.io_out.xmls; void spinePod(T)(T doc_matters) { @@ -321,6 +322,46 @@ template spinePod() { writeln("WARNING (io) src out NOT found (document make): ", fn_src_in); } } + } { /+ ↓ bundle tools/po4a, the translation working set + . + A directory walk, where every other thing the pod writer carries + is named. A catalogue set is whatever the translator has, and + naming .pot and .po files would mean the writer knowing the + document's languages a second time, from a second place, to say + what it already reads from the manifest. + . + Done once, on the last language, as the markup blocks are. + . + Every name is checked before it is carried, by the rule the pod + reader applies to an archive it is handed. The writer is reading a + directory someone else may have filled. + +/ + if (doc_matters.src.is_pod + && doc_matters.src.language == doc_matters.pod.manifest_list_of_languages[$-1] + ) { + mixin spineCarriedNames; + enum string _po4a_root = "tools/po4a"; + string _tools_in = doc_matters.pod.manifest_path ~ "/" ~ _po4a_root; + if (exists(_tools_in) && _tools_in.isDir) { + foreach (string _f; dirEntries(_tools_in, SpanMode.depth)) { + if (!(_f.isFile)) { continue; } + string _rel = _po4a_root ~ "/" ~ _f[(_tools_in.length + 1) .. $]; + string _bad = validateCarriedPath(_rel); + if (_bad.length > 0) { + writeln("WARNING not carried into the pod: ", _bad); + continue; + } + if (doc_matters.opt.action.source_or_pod) { + string _out_fs = pths_pod.pod_root(doc_matters.src.filename) + .filesystem_open_zpod.to!string ~ "/" ~ _rel; + string _parent = _out_fs.dirName; + if (!exists(_parent)) { _parent.mkdirRecurse; } + _f.copy(_out_fs); + zip = podArchive("file_path_bin", _f, "pod/" ~ _rel, zip); + } + } + } + } } { // pod manifest auto fn_src_in = doc_matters.src.file_with_absolute_path.to!string; auto fn_src_out_pod_zip_base |
