Skip to content

Instantly share code, notes, and snippets.

@alexboly
alexboly / buildBook
Created August 30, 2016 10:01
Bash script to generate books from markdown in printable pdf, ebook pdf, epub, mobi and pdf preview formats
#!/bin/bash
hash pandoc 2>/dev/null || { echo >&2 "Please install pandoc. Aborting."; exit 1; }
hash pdftk 2>/dev/null || { echo >&2 "Please install pdftk. Aborting."; exit 1; }
hash ebook-convert 2>/dev/null || { echo >&2 "Please install ebook-convert. Aborting."; exit 1; }
SOURCE=Usable-Software-Design.md
PRINT_DESTINATION=Usable-Software-Design-print.pdf
PDF_DESTINATION=Usable-Software-Design.pdf
PREVIEW_DESTINATION=Usable-Software-Design-Preview.pdf