A terminal-based EPUB reader written in Rust. This application allows you to read EPUB files directly in your terminal with a clean, navigable interface.
- Open and read EPUB 2.0 and 3.0 format books
- Terminal-based user interface with vim-like navigation
- Chapter navigation (next/previous/goto)
- Table of contents view
- Metadata display
- Text rendering with basic formatting (headings, paragraphs, emphasis)
- Keyboard shortcuts for easy navigation
- Rust and Cargo (install from rustup.rs)
-
Clone the repository:
git clone https://github.com/yourusername/epub_reader.git cd epub_reader -
Build the project:
cargo build --release -
The executable will be available at
target/release/epub_reader
Run the application with an EPUB file as an argument:
epub_reader path/to/your/book.epub
j: Scroll downk: Scroll upCtrl+d: Scroll half page downCtrl+u: Scroll half page upg: Go to the beginning of the textG: Go to the end of the textn: Go to the next chapterp: Go to the previous chapter:: Enter command modeq: Quit the applicationEsc: Return to main view from TOC or metadata view
Enter command mode by pressing : and then type one of the following commands:
qorquit: Exit the applicationnornext: Go to the next chapterporprev: Go to the previous chapterg <number>orgoto <number>: Go to a specific chapter by numbertortoc: Show the table of contentsmormeta: Show the book metadata
Press Enter to execute a command or Esc to cancel.
src/main.rs: Application entry pointsrc/epub/mod.rs: EPUB file parsing and handlingsrc/navigation.rs: Chapter navigation and TOC managementsrc/metadata.rs: EPUB metadata handlingsrc/render/mod.rs: XHTML to text renderingsrc/ui/mod.rs: Terminal UI implementationsrc/errors.rs: Error handling
zip: For handling EPUB files (which are ZIP archives)roxmltree: XML parsingscraper: HTML parsingthiserror: Error handlingego-tree: Tree data structuresratatui: Terminal UI frameworkcrossterm: Terminal manipulationunicode-width: Unicode text width calculationstextwrap: Text wrapping utilities
Contributions are welcome! Please feel free to submit a Pull Request.