This commit is contained in:
Maverick Liu 2025-02-21 17:04:00 +08:00
commit 749af017ca
6 changed files with 1061 additions and 0 deletions

21
src/main.rs Normal file
View file

@ -0,0 +1,21 @@
use std::path::PathBuf;
use clap::Parser;
use epub2mdbook::convert_epub_to_mdbook;
#[derive(Parser)]
struct Args {
/// The path to the input EPUB file
#[clap(short, long)]
input_epub_path: PathBuf,
/// The path to the output directory
#[clap(short, long)]
output_dir: Option<PathBuf>,
}
fn main() -> anyhow::Result<()> {
let args = Args::parse();
convert_epub_to_mdbook(args.input_epub_path, args.output_dir)?;
println!("Conversion completed successfully!");
Ok(())
}