= Asciibook :toc: Asciibook is an Ebook generator for converting AsciiDoc to HTML, PDF, EPUB and MOBI. == Installation If you are familiar with Ruby, you can use <>. If your are familiar with Docker, you can use <>. [[manual-installation]] === Manual installation Install by rubygems: [source, console] ---- $ 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]] === Docker Installation Pull docker image: [source, consle] ---- $ docker pull asciibook/asciibook ---- Then use asciibook CLI in this way: [source, console] ---- $ docker run -v $(pwd):/asciibook asciibook/asciibook asciibook build mybook.adoc ---- Or enter the container environment to avoid repeating lengthy commands: [source, console] ---- $ 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: [source, console] ---- $ ascibook build mybook.adoc ---- Generated books will put in `build` directory. Or generate only partial format: [source, console] ---- $ 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: [source, console] ---- $ 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: [source, console] ---- $ asciibook build ---- Use this command to create a empty AsciiDoc and config file: [source, console] ---- $ asciibook new mybook ---- == Development Clone this repo: [source, console] ---- $ git clone https://github.com/asciibook/asciibook.git $ cd asciibook ---- Star dev environment with docker: [source, console] ---- $ docker-compose run console ---- Run test: [source, console] ---- /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).