diff options
Diffstat (limited to 'org/sdp.org')
| -rw-r--r-- | org/sdp.org | 71 | 
1 files changed, 44 insertions, 27 deletions
| diff --git a/org/sdp.org b/org/sdp.org index 650fb21..27b6cc8 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -26,7 +26,7 @@ struct Version {    int minor;    int patch;  } -enum ver = Version(0, 22, 0); +enum ver = Version(0, 23, 0);  #+END_SRC  ** compilation restrictions (supported compilers) @@ -78,7 +78,7 @@ void main(string[] args) {    <<sdp_args>>    <<sdp_env>>    <<sdp_do_selected>> -  if (_manifests.length > 1) { // _manifests[0] is dummy element used in initialization to be removed +  if (_manifests.length > 1) { // _manifests[0] initialized dummy element      foreach(manifest; _manifests[1..$]) {        if (!empty(manifest.src_fn)) {          <<sdp_each_file_do_scope>> @@ -477,7 +477,7 @@ struct OptActions {  auto _opt_action = OptActions();  #+END_SRC -***** getopt processing path +***** getopt processing path, _manifest[]                                      >>  #+NAME: sdp_args  #+BEGIN_SRC d @@ -485,19 +485,19 @@ auto _env = [    "pwd" : environment["PWD"],    "home" : environment["HOME"],  ]; -auto _manifest = PodManifest!()(); -auto _manifest_plus = PodMatters!()(_opt_action, _env); -auto _manifests = [ _manifest_plus ]; +auto _manifest_start = PodManifest!()(); +auto _manifest_matter = PodMatters!()(_opt_action, _env); +auto _manifests = [ _manifest_matter ];  foreach(arg; args[1..$]) { -  _manifest = PodManifest!()(arg); +  _manifest_start = PodManifest!()(arg);    if (arg.match(rgx.flag_action)) {      flag_action ~= " " ~ arg;   // flags not taken by getopt    } else if (arg.match(rgx.src_pth)) {      _manifests ~= PodMatters!()(_opt_action, _env, arg, arg); // gather input markup source file names for processing -  } else if (_manifest.pod_manifest_file_with_path) { +  } else if (_manifest_start.pod_manifest_file_with_path) {      string contents_location_raw_;      string contents_location_; -    string sisudoc_txt_ = _manifest.pod_manifest_file_with_path; +    string sisudoc_txt_ = _manifest_start.pod_manifest_file_with_path;      enforce(        exists(sisudoc_txt_)!=0,        "file not found: «" ~ @@ -536,8 +536,8 @@ foreach(arg; args[1..$]) {          || (contents_location_pth_).match(lang_rgx_)        ) {          auto _fns = (((tmp_dir_).chainPath(contents_location_pth_)).array).to!(string); -        _manifest_plus = PodMatters!()(_opt_action, _env, arg, _fns, contents_locations_arr); -        _manifests ~= _manifest_plus; // TODO how to capture? +        _manifest_matter = PodMatters!()(_opt_action, _env, arg, _fns, contents_locations_arr); +        _manifests ~= _manifest_matter; // TODO how to capture?        }      }    } else if (arg.match(rgx.src_pth_zip)) { @@ -676,7 +676,7 @@ module sdp.meta.metadoc;  template SiSUabstraction() {    <<imports_sdp>>    <<sdp_mixin>> -  enum headBody { header, body_content, insert_filelist } +  enum headBody { header, body_content, insert_file_list, image_list }    enum makeMeta { make, meta }    enum docAbst  { doc_abstraction, section_keys, segnames, segnames_0_4, images }    static auto rgx = Rgx(); @@ -697,37 +697,52 @@ template SiSUabstraction() {  }  #+END_SRC -** 1. (a) _read in raw file_ (b) split content into: _doc header & doc content_ +** 1. raw file content split, doc: _header_, _content_ +(lists: subdocs? images?)  >>  - [[./meta_read_source_files.org][meta_read_source_files]]  - read in the _marked up source document_ and    - split the document into:      - document header      - document body -  - if a master document make a list of insert files +      - from markup source +      - if master document from sub documents content +  - if a master document +    - make a list of insert files +  - if build source pod requested +    - scan for list of images +      (action avoided if not needed at this stage) +  - _return a tuple of_:    - header    - body    - insert file list +  - image list (if build source pod requested) + +if build source pod requested all information needed to build it available at this point +  - manifest related information  _manifest +  - insert file list              _header_body_insertfilelist_imagelist[headBody.insert_file_list] +  - image list                    _header_body_insertfilelist_imagelist[headBody.image_list]  #+NAME: sdp_each_file_do_read_and_split_sisu_markup_file_content_into_header_and_body  #+BEGIN_SRC d  /+ ↓ read file (filename with path) +/  /+ ↓ file tuple of header and content +/  debug(steps) { -  writeln(__LINE__, ":", __FILE__, ": step1 commence → (get document header & body & insert files)"); +  writeln(__LINE__, ":", __FILE__, +    ": step1 commence → (get document header & body & insert file list & if needed image list)" +  );  } -auto _header_body_inserts = -  SiSUrawMarkupContent!()(_manifest.src_fn); -static assert(!isTypeTuple!(_header_body_inserts)); -static assert(_header_body_inserts.length==3); +auto _header_body_insertfilelist_imagelist = +  SiSUrawMarkupContent!()(_opt_action, _manifest.src_fn); +static assert(!isTypeTuple!(_header_body_insertfilelist_imagelist)); +static assert(_header_body_insertfilelist_imagelist.length==4);  debug(steps) {    writeln(__LINE__, ":", __FILE__, ": step1 complete");  }  debug(header_and_body) {    writeln(header); -  writeln(_header_body_inserts.length); -  writeln(_header_body_inserts.length[headBody.body_content][0]); +  writeln(_header_body_insertfilelist_imagelist.length); +  writeln(_header_body_insertfilelist_imagelist.length[headBody.body_content][0]);  }  #+END_SRC @@ -748,16 +763,18 @@ debug(header_and_body) {  #+BEGIN_SRC d  /+ ↓ split header into make and meta +/  debug(steps) { -  writeln(__LINE__, ":", __FILE__, ": step2 commence → (doc header: make & meta as struct)"); +  writeln(__LINE__, ":", __FILE__, +    ": step2 commence → (doc header: make & meta as struct)" +   );  }  auto _make_and_meta_struct = -  docHeaderMakeAndMetaTupExtractAndConvertToStruct!()(conf_files_composite_make, _header_body_inserts[headBody.header]); // breakage ... +  docHeaderMakeAndMetaTupExtractAndConvertToStruct!()(conf_files_composite_make, _header_body_insertfilelist_imagelist[headBody.header]); // breakage ...  debug(steps) {    writeln(__LINE__, ":", __FILE__, ": step2 complete");  }  #+END_SRC -** 3. _document abstraction, tuple_ (pre-output-processing)       :processing: +** 3. _document abstraction, tuple_ (output-pre-processing)                      >>  - [[./meta_abstraction.org][meta_abstraction]]  - prepare the document abstraction used in downstream processing @@ -778,7 +795,7 @@ debug(steps) {    writeln(__LINE__, ":", __FILE__, ": step3 commence → (document abstraction (da); da keys; segnames; doc_matters)");  }  auto da = SiSUdocAbstraction!()( -  _header_body_inserts[headBody.body_content], +  _header_body_insertfilelist_imagelist[headBody.body_content],    _make_and_meta_struct,    _opt_action,  ); @@ -794,7 +811,7 @@ debug(steps) {  }  #+END_SRC -** 4. _document matters_ (doc info gathered, various sources) +** 4. _document matters_ (doc info gathered, various sources)                    >>  - prepare document_matters, miscellany about processing and the document of use    in downstream processing @@ -865,7 +882,7 @@ struct DocumentMatters {      return _manifest.pod_image_dirs;    }    auto file_insert_list() { -    string[] _k = _header_body_inserts[headBody.insert_filelist]; +    string[] _k = _header_body_insertfilelist_imagelist[headBody.insert_file_list];      return _k;    }    auto image_list() { | 
