ebook-rs 0.2.0

Pure Rust EPUB parser and reader engine with CFI location mapping, full-text search, font de-obfuscation, and WASM/HTTP reader support.
Documentation

πŸ“– EBook-RS: Multi-Format Rust EBook Parser and Reader Engine (v0.2.0)

ebook-rs is a high-performance, 100% pure Rust parser and reader engine for EPUB 2, EPUB 3, MOBI, AZW3 (KF8), FB2 (FictionBook 2), KEPUB (Kobo EPUB), and LIT (Microsoft Reader) formats, designed for full feature parity with epub.js and foliate-js.


⚑ Feature Parity Matrix

Feature πŸš€ ebook-rs (v0.2.0) πŸ“¦ epub.js πŸ“– foliate-js πŸ¦€ rbook
EPUB 2 & 3 Support βœ… Yes βœ… Yes βœ… Yes βœ… Yes
MOBI & AZW3 Support βœ… Native PalmDOC LZ77 ❌ No βœ… Yes ❌ No
FB2 (FictionBook 2) Support βœ… Native XML ❌ No βœ… Yes ❌ No
KEPUB & LIT Support βœ… Native ❌ No βœ… Yes ❌ No
Full-Text Search Engine βœ… 0.59ms / 0-alloc ❌ Third-party βœ… Yes ❌ No
EPUB Canonical Fragment Identifiers (CFI) βœ… Complete IDPF Spec βœ… Yes βœ… Yes ❌ No
Locations & Progress Indexing βœ… Discrete Chunks ⚠️ Slow (DOM) βœ… Yes ❌ No
Font De-Obfuscation (IDPF & Adobe) βœ… Native SHA-1/XOR ❌ No βœ… Yes ❌ No
Pre-Display Transformation Hooks βœ… Pipeline Hooks ❌ No βœ… Yes ❌ No
EPUB 3 Landmarks & Page-List βœ… Full Parser βœ… Yes βœ… Yes ❌ No
Base64 Asset Inlining βœ… Auto Images/Fonts/CSS ❌ Blob URIs ❌ Blob URIs ❌ No
WebAssembly Browser Support βœ… wasm-bindgen ❌ JS Only ❌ JS Only ❌ No
Embedded HTTP Reader App βœ… Built-in Server ❌ No ❌ No ❌ No
Double-Spread & Continuous Scroll βœ… CSS Column / Vertical βœ… Yes βœ… Yes ❌ No
CBZ / CBR Comic Archive Support ❌ Planned v0.3.0 ❌ No βœ… Yes ❌ No
Readium Webpub Manifest Export ❌ Planned v0.3.0 ❌ No βœ… Yes ❌ No
PDF Document Rendering Bridge ❌ Planned v0.3.0 ❌ No βœ… Yes ❌ No

πŸ—ΊοΈ Project Roadmap

  • v0.1.0: Core EPUB 2/3 parser, CFI Engine, Location Progress, Annotations, Web UI Server, WASM Bindings.
  • v0.2.0: Native Multi-Format Support (MOBI, AZW3, FB2, KEPUB, LIT), IDPF & Adobe Font De-obfuscation, EPUB 3 Landmarks & Page List, Pre-Display Transformation Hooks, 100% Audit Bug Fixes.
  • v0.3.0 (Planned): PDF Rendering Bridge, CBZ/CBR Comic Archive Parser, Readium Webpub Manifest Export.

πŸš€ Quick Start Example

use ebook_rs::Book;

fn main() -> Result<(), String> {
    // Auto-detects and opens EPUB, MOBI, AZW3, FB2, KEPUB, or LIT files
    let mut book = Book::from_file("book.azw3")?;

    println!("Title: {}", book.metadata().title);
    println!("Sections: {}", book.spine().len());

    // Search across all chapters
    let matches = book.search("Rabbit");
    println!("Found {} search matches", matches.len());

    Ok(())
}

πŸ“„ License

Dual-licensed under MIT or Apache-2.0.