Project

ebookie

0.0
No commit activity in last 3 years
No release in over 3 years
Generate PDF, ePub, and Mobi eBooks
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
~> 10.0
~> 3.0

Runtime

>= 0.9.1, ~> 0.9.1
>= 0.1.0, ~> 0.1.0
>= 1.1.0, ~> 1.1.0
>= 0.8.0, ~> 0.8.0
>= 2.9.1, ~> 2.9.1
>= 1.3.3, ~> 1.3.3
>= 0.19, ~> 0.19
>= 0.12.2, ~> 0.12.2
 Project Readme

Ebookie

Build Status Dependency Status

Generate PDF, ePub, and Mobi eBooks

Example project

Installation

Add this line to your application's Gemfile:

gem 'ebookie'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ebookie

Usage

Create a new document:

document = Ebookie::Document.new "My eBook" # Title

Configure it:

document.configure do |config|
  config.cover        = './path/to/cover.png'  # Cover image
  config.destination  = './ebook/'             # Ouput for ePub, Mobi, PDF
  config.subject      = "Introductions"
  config.source       = "http://google.com"
end

Add a chapter:

# You can pass a string for the content
document.chapter 'Getting Started', "All about how to get started"

# You can also give it an html file to read
document.chapter 'Getting Started', Pathname.new("path/to/myfile.html")

Add an image:

# Relative or absolute path for image to be copied
document.image './path/to/image.png'

# Chapters can reference images with html:
document.chapter "My Cool Image", "<img src='image.png' alt='image' />"

Render the document:

# ePub
document.render_epub

# Mobi
document.render_mobi

# PDF
document.render_pdf

Install templates for customization:

$ ebookie install ./path/to/templatees

Then configure the document:

document.config.template = './path/to/templates'

Contributing

  1. Fork it ( http://github.com/jordanandree/ebookie/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request