Asciibook is an Ebook generator for converting AsciiDoc to HTML, PDF, EPUB and MOBI.
Installation
If you are familiar with Ruby, you can use Manual installation.
If your are familiar with Docker, you can use Docker Installation.
Manual installation
Install by rubygems:
$ gem install asciibook
For PDF generate, download and install wkhtmltopdf in https://wkhtmltopdf.org/downloads.html .
For Mobi generate, download and install kindlegen in https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211 .
Docker Installation
Pull docker image:
$ docker pull asciibook/asciibook
Then use asciibook CLI in this way:
$ docker run -v $(pwd):/asciibook asciibook/asciibook asciibook build mybook.adoc
Or enter the container environment to avoid repeating lengthy commands:
$ docker run -v $(pwd):/asciibook asciibook/asciibook bash
/asciibook $ asciibook build mybook.adoc
Usage
For a existing AsciiDoc file, run this command to build all format books:
$ ascibook build mybook.adoc
Generated books will put in build
directory.
Or generate only partial format:
$ asciibook build mybook.adoc --format html
$ asciibook build mybook.adoc --format pdf,mobi
If you don’t want to enter the parameters repeatedly, you can create a configuration file for the document:
$ asciibook init mybook.adoc
It will create a config file asciibook.yml
in the same directory, edit config for your need, then use this command to build next time:
$ asciibook build
Use this command to create a empty AsciiDoc and config file:
$ asciibook new mybook
Development
Clone this repo:
$ git clone https://github.com/asciibook/asciibook.git
$ cd asciibook
Star dev environment with docker:
$ docker-compose run console
Run test:
/asciibook # rake test
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/asciibook/asciibook.
License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).