diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2025-06-12 13:54:03 -0400 | 
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2025-06-12 13:54:06 -0400 | 
| commit | 801e2c94c36f689a3efd48e1b13550df48a65f93 (patch) | |
| tree | e63e2125fb1d89f578c4f8d876f5be65a51f1c6b /src | |
| parent | nix flake and env updates, ldc using llvm-20 (diff) | |
source & pod (fix build from non-pod source)
- appears to work, but needs review
Diffstat (limited to 'src')
| -rw-r--r-- | src/sisudoc/io_in/read_source_files.d | 10 | ||||
| -rw-r--r-- | src/sisudoc/io_out/source_pod.d | 39 | 
2 files changed, 26 insertions, 23 deletions
| 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 { | 
