A book template to generate html, pdf, epub, mobi format ebook by Asciidoctor.
Download this repo:
$ git clone https://github.com/chloerei/asciidoctor-book-template.git bookname
$ cd bookname
Install gems:
$ bundle install
Download fonts for PDF generate (run once):
$ asciidoctor-pdf-cjk-kai_gen_gothic-install
Build books:
$ rake build
Result will be store in build
dir:
$ tree build
build/
|-- book
| |-- book-0.1.0
| | |-- images
| | | |-- cover.png
| | | `-- cover.svg
| | `-- index.html
| |-- book-0.1.0.epub
| |-- book-0.1.0-kf8.epub
| |-- book-0.1.0.mobi
| |-- book-0.1.0.pdf
| `-- book-0.1.0.pdfmarks
`-- book-sample
|-- book-sample-0.1.0
| |-- images
| | |-- cover.png
| | `-- cover.svg
| `-- index.html
|-- book-sample-0.1.0.epub
|-- book-sample-0.1.0-kf8.epub
|-- book-sample-0.1.0.mobi
|-- book-sample-0.1.0.pdf
`-- book-sample-0.1.0.pdfmarks
By default, there are two build source: book.adoc
and boo-sample.adoc
. It is suitable for separate formal and sample version. When source filename is book.adoc
, build task will generate ebooks in build/book
directory.
You can change filename, add or remove source, then change SOURCES
in Rakefile to change build source.
Rakefile
SOURCES = %w(book.adoc book-sample.adoc)