diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-26 09:47:07 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-10-02 21:38:33 -0400 |
| commit | 6c14c162bdec65934fbda3b14295efcfc12d28d2 (patch) | |
| tree | 03248ba59d26ee584cbb428caf7d3795ea592ced /dlang/src/ocda/model.d | |
| parent | two 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/model.d')
| -rw-r--r-- | dlang/src/ocda/model.d | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/dlang/src/ocda/model.d b/dlang/src/ocda/model.d index 8ee0043..403502a 100644 --- a/dlang/src/ocda/model.d +++ b/dlang/src/ocda/model.d @@ -20,6 +20,8 @@ struct OcdaObject { string is_of_type; // para, block, comment: how the text behaves string own_section; // .section, when it differs from the block it sits in string segment_html_is;// the html segment this object sits in + string segment_epub; // the epub segment this heading opens + string segment_epub_is;// the epub segment this object sits in string table_aligns; // l c r per column string[] stow_link; // links extracted from the object string[] anchor_tags; // named targets the markup placed on this object |
