summaryrefslogtreecommitdiffhomepage
path: root/dlang/src/ocda/load_ssp.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-26 09:47:07 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-10-02 21:38:33 -0400
commit6c14c162bdec65934fbda3b14295efcfc12d28d2 (patch)
tree03248ba59d26ee584cbb428caf7d3795ea592ced /dlang/src/ocda/load_ssp.d
parenttwo fields the model was missing, found by writing an html writer (diff)
images from the source, and the epub segment fields
Two additions the epub writer needed and could not have without. ocda.images: an image's bytes, from whichever input form the document came from. The model names images, with digest, byte size and pixel size, and does not hold them - which is right, an abstraction is not a bundle of assets - so something has to know where they are, and the answer depends on the input form rather than on the output. Hence the library. .ocda.db the files table, role 'image', by name .sisupod the archive entry whose path ends in /image/<name> .zip the same .ssp beside it: a pod puts the abstraction in media/abstraction/ and its images in media/image/, so the path is documented rather than guessed canGiveImages says whether a source can answer at all, because a writer has to know before it emits an <img>: a manifest item whose file is absent and an <img> whose file is not in the manifest are both epubcheck errors. A .ssp outside a pod has nowhere to look, and that is absence rather than error - the document is still readable. Reading a blob needed sqlite3_column_blob rather than _column_text: an image read as text stops at the first zero byte, and a png's ninth byte is zero. And two more model fields: segment_epub and segment_epub_is. The epub segments at heading levels 1 to 4 where the html segments at level 4 alone, so the two are different files and the abstraction records both. Nine of the 36 documents have images; the four-way agreement still holds at 36 of 36 each way. (assisted by Claude-Code)
Diffstat (limited to 'dlang/src/ocda/load_ssp.d')
-rw-r--r--dlang/src/ocda/load_ssp.d5
1 files changed, 5 insertions, 0 deletions
diff --git a/dlang/src/ocda/load_ssp.d b/dlang/src/ocda/load_ssp.d
index 962e8f6..34d156c 100644
--- a/dlang/src/ocda/load_ssp.d
+++ b/dlang/src/ocda/load_ssp.d
@@ -198,6 +198,11 @@ private void parseProperty(string line, ref OcdaObject obj, ref OcdaUnknown unkn
case "section": obj.own_section = value; break;
case "identifier": obj.identifier = value; break;
case "segment_html_is": obj.segment_html_is = value; break;
+ /+ ↓ the epub segments at heading levels 1 to 4 where the html
+ segments at level 4 alone, so the two are different files and
+ the abstraction records both +/
+ case "segment_epub": obj.segment_epub = value; break;
+ case "segment_epub_is": obj.segment_epub_is = value; break;
case "table_aligns": obj.table_aligns = value; break;
case "stow_link": obj.stow_link ~= value; break;
case "anchor_tag": obj.anchor_tags ~= value; break;