| Crates.io | epub2mdbook |
| lib.rs | epub2mdbook |
| version | 0.16.1 |
| created_at | 2025-02-21 15:36:25.864333+00 |
| updated_at | 2026-01-06 11:36:36.80616+00 |
| description | A tool to convert EPUB files to MDBook format |
| homepage | |
| repository | https://github.com/cyborg42/epub2mdbook |
| max_upload_size | |
| id | 1564327 |
| size | 37,982 |
A fast and reliable tool to convert EPUB e-books to MDBook format.
SUMMARY.md from the EPUB table of contentsbook.toml with metadata (title, authors, description, language)cargo install epub2mdbook
git clone https://github.com/cyborg42/epub2mdbook.git
cd epub2mdbook
cargo install --path .
# Basic usage - creates a subdirectory named after the book
epub2mdbook book.epub
# Specify output directory
epub2mdbook book.epub --output-dir ./output
# Output directly to the directory without creating a subdirectory
epub2mdbook book.epub --output-dir ./my-book --flat
Add to your Cargo.toml:
[dependencies]
epub2mdbook = "0.16"
Then use in your code:
use epub2mdbook::convert_epub_to_mdbook;
fn main() -> Result<(), epub2mdbook::error::Error> {
// Creates ./output/book_name/ with the converted content
convert_epub_to_mdbook("book.epub", "./output", true)?;
// Or output directly to ./my-book/ without subdirectory
convert_epub_to_mdbook("book.epub", "./my-book", false)?;
Ok(())
}
output/
└── book_name/
├── book.toml
└── src/
├── SUMMARY.md
├── chapter1.md
├── chapter2.md
└── images/
└── cover.png
This project is licensed under the MIT License