Skip to content

Instantly share code, notes, and snippets.

@takahashim
Created May 6, 2010 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahashim/391826 to your computer and use it in GitHub Desktop.
Save takahashim/391826 to your computer and use it in GitHub Desktop.
# epub sample API
#
epub = EeePub.generate do
title "sample"
creaetor "jugyo", :role => 'aut'
publisher 'jugyo.org'
date '2010-05-07', :event=> "publication"
uid 'http://example.com/book/foo', :scheme => "URL"
item 'foo.html', :label => '1. foo'
item 'bar.html', :label => '2. bar'
assets 'css/foo.css'
assets 'images/foo.jpg', 'images/bar.jpg'
end
epub.save('sample.epub')
# epub sample API
#
epub = EeePub.generate do |e|
e.title "sample"
e.creaetor "jugyo", :role => 'aut'
e.publisher 'jugyo.org'
e.date '2010-05-07', :event=> "publication"
e.uid 'http://example.com/book/foo', :scheme => "URL"
e.item 'foo.html', :label => '1. foo' do |e2|
e2.item 'foo2.html', :label => '1-1. foo aaa'
e2.item 'foo3.html', :label => '1-2. foo bbb'
end
e.item 'bar.html', :label => '2. bar'
e.assets 'css/foo.css'
e.assets 'images/foo.jpg', 'images/bar.jpg'
end
epub.save('sample.epub')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment