diff options
Diffstat (limited to 'org/out_src_pod.org')
| -rw-r--r-- | org/out_src_pod.org | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/org/out_src_pod.org b/org/out_src_pod.org index e1076c2..678d5ac 100644 --- a/org/out_src_pod.org +++ b/org/out_src_pod.org @@ -7,13 +7,13 @@ #+COPYRIGHT: Copyright (C) 2015 (continuously updated, current 2026) Ralph Amissah #+LANGUAGE: en #+STARTUP: content hideblocks hidestars noindent entitiespretty -#+PROPERTY: header-args :exports code -#+PROPERTY: header-args+ :noweb yes -#+PROPERTY: header-args+ :results silent -#+PROPERTY: header-args+ :cache no -#+PROPERTY: header-args+ :padline no +#+PROPERTY: header-args+ :eval never-export :exports code +#+PROPERTY: header-args+ :noweb yes :padline no +#+PROPERTY: header-args+ :results silent :cache no #+PROPERTY: header-args+ :mkdirp yes #+OPTIONS: H:3 num:nil toc:t \n:t ::t |:t ^:nil -:t f:t *:t +- magic single double-quote → " ← FIX changes hilighting behavior (occuring + after it) in org document. INVESTIGATE (org-mode CONFIG?) FIND & FIX - [[./doc-reform.org][doc-reform.org]] [[./][org/]] - [[./output_hub.org][output_hub]] @@ -21,11 +21,11 @@ * pod ** _module template_ :module: -#+HEADER: :tangle "../src/sisudoc/io_out/source_pod.d" +#+HEADER: :tangle "../src/sisudoc/outputs/io_out/source_pod.d" #+HEADER: :noweb yes #+BEGIN_SRC d <<doc_header_including_copyright_and_license>> -module sisudoc.io_out.source_pod; +module sisudoc.outputs.io_out.source_pod; @system: // is not @safe: use: @system: or @trusted: template spinePod() { <<output_imports>> @@ -83,10 +83,10 @@ import std.file; import std.outbuffer; import std.zip; import std.conv : to; -import sisudoc.meta.rgx_files; -import sisudoc.io_out; -import sisudoc.io_out.create_zip_file; -import sisudoc.io_out.xmls; +import sisudoc.ocda.meta.rgx_files; +import sisudoc.outputs.io_out; +import sisudoc.outputs.io_out.create_zip_file; +import sisudoc.outputs.io_out.xmls; #+END_SRC *** init @@ -156,29 +156,38 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) { } } { // 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.outputs.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); + } + } } } } @@ -438,7 +447,7 @@ void podArchive_directory_tree(M,P)(M doc_matters, P pths_pod) { // create direc } } if (!exists(pths_pod.pod_dir_() ~ "/index.html")) { - import sisudoc.io_out.html_snippet; + import sisudoc.outputs.io_out.html_snippet; mixin htmlSnippet; auto f = File(pths_pod.pod_dir_() ~"/index.html", "w"); f.writeln(format_html_blank_page_guide_home( @@ -507,7 +516,7 @@ void zipArchive(M,F,Z)(M doc_matters, F fn_pod, Z zip) { #+NAME: pod_source_files_digests #+BEGIN_SRC d void zipArchiveDigest(M,F,D)(M doc_matters, F fn_pod, D _digests) { - import sisudoc.io_out.paths_output; + import sisudoc.outputs.io_out.paths_output; auto pths_pod = spinePathsPods!()(doc_matters); char[] _zip_digest; try { |
