lib_epub/
lib.rs

1#![allow(clippy::collapsible_if)]
2
3//! Epub library
4//!
5//! A Rust library for reading and manipulating EPUB eBook files.
6//!
7//! This library provides complete EPUB file parsing functionality,
8//! supporting EPUB 2 and EPUB 3 formats. It can extract metadata,
9//! access content files, and handle encrypted resources.
10//!
11//! ## Features
12//!
13//! - Parse EPUB file structure and containers
14//! - Extract book metadata (title, author, language, etc.)
15//! - Access content files and resource files
16//! - Handle encrypted content (font obfuscation, etc.; currently incomplete,
17//!   will be improved in future versions)
18//! - Optional EPUB build functionality (via the `builder` attribute)
19//! - EPUB specification-compliant verification mechanism
20//!
21//! ## Quick Start
22//!
23//! ### Read EPUB Files
24//!
25//! ```rust, ignore
26//! use lib_epub::epub::EpubDoc;
27//!
28//! let doc = EpubDoc::new("path/to/book.epub")?;
29//! let title = doc.get_title()?;
30//! println!("Title: {}", title);
31//! ```
32//!
33//! ### Enable Builder Feature
34//!
35//! Enable the builder feature in `Cargo.toml`:
36//!
37//! ```toml
38//! [dependencies]
39//! lib-epub = { version = "0.0.2", features = ["builder"] }
40//! ```
41//!
42//! ## Module Description
43//!
44//! - [epub] - Core functionality for EPUB document parsing
45//! - [error] - Error type definition
46//! - [types] - Data structure definition
47//! - [builder] - EPUB build functionality (requires enabling the `builder` feature)
48//!
49//! ### Exported Trait
50//!
51//! - [DecodeBytes] - Byte data decoding trait, used to convert raw bytes into strings
52
53pub(crate) mod utils;
54
55#[cfg(feature = "builder")]
56pub mod builder;
57pub mod epub;
58pub mod error;
59pub mod types;
60
61pub use utils::DecodeBytes;