{"name":"@deckyard/epub","description":"Read and write EPUB books: metadata, chapters, table of contents, images and styles","versions":{"0.1.0":{"version":"0.1.0","kind":"git","url":"https://github.com/deckyard/deck-epub.git","ref":"0.1.0","commit":"3cf38d8190c17a9b749a740e1539b82184c94385","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.26.0","jennifer-tiny":"\u003e=0.26.0"},"capabilities":[],"keywords":["epub","ebook","xhtml","opf","markdown"],"description":"Read and write EPUB books: metadata, chapters, table of contents, images and styles","publishedAt":"1794767266","repoId":1458173513,"repoOwnerId":346943577,"repoOwner":"deckyard"},"0.2.0":{"version":"0.2.0","kind":"git","url":"https://github.com/deckyard/deck-epub.git","ref":"0.2.0","commit":"e1f0084b69e42c0a237e00644287a9d1be4fbd6e","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.26.0","jennifer-tiny":"\u003e=0.26.0"},"capabilities":[],"keywords":["epub","ebook","xhtml","opf","markdown"],"description":"Read and write EPUB books: metadata, chapters, table of contents, images and styles","publishedAt":"1795117424","repoId":1458173513,"repoOwnerId":346943577,"repoOwner":"deckyard"},"0.3.0":{"version":"0.3.0","kind":"git","url":"https://github.com/deckyard/deck-epub.git","ref":"0.3.0","commit":"2e96a85c6f1647c368dc01798f8c062af1325064","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.27.0","jennifer-tiny":"\u003e=0.27.0"},"capabilities":[],"keywords":["epub","ebook","xhtml","opf","markdown"],"description":"Read and write EPUB books: metadata, chapters, table of contents, images and styles","publishedAt":"1795557514","repoId":1458173513,"repoOwnerId":346943577,"repoOwner":"deckyard"},"0.3.1":{"version":"0.3.1","kind":"git","url":"https://github.com/deckyard/deck-epub.git","ref":"0.3.1","commit":"50371d482792b3b4ec38a91f17f6b0d7db900b89","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.28.0","jennifer-tiny":"\u003e=0.28.0"},"capabilities":[],"keywords":["epub","ebook","xhtml","opf","markdown"],"description":"Read and write EPUB books: metadata, chapters, table of contents, images and styles","publishedAt":"1795810682","repoId":1458173513,"repoOwnerId":346943577,"repoOwner":"deckyard"}},"readme":"# @deckyard/epub\n\n[![test](https://github.com/deckyard/deck-epub/actions/workflows/test.yml/badge.svg)](https://github.com/deckyard/deck-epub/actions/workflows/test.yml)\n[![Documentation](https://img.shields.io/badge/docs-github%20pages-blue)](https://deckyard.github.io/deck-epub/)\n[![release](https://img.shields.io/github/v/release/deckyard/deck-epub)](https://github.com/deckyard/deck-epub/releases/latest)\n\nRead and write EPUB™ books in a [Jennifer](https://jennifer-lang.dev/)\nprogram, in pure Jennifer. Writing builds EPUB 3.3 (with an optional EPUB 2\n`toc.ncx`) from XHTML or Markdown chapters, a cover, pictures and a\nstylesheet, deterministically: the same book gives the same bytes, stored or\n(optionally) deflated, left-to-right or right-to-left, reflowable or\nfixed-layout, with landmarks and a page list. Batch builders add many\nchapters or pictures in one call, and `check` lists links in the book that\nlead nowhere; `rename` moves a file and the links to it, and `writable`\nmakes a read book (EPUB 2 chapters, fixed-layout comics, media overlays)\none `build` writes cleanly. Reading takes EPUB\n2 and 3 files and returns the metadata, the chapters in reading order, the\ntable of contents, the other files, the landmarks and page list, the\nfixed-layout settings and each chapter as plain text; chapters that are not\nwell-formed XML are read as HTML, common faults (a declared legacy charset,\na missing or case-mismatched file, an imperfect `mimetype`) are tolerated\nand listed in the book's `notes`, and DRM-protected books are refused with a\ncatchable error.\n\n**[Documentation](https://deckyard.github.io/deck-epub/)**\n\n## Install\n\n```sh\njvc add @deckyard/epub\n```\n\nThis vendors the deck to `vendor/\u003cscope\u003e/epub/`. Without `jvc`, unpack the\n`src/` subtree of a release archive (`\u003cscope\u003e-epub-\u003cversion\u003e.tar.gz`) there.\n\n## Usage\n\n```jennifer\nimport \"@deckyard/epub/\" as epub;\n\ndef b as epub.Book init epub.book(\"Field Notes\", \"en\");\n$b = epub.author($b, \"Ada Lovelace\");\n$b = epub.markdownChapter($b, \"one.xhtml\", \"Observations\", \"# Observations\\n\\nThe engine weaves.\\n\");\nfs.writeBytes(\"notes.epub\", epub.build($b));\n\ndef back as epub.Book init epub.read(fs.readBytes(\"notes.epub\"));\nfor (def c in $back.chapters) {\n    io.printf(\"%s\\n%s\\n\", $c.title, epub.text($c));\n}\n```\n\n## Requirements\n\nJennifer 0.28.0 or newer. No capability: the deck works on bytes and does no\nfile, network or process access of its own. It uses the `archive`, `xml`,\n`crc`, `hash` and `encoding` libraries and the bundled `markdown` and `html`\nmodules. Runs on `jennifer-tiny` too, within its smaller nesting and\nmemory limits (see the reading guide).\n\n## Development\n\n```sh\ntools/check-all.sh                 # the full gate, as CI runs it\njennifer test src/epub_test.j      # the test overlays\ntools/check-docs.sh                # docs against the code\ntools/build-fixtures.sh            # regenerate the Gutenberg fixtures (network)\ntools/pack.sh dist                 # build the release archive\n```\n\n`tools/check-extra.sh` also validates a built book with\n[EPUBCheck](https://www.w3.org/publishing/epubcheck/) when Docker™ and the\nEPUBCheck jar are available (`EPUBCHECK_JAR=/path/to/epubcheck.jar`), and\nskips that check otherwise.\n\n## Trademarks\n\nEPUB™ is a trademark of the World Wide Web Consortium, Inc. (W3C). Adobe™ is\na trademark of Adobe Inc. Apple™ and FairPlay™ are trademarks of Apple Inc.\nProject Gutenberg™ and other product and company names may be trademarks of\ntheir respective owners. They are used only to identify the formats and\nproducts this deck works with. This deck is an independent project, not\naffiliated with, sponsored or endorsed by the W3C, the Project Gutenberg\nLiterary Archive Foundation, Adobe Inc. or Apple Inc.\n\n## Licence\n\nLGPL-3.0-only, see [LICENSE](LICENSE). Copyright (C) 2026 mplx \u0026lt;mplx@jennifer-lang.dev\u0026gt;.\n\nThe tests read Project Gutenberg™ eBook #1080 (Jonathan Swift, \"A Modest\nProposal\", public domain) from `testdata/gutenberg/`: Project Gutenberg's own\nfiles, unmodified, under the Project Gutenberg licence included in them. They\nare not part of the deck's `src/`; see `testdata/gutenberg/README.md`.\n\n`tools/check-headers.sh` checks every source file's SPDX header against\n`deck.toml`.\n"}