asciidoctor-book-template

Stars
11

== Asciidoctor Book Template

A book template to generate html, pdf, epub, mobi format ebook by Asciidoctor.

=== Usage

Download this repo:

[source,console]

$ git clone https://github.com/chloerei/asciidoctor-book-template.git bookname
$ cd bookname

Install gems:

[source,console]

$ bundle install

Download fonts for PDF generate (run once):

[source,console]

$ asciidoctor-pdf-cjk-kai_gen_gothic-install

Build books:

[source,console]

$ rake build

Result will be store in build dir:

[source,console]

$ 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

=== Customize

==== Filename

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
[source,ruby]

SOURCES = %w(book.adoc book-sample.adoc)