aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/out_src_abstraction_sqlite_db.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-08 16:09:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-09 18:28:25 -0400
commitc16ada7749d842fa868b7b8b25a1ff17ffdf7b40 (patch)
tree8a4d4460d4572af5590302d5c927e8ed66b689ae /org/out_src_abstraction_sqlite_db.org
parentocda loader: one way in whatever the source (diff)
output: the abstraction artefacts live with the pod
pod/ holds all document source representations: pod/<doc>/ source tree pod/<doc>/media/abstraction/<uid>.ssp abstraction, as text pod/<doc>.zip tree, zipped, .ssp included pod/<doc>.digests.txt sha256s of what is in them pod/<uid>.ocda.db abstraction, as sqlite db <lang>/abstraction/ is gone. pod/<doc>/media/abstraction/<uid>.ssp preferred as having the images (found within the pod tree) which .ssp needs to reproduce a document but does not carry on its own. The .ocda.db sits carries the images as well and (like the pod.zip) can be used to reproduce a document directly. digests.txt now covers the database as well as the zip, the source and the .ssp; (as does the metadata html page). Two ordering issues addressed: - the pod builder clean-slates pod/<doc>/ before regenerating it, and the .ssp is now written before that runs. The clean slate now leaves media/abstraction/ alone, and the .ssp writer clears that directory itself on the first language of a run, so a .ssp for a language the document no longer is removed and cannot be bundled. - for a multi-language document the .ssp files accumulate one language at a time and are bundled on the last, which is why the directory cannot simply be emptied by whichever (language) gets there first. (assisted by Claude-Code)
Diffstat (limited to 'org/out_src_abstraction_sqlite_db.org')
-rw-r--r--org/out_src_abstraction_sqlite_db.org16
1 files changed, 11 insertions, 5 deletions
diff --git a/org/out_src_abstraction_sqlite_db.org b/org/out_src_abstraction_sqlite_db.org
index 9e425bf..9144fdd 100644
--- a/org/out_src_abstraction_sqlite_db.org
+++ b/org/out_src_abstraction_sqlite_db.org
@@ -42,6 +42,7 @@ template spineAbstractionDb() {
import std.array;
import d2sqlite3;
import sisudoc.outputs.io_out.paths_output;
+ import sisudoc.ocda.io_in.paths_source;
/+ ↓ the abstraction is passed in rather than taken from doc, because the
caller hands over one that has been through the .ssp: written as text
and read back. so the database is a function of the .ssp and cannot
@@ -49,11 +50,16 @@ template spineAbstractionDb() {
+/
void spineAbstractionDb(D,A)(D doc, A doc_abstraction) {
auto doc_matters = doc.matters;
-
- /+ ↓ determine output path +/
- auto out_pth = spineOutPaths!()(doc_matters.output_path, doc_matters.src.language);
- string base_dir = "abstraction";
- string base_pth = ((out_pth.output_base.chainPath(base_dir)).asNormalizedPath).array;
+ /+ ↓ output path: beside the pod's zip and digests, not under
+ <lang>/abstraction/. the database carries its own images, so it is a
+ distributable artefact in its own right and belongs with the others:
+ pod/<doc>/ the source tree
+ pod/<doc>.zip the same, zipped
+ pod/<doc>.digests.txt what is in them
+ pod/<uid>.ocda.db the abstraction, one per language
+ +/
+ auto pths_pod = spinePathsPods!()(doc_matters);
+ string base_pth = pths_pod.pod_dir_();
try {
if (!exists(base_pth)) {
base_pth.mkdirRecurse;