README.rst 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Pandoc Markdown ebook template
  2. ==============================
  3. This project defines a skeleton repo for creating ebooks out of `Pandoc Markdown
  4. <http://johnmacfarlane.net/pandoc/README.html>`_. Pandoc is a great tool for
  5. writing ebooks with simple to moderately complex formatting, but I've found that
  6. in practice, creating an EPUB isn't *quite* as simple as just running ``pandoc
  7. -o book.epub book.md``.
  8. The author of Pandoc has written a short tutorial for `creating EPUB files with
  9. Pandoc <http://johnmacfarlane.net/pandoc/epub.html>`_. This repo just expands on
  10. MacFarlane's tutorial a bit and wraps things up in a Makefile.
  11. Installing and running
  12. ----------------------
  13. 1. If you have not already done so, install:
  14. * `git <http://git-scm.com/>`_
  15. * `make <http://www.gnu.org/software/make/>`_ (OS X users should install XCode
  16. and `download the command line tools
  17. <http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools>`_.)
  18. * `pandoc <http://johnmacfarlane.net/pandoc>`_
  19. * `latex <http://www.latex-project.org/>`_ (OS X users should probably
  20. install `MacTex <http://tug.org/mactex/>`_.)
  21. 2. Clone this repo with **git**.
  22. 3. From the top of the project, type ``make book`` or simply, ``make``.
  23. This generates three versions of the sample book in a ``build/`` directory.
  24. Replacing the sample material
  25. -----------------------------
  26. Edit these files:
  27. ch01.md and ch02.md
  28. ```````````````````
  29. Replace the dummy text with your own. You can add, subtract, or rename these
  30. ``*.md`` chapters as you please, but you must edit the ``CHAPTERS`` variable in
  31. the ``Makefile`` accordingly.
  32. images/cover.jpg
  33. ````````````````
  34. Replace this with your own cover image or delete it entirely.
  35. Makefile
  36. ````````
  37. * Change ``BOOKNAME`` to something appropriate for your book. This determines your
  38. book's filename.
  39. * Change ``CHAPTERS`` to a space separated list of Pandoc Markdown chapters, in
  40. the order in which you want them to appear.
  41. * Change ``COVER_IMAGE``. You might want to move your cover image
  42. elsewhere, or use a different file format such as PNG.
  43. If you don't want a cover image, delete this variable and the
  44. ``--epub-cover-image`` option in the EPUB target.
  45. * (Optional) Change ``LATEX_CLASS``. The default of ``report`` handles
  46. multi-chapter books pretty well, and uses the same template for even and odd
  47. page numbers. However, you are free to substitute in any other LaTeX document
  48. class. For example, ``book`` provides a left-side/right-side template that is
  49. suitable for print, and ``article`` is good for shorter manuscripts (short
  50. stories, technical briefs).
  51. title.txt
  52. `````````
  53. Replace the contents of this file with the real manuscript title and author name.
  54. metadata.xml
  55. ````````````
  56. Replace with your actual copyright statement, language, and any other Dublin
  57. Core metadata you wish to provide.