🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ebookie

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebookie

bundlerRubygems
Version
0.3.1
Version published
Maintainers
1
Created
Source

Ebookie

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

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

FAQs

Package last updated on 18 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts