- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .gitignore | ||
| __init__.py | ||
| plugin-import-name-coven_stamper.txt | ||
| README.md | ||
| stamp.py | ||
Coven Stamper (calibre plugin)
Stamps every EPUB imported into the library with a stable document id
(<meta name="coven:docid">) and per-mille position markers (data-cp="NNN"
on the element whose text crosses each 0.1% of the book's visible
characters). See __init__.py for why.
Install / update:
cd ~/docker/cwa/plugins/coven_stamper && zip -j ../coven_stamper.zip __init__.py stamp.py plugin-import-name-coven_stamper.txt
cp ../coven_stamper.zip ~/docker/cwa/config/.config/calibre/plugins/
docker compose -f ~/docker/cwa/docker-compose.yml restart # CWA auto-registers zips at start (CWA_CALIBRE_USER_PLUGINS=1)
Check: docker exec cwa calibre-customize -l | grep -i coven.
Run by hand (no calibre needed beyond lxml):
docker exec -i cwa calibre-debug -e /tmp/stamp.py in.epub out.epub
Existing library books are not re-stamped — the hook fires on import
only. A one-off pass over /calibre-library is a separate step (and the
fork keeps checksums: see scripts/generate_book_checksums.py before
rewriting files in place).
Legacy ids: a book already known to koinsight under some other id
(e.g. Player Manager 10 is ea18d92c… there, from the Kobo) gets the
library file's own partial-MD5 as its stamped id. To keep the old one,
stamp that file once by hand with the existing id in the OPF, or rename
the id server-side. The stamper never overwrites an existing coven:docid.