diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..866112b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,16 @@ +use std::process::Command; + +fn main() -> std::io::Result<()> { + // Invoke mdbook build in the directory containing book.toml + let status = Command::new("mdbook") + .arg("build") + .status()?; + + if status.success() { + println!("PDF successfully generated in book/pdf/output.pdf"); + } else { + eprintln!("Failed to generate PDF"); + } + + Ok(()) +}