diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2025-02-19 15:03:38 -0500 | 
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2025-02-19 15:03:41 -0500 | 
| commit | 48fc249d6c82062b87db0dead5204d09e79edda8 (patch) | |
| tree | 5944fedd91aacaa9f0503e1a55702fcc80074b80 /org/spine.org | |
| parent | org, touch, minor (diff) | |
document (metadata & abstraction) struct
- struct replaces tuple
- some direct naming of structs returned
  (instead of use of auto) - minor
Diffstat (limited to 'org/spine.org')
| -rw-r--r-- | org/spine.org | 76 | 
1 files changed, 41 insertions, 35 deletions
diff --git a/org/spine.org b/org/spine.org index f1fc7b2..f6e7faa 100644 --- a/org/spine.org +++ b/org/spine.org @@ -1282,7 +1282,7 @@ enforce(  *** 1. _document abstraction_ [#A]  - return tuple of: -  - doc_abstraction (the document) +  - doc.abstraction (the document)    - doc_matters  #+NAME: spine_each_file_do_abstraction @@ -1292,11 +1292,10 @@ if ((_opt_action.debug_do)  ) {    writeln("--->\nstepX commence → (document abstraction) [", manifest.src.filename, "]");  } -auto t = spineAbstraction!()(_env, program_info, _opt_action, _cfg, manifest, _make_and_meta_struct); -static assert(t.length==2); -auto doc_abstraction = t[dAM.abstraction]; -auto doc_matters = t[dAM.matters]; -if ((doc_matters.opt.action.debug_do) +auto doc = spineAbstraction!()(_env, program_info, _opt_action, _cfg, manifest, _make_and_meta_struct); +auto doc_abstraction = doc.abstraction; +auto doc_matters = doc.matters; +if ((doc.matters.opt.action.debug_do)    || (_opt_action.debug_do_stages)  ) {    writeln("- stepX complete for [", manifest.src.filename, "]"); @@ -1323,9 +1322,9 @@ if ((doc_matters.opt.action.debug_do)  #+NAME: spine_each_file_do_debugs_checkdoc_0  #+BEGIN_SRC d  /+ ↓ debugs +/ -if (doc_matters.opt.action.show_summary) { +if (doc.matters.opt.action.show_summary) {    import sisudoc.meta.metadoc_show_summary; -  spineMetaDocSummary!()(doc_abstraction, doc_matters); +  spineMetaDocSummary!()(doc);  }  #+END_SRC @@ -1335,9 +1334,9 @@ if (doc_matters.opt.action.show_summary) {  #+NAME: spine_each_file_do_debugs_checkdoc_1  #+BEGIN_SRC d  /+ ↓ debugs +/ -if (doc_matters.opt.action.show_metadata) { +if (doc.matters.opt.action.show_metadata) {    import sisudoc.meta.metadoc_show_metadata; -  spineShowMetaData!()(doc_matters); +  spineShowMetaData!()(doc.matters);  }  #+END_SRC @@ -1347,9 +1346,9 @@ if (doc_matters.opt.action.show_metadata) {  #+NAME: spine_each_file_do_debugs_checkdoc_2  #+BEGIN_SRC d  /+ ↓ debugs +/ -if (doc_matters.opt.action.show_make) { +if (doc.matters.opt.action.show_make) {    import sisudoc.meta.metadoc_show_make; -  spineShowMake!()(doc_matters); +  spineShowMake!()(doc.matters);  }  #+END_SRC @@ -1359,9 +1358,9 @@ if (doc_matters.opt.action.show_make) {  #+NAME: spine_each_file_do_debugs_checkdoc_3  #+BEGIN_SRC d  /+ ↓ debugs +/ -if (doc_matters.opt.action.show_config) { +if (doc.matters.opt.action.show_config) {    import sisudoc.meta.metadoc_show_config; -  spineShowConfig!()(doc_matters); +  spineShowConfig!()(doc.matters);  }  #+END_SRC @@ -1370,17 +1369,17 @@ if (doc_matters.opt.action.show_config) {  #+NAME: spine_each_file_do_debugs_checkdoc_4  #+BEGIN_SRC d -if (doc_matters.opt.action.curate) { -  auto _hvst = spineMetaDocCurate!()(doc_matters, hvst); +if (doc.matters.opt.action.curate) { +  auto _hvst = spineMetaDocCurate!()(doc.matters, hvst);    if (      _hvst.title.length > 0      && _hvst.author_surname_fn.length > 0    ) {      hvst.curates ~= _hvst;    } else { -    if ((doc_matters.opt.action.debug_do) +    if ((doc.matters.opt.action.debug_do)        || (_opt_action.debug_do_curate) -      || (doc_matters.opt.action.vox_gt2) +      || (doc.matters.opt.action.vox_gt2)      ) {        writeln("WARNING curate: document header yaml does not contain information related to: title or author: ", _hvst.path_html_segtoc);      } @@ -1394,8 +1393,8 @@ if (doc_matters.opt.action.curate) {  #+NAME: spine_each_file_do_debugs_checkdoc_5  #+BEGIN_SRC d  /+ ↓ debugs +/ -if (doc_matters.opt.action.debug_do) { -  spineDebugs!()(doc_abstraction, doc_matters); +if (doc.matters.opt.action.debug_do) { +  spineDebugs!()(doc.abstraction, doc.matters);  }  #+END_SRC @@ -1413,16 +1412,12 @@ if (!(_opt_action.skip_output)) {  #+NAME: spine_each_file_do_selected_output  #+BEGIN_SRC d  /+ ↓ output hub +/ -if (!(doc_matters.opt.action.skip_output)) { -  if ((_opt_action.debug_do) -    || (_opt_action.debug_do_stages) -  ) { +if (!(doc.matters.opt.action.skip_output)) { +  if ((_opt_action.debug_do) || (_opt_action.debug_do_stages)) {      writeln("step5 commence → (process outputs) [", manifest.src.filename, "]");    } -  doc_abstraction.outputHub!()(doc_matters); -  if ((_opt_action.debug_do) -    || (_opt_action.debug_do_stages) -  ) { +  doc.abstraction.outputHub!()(doc.matters); +  if ((_opt_action.debug_do) || (_opt_action.debug_do_stages)) {      writeln("- step5 complete for [", manifest.src.filename, "]");    }  } @@ -1489,8 +1484,19 @@ template spineAbstraction() {      }      auto doc_matters = ST_DocumentMatters();      <<spine_each_file_do_document_matters_msg_step4_end>> -    auto t = tuple(doc_abstraction, doc_matters); -    return t; +    auto theDOC() { +      struct ST_DOC { +        const auto abstraction() { +          return doc_abstraction; +        } +        auto matters() { +          return doc_matters; +        } +      } +      return ST_DOC(); +    } +    auto the_doc = theDOC(); +    return the_doc;    }  }  #+END_SRC @@ -1589,12 +1595,12 @@ if ((_opt_action.debug_do)  - prepare the document abstraction used in downstream processing  - _return tuple of_: -  - document abstraction (_the_document_ or doc_abstraction) +  - document abstraction (_the_document_ or doc.abstraction)    - document abstraction keys      - (head, toc, body, endnotes, glossary, bibliography, bookindex, blurb, tail) -    - (transfer to _doc_matters_) -  - segnames for html epub (transfer to _doc_matters_) -  - image list (transfer to _doc_matters_) +    - (transfer to _doc.matters_) +  - segnames for html epub (transfer to _doc.matters_) +  - image list (transfer to _doc.matters_)  #+NAME: spine_each_file_do_document_abstraction  #+BEGIN_SRC d @@ -1632,7 +1638,7 @@ if ((_opt_action.debug_do)  if ((_opt_action.debug_do)    || (_opt_action.debug_do_stages)  ) { -  writeln("step4 commence → (doc_matters) [", _manifest.src.filename, "]"); +  writeln("step4 commence → (doc.matters) [", _manifest.src.filename, "]");  }  #+END_SRC  | 
