
Learning EPUB and e-ink by replacing the PocketBook SDK with pure Go
Hello,
I wanted to learn how an EPUB becomes pages on a screen, and whether PocketBook's SDK could be replaced with pure Go, without cgo.
Claude Code wrote the code. My part was steering it so the code stays easy to follow, and having it write documentation that teaches each part . I'm sharing it because I learned a lot.
- Device: instead of libinkview, a static Go binary draws into /dev/fb0, triggers e-ink refreshes with MXCFB ioctls, and talks to the firmware over System V message queues and shared memory.
- EPUB: a small layout engine with a CSS cascade, hyphenation, bidi, CJK, tables, MathML, SVG and pagination.
It's not meant for production: use KOReader for that. Nothing in a book is executed or fetched (no JS, no WebAssembly), so it's reasonably safe to try.