Guest User

Untitled

a guest
Feb 25th, 2020
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. set -e
  3.  
  4. # helper script for running ebook-convert, available from Calibre (calibre-ebook.com)
  5. #   sudo apt install calibre
  6.  
  7. title="the Ethics of Anarcho-Capitalism"
  8. author="Kristopher A. Borer"
  9. cover="--cover=cover_front.png"
  10. language="--language=English"
  11. tags="--tags=anarcho-capitalism,ethics,libertarianism,freedom,liberty,capitalism,anarchism"
  12. heuristics="--enable-heuristics"
  13.  
  14. options="$cover $language $tags $heuristics"
  15.  
  16. # consolidate parts into book body
  17. book_body=$(mktemp).html
  18. cp front_matter.html $book_body
  19. cat chapters.html >> $book_body
  20. cat back_matter.html >> $book_body
  21.  
  22. # generate digital book formats
  23. filename="the_ethics_of_anarcho-capitalism"
  24. output_directory="ebooks"
  25. mkdir -p $output_directory
  26. ebook-convert "$book_body" "$output_directory/$filename.epub" $options --authors="$author" --title="$title" --output-profile="tablet"
  27. ebook-convert "$output_directory/$filename.epub" "$output_directory/$filename.mobi" --output-profile="kindle"
  28. ebook-convert "$output_directory/$filename.epub" "$output_directory/$filename.docx"
  29.  
  30. rm $book_body
RAW Paste Data