diff --git a/Cargo.lock b/Cargo.lock index 12ce256..ba48afb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,7 +42,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] -name = "brochurise-rs" +name = "brochurise" version = "0.1.0" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index d775663..8dab9b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "brochurise-rs" +name = "brochurise" version = "0.1.0" authors = ["southerntofu "] edition = "2018" diff --git a/README.md b/README.md new file mode 100644 index 0000000..6265fd7 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# brochurise + +`brochurise` allows you to produce PDF documents from your Markdown. It can generate a linear output and/or an A5 booklet so it can be easily printed. Multiple documents are generated to find the optimal font size, minimizing free space while ensuring the number of pages is a multiple of 4 so you can print your A5 booklets on A4 paper. + +## Demo + +You can run `cargo run -- example.md` to get the idea. + +## Requirements + +You need pandoc and a lateX environment. On Debian, you can do `sudo apt install pandoc texlive-extra-utils`. Additionally, some lateX templates may need additional packages. For example, the [eisvogel](https://github.com/Wandmalfarbe/pandoc-latex-template) template requires the `texlive-fonts-extra` package as well. + +## Usage + +``` +USAGE: + brochurise [FLAGS] [OPTIONS] [output] + +FLAGS: + -b, --book Only produce an A5 booklet (4 pages per A4 sheet) + -d, --debug Enable debug output + -h, --help Prints help information + -l, --linear Only produce a linear A4 output + -V, --version Prints version information + +OPTIONS: + -s, --size The smallest size [default: 11] + +ARGS: + Path to the Markdown file to be brochurised + Path to the PDF file to produce. When producing both linear and book output (default behavior, + unless -b or -l is set), `-book` will be appended to the booklet output path eg. output.pdf + and output-book.pdf +``` + +## License + +GPLv3 diff --git a/src/main.rs b/src/main.rs index 395dc6a..a811fa7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,9 +40,6 @@ struct Cli { /// The smallest size size: u8, - // pandoc::InputFormat does not implement FromStr so we can't use it here - //#[structopt(short = "v", long = "variant")] - //variant: pandoc::InputFormat, } fn main() -> Result<()> {