Skip to content

Library (Rust crate and JS lib with WASM core) for converting Epub files to text-only Book structures

License

Notifications You must be signed in to change notification settings

jannes/epubparse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Epubparse

⚠️ Work in progress

NPM Crates.io Docs.rs

This library aims to convert Epub files into text-only Book structures that can be used to do analysis of the contained text. It is published both as a Rust crate to crates.io and as a NPM package (ESM module) to npm.

Design goals

  • ✅ perform a reasonable conversion into a book with chapters
  • ✅ support Epub version 2 table of contents (.ncx)
  • ❌ support Epub version 3 table of contents (.xhtml) (not yet implemented, but
    many version 3 epubs also include version 2 table of contents, these should also work)

Structure

  • epubparse-rs: core Rust library that compiles to WASM (published to crates.io)
  • epubparse-wasm: wrapper around Rust core that provides JS compatible data types from WASM functions (published to npm, only meant to be consumed by JS lib)
  • epubparse-js: JS library with ergonomic API including Typescript definitions (published to npm, for use in Browser and Node.js)

Steps to release

Prepare

  • bump version in epubparse-rs/Cargo.toml
  • bump versions in epubparse-wasm/Cargo.toml and epubparse-wasm/package.json
  • go to epubparse-wasm folder and run build_package.sh
  • bump version and epubparse-wasm dependency verion in epubparse-js/package.json
  • commit

Release

Crates.io

  • cd into epubparse-rs
  • run cargo publish --dry-run to verify
  • run cargo publish

NPM

Wasm
  • cd into epubparse-wasm
  • run wasm-pack login
  • run wasm-pack publish
JS
  • run npm run build
  • run npm publish

About

Library (Rust crate and JS lib with WASM core) for converting Epub files to text-only Book structures

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published