From 1d68345250b0fd26d3ea657ed28899dccaa324df Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 8 Nov 2017 20:02:48 -0500 Subject: process filesystem/unzipped sisupod.zip - src pod dir structure changes - notes - the plan is to have a src manifest of related .sst or .ssm files that can be pointed to for processing - multilingual documents [ponder persistence for multilingual documents] - in the case of multilingual documents, there will be multiple source documents on list with different language codes, and to build this list, persistence is required - inserted documents (from master .ssm or .sst) must track document root so inserts can be located, else not found - consider a commandline -o --output path specifier - steps - auto create filelist - for single source file - for multilinugual source files - process document by pointing at filelist (rather than file) - if necessary manually create filelist (for multilinugual source) - keep document root for document inserts (.ssi) process filesystem/unzipped sisupod.zip - source/sisupod path/dir structure representation changes --- src/sdp/sdp.d | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/sdp/sdp.d') diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d index 0075de8..c861d1d 100755 --- a/src/sdp/sdp.d +++ b/src/sdp/sdp.d @@ -145,6 +145,33 @@ void main(string[] args) { flag_action ~= " " ~ arg; // flags not taken by getopt } else if (arg.match(rgx.src_pth)) { fns_src ~= arg; // gather input markup source file names for processing + } else if (arg.match(rgx.src_pth_contents)) { + import std.file, + std.path; + string contents_location_; + try { + if (exists(arg)) { + contents_location_ = arg.readText; + } + } + catch (ErrnoException ex) { + } + catch (FileException ex) { + // Handle errors + } + auto contents_locations_arr = + (cast(char[]) contents_location_).split; + auto tmp_dir_ = (arg).dirName.array; + foreach (contents_location; contents_locations_arr) { + assert(contents_location.match(rgx.src_pth), + "not a recognised file: " ~ + contents_location + ); + auto contents_location_pth_ = (contents_location).to!string; + fns_src ~= (((tmp_dir_).chainPath(contents_location_pth_)).array).to!(char[]); + } + } else if (arg.match(rgx.src_pth_zip)) { + // fns_src ~= arg; // gather input markup source file names for processing } else { // anything remaining, unused arg_unrecognized ~= " " ~ arg; } @@ -178,8 +205,9 @@ void main(string[] args) { } } enforce( - fn_src.match(rgx.src_pth), - "not a sisu markup filename" + fn_src.match(rgx.src_pth_types), + "not a sisu markup filename: <<" ~ + fn_src ~ ">>" ); auto t = SiSUabstraction!()(fn_src, opts, env); static assert(!isTypeTuple!(t)); -- cgit v1.2.3