aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2025-06-12 13:54:03 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2025-06-12 13:54:06 -0400
commit801e2c94c36f689a3efd48e1b13550df48a65f93 (patch)
treee63e2125fb1d89f578c4f8d876f5be65a51f1c6b
parentnix flake and env updates, ldc using llvm-20 (diff)
source & pod (fix build from non-pod source)HEADmain
- appears to work, but needs review
-rw-r--r--org/in_source_files.org10
-rw-r--r--org/out_src_pod.org39
-rw-r--r--src/sisudoc/io_in/read_source_files.d10
-rw-r--r--src/sisudoc/io_out/source_pod.d39
4 files changed, 52 insertions, 46 deletions
diff --git a/org/in_source_files.org b/org/in_source_files.org
index cdd220f..e83729f 100644
--- a/org/in_source_files.org
+++ b/org/in_source_files.org
@@ -374,7 +374,7 @@ template spineRawMarkupContent() {
sourcefile_body_content = _cii.contents;
insert_file_list_get = _cii.insert_files.dup;
images_list_get = _cii.images.dup;
- } else if (_opt_action.source || _opt_action.pod) {
+ } else if (_opt_action.source_or_pod) {
auto ins = Inserts();
ST_contents_inserts_images _cii
= ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
@@ -630,7 +630,7 @@ if (code_block_status == codeBlock.curly) {
markup_sourcesubfile_insert_content.length
);
}
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
_images ~= _extract_images(markup_sourcesubfile_insert_content);
}
auto ins = Inserts();
@@ -646,7 +646,7 @@ if (code_block_status == codeBlock.curly) {
+/
} else {
contents_insert ~= line; // images to extract for image list?
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
string[] _image_linelist = _extract_images(line);
if (_image_linelist.length > 0) {
_images ~= _image_linelist;
@@ -735,7 +735,7 @@ if (code_block_status == codeBlock.curly) {
fn_src_insert.to!string
);
contents ~= contents_insert_st.insert_contents;
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
string[] _image_linelist = _extract_images(contents_insert_st.images);
if (_image_linelist.length > 0) {
_images ~= _image_linelist;
@@ -753,7 +753,7 @@ if (code_block_status == codeBlock.curly) {
+/
} else {
contents ~= line;
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
string[] _image_linelist = _extract_images(line);
if (_image_linelist.length > 0) {
_images ~= _image_linelist;
diff --git a/org/out_src_pod.org b/org/out_src_pod.org
index e72d332..a8a35ad 100644
--- a/org/out_src_pod.org
+++ b/org/out_src_pod.org
@@ -31,7 +31,7 @@ template spinePod() {
<<output_imports>>
void spinePod(T)(T doc_matters) {
<<source_pod_init>>
- if (doc_matters.opt.action.pod) {
+ if (doc_matters.opt.action.source_or_pod) {
try {
{
podArchive_directory_tree(doc_matters, pths_pod);
@@ -105,8 +105,8 @@ assert (doc_matters.src.filename.match(rgx_files.src_fn));
#+BEGIN_SRC d
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
);
@@ -116,7 +116,7 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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
@@ -139,7 +139,7 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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 {
@@ -163,7 +163,7 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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 {
@@ -208,7 +208,7 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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);
}
}
@@ -228,11 +228,14 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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);
}
@@ -240,11 +243,11 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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"];
@@ -259,12 +262,12 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
}
}
} 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);
}
}
}
@@ -308,7 +311,7 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
).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 {
@@ -342,7 +345,7 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) {
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 {
diff --git a/src/sisudoc/io_in/read_source_files.d b/src/sisudoc/io_in/read_source_files.d
index c683d1e..7ee0fb1 100644
--- a/src/sisudoc/io_in/read_source_files.d
+++ b/src/sisudoc/io_in/read_source_files.d
@@ -132,7 +132,7 @@ template spineRawMarkupContent() {
sourcefile_body_content = _cii.contents;
insert_file_list_get = _cii.insert_files.dup;
images_list_get = _cii.images.dup;
- } else if (_opt_action.source || _opt_action.pod) {
+ } else if (_opt_action.source_or_pod) {
auto ins = Inserts();
ST_contents_inserts_images _cii
= ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
@@ -297,7 +297,7 @@ template spineRawMarkupContent() {
markup_sourcesubfile_insert_content.length
);
}
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
_images ~= _extract_images(markup_sourcesubfile_insert_content);
}
auto ins = Inserts();
@@ -313,7 +313,7 @@ template spineRawMarkupContent() {
+/
} else {
contents_insert ~= line; // images to extract for image list?
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
string[] _image_linelist = _extract_images(line);
if (_image_linelist.length > 0) {
_images ~= _image_linelist;
@@ -392,7 +392,7 @@ template spineRawMarkupContent() {
fn_src_insert.to!string
);
contents ~= contents_insert_st.insert_contents;
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
string[] _image_linelist = _extract_images(contents_insert_st.images);
if (_image_linelist.length > 0) {
_images ~= _image_linelist;
@@ -410,7 +410,7 @@ template spineRawMarkupContent() {
+/
} else {
contents ~= line;
- if (_opt_action.source || _opt_action.pod) {
+ if (_opt_action.source_or_pod) {
string[] _image_linelist = _extract_images(line);
if (_image_linelist.length > 0) {
_images ~= _image_linelist;
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 {