<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
agentforce314/clawcodex/epub-ebooklib
──Details
PublishedOctober 22, 2026 at 04:28 PM
Content Hashsha256:9ae2165d0adaaeee...
Git SHA31407e32b209
──Files
Files (1 file, 799 B)
SKILL.md799 Bactive
SKILL.md · 14 lines · 799 B

version: "1.0.0" name: epub-ebooklib description: Build an EPUB with Python ebooklib without producing empty chapters; use whenever creating .epub files.


Building EPUBs with ebooklib

  • Run with /usr/bin/python3 if the default python lacks ebooklib.
  • Set chapter content as BYTES with no XML declaration: ch.content = html.encode("utf-8"), where html starts with <html ...> and NOT <?xml ...?>. A str starting with <?xml silently serializes as an empty chapter.
  • Escape text (html.escape) and wrap paragraphs in <p>.
  • Add every chapter to book.spine and a epub.EpubNcx() / epub.EpubNav().
  • Right after epub.write_epub, verify once: unzip the file, check each chapter xhtml is larger than ~500 bytes. Fix at once if not, then stop; do not re-verify repeatedly.
All versions