Coder Social home page Coder Social logo

eeepub's Introduction

EeePub (Temporary Extension)

Notes & Remarks

Patch to the original gem that I need for my source2epub gem to work. This gem will be deprecated as soon as the rubyzip bug is fixed/merged by the original author. This is my temporary solution to make my gem work so that I can use the gem without the need to manually install my own fork first via Github.

I still can't find the way to make use of the original gem name in the gemspec.

EeePub

EeePub is a Ruby ePub generator.

Usage

epub = EeePub.make do
  title       'sample'
  creator     'jugyo'
  publisher   'jugyo.org'
  date        '2010-05-06'
  identifier  'http://example.com/book/foo', :scheme => 'URL'
  uid         'http://example.com/book/foo'

  files ['/path/to/foo.html', '/path/to/bar.html'] # or files [{'/path/to/foo.html' => 'dest/dir'}, {'/path/to/bar.html' => 'dest/dir'}]
  nav [
    {:label => '1. foo', :content => 'foo.html', :nav => [
      {:label => '1.1 foo-1', :content => 'foo.html#foo-1'}
    ]},
    {:label => '1. bar', :content => 'bar.html'}
  ]
end
epub.save('sample.epub')

Low Level API

Create NCX:

EeePub::NCX.new(
  :uid => 'xxxx',
  :title => 'sample',
  :nav => [
    {:label => '1. foo', :content => 'foo.html'},
    {:label => '2. bar', :content => 'bar.html'}
  ]
).save(File.join('sample', 'toc.ncx'))

Create OPF:

EeePub::OPF.new(
  :title => 'sample',
  :identifier => {:value => '0-0000000-0-0', :scheme => 'ISBN'},
  :manifest => ['foo.html', 'bar.html'],
  :ncx => 'toc.ncx'
).save(File.join('sample', 'content.opf'))

Create OCF and ePub file:

EeePub::OCF.new(
  :dir => 'sample',
  :container => 'content.opf'
).save('sample.epub')

Install

gem install eeepub

Requirements

  • builder
  • eBook Reader :)

Links

Copyright

Copyright (c) 2010 jugyo. See LICENSE for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.