text_to_epub

Generates a template directory that you can use to build a custom epub file.

Usage: new_book /path/to/new/book (if the directory does not exist, it will be created)

Go to the new directory and modify the file config.yml

Run gen_epub from within the new directory.

Text files will be html-ized using textile (via the RedCloth gem). Check the templates directory for files you may want to customize (such as stylesheet.css or the .liquid html files).

Converting to PDF

After you’ve created an epub file, you can easily convert it to PDF. Here are a couple of hints:

using Calibre (calibre-ebook.com/):

ebook-convert epub_folder/file_name.epub .pdf --custom-size=5x8 --base-font-size=12 --margin-top=54 --margin-left=54 --margin-bottom=54 --margin-right=54

using wkhtmltopdf (code.google.com/p/wkhtmltopdf/):

wkhtmltopdf --page-width 5in --page-height 8in -L 0.5in -R 0.5in -B 0.5in -T 0.25in --footer-center '[page]' --footer-spacing 2 --print-media-type --footer-font-name TexGyreTermes --footer-font-size 9 epub_folder/OEBPS/*.html mybook.pdf

Contributing to text_to_epub

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2010 Jason LaPier. See LICENSE.txt for further details.