GithubHelp home page GithubHelp logo

eeepub's People

Contributors

bowmande avatar chrisnicola avatar jugyo avatar larryfox avatar plukevdh avatar schacon avatar sorah avatar takahashim avatar walterdavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eeepub's Issues

Using inline html

Rather that supplying files, could I send raw html

For example I want to render pages in rails loop and output an epub file.

invalid noc.tcx > dtb:uid problem

I get dtb:uid like

<meta name="dtb:uid" content="{:value=&gt;&quot;12351bc0-7b50-0130-0e74-10bf4888f82f&quot;, :scheme=&gt;&quot;uuid&quot;, :id=&gt;&quot;http://c.learncodethehardway.org/book/&quot;}"/>

in toc.ncx

coze@cb-gene:~/ruby/eeepub/epubcheck-3.0/lcthw$ java -jar ../epubcheck-3.0.jar LearnCTheHardWay.epub 
Epubcheck Version 3.0

Validating against EPUB version 2.0
ERROR: LearnCTheHardWay.epub/content.opf(2,120): value of attribute "unique-identifier" is invalid; must be an XML name without colons

my code is something like this :

title = 'Learn C The Hard Way'
author = 'Zed. A. Shaw'
publisher = 'http://c.learncodethehardway.org'
date = '2010-05-06'
url = 'http://c.learncodethehardway.org/book/'
uid = UUID.generate

epub = EeePub.make do
  title       title
  creator     author
  publisher   publisher
  date        date
  identifier  uid , :scheme => 'uid'
  uid         uid

  files dic.map{|el| "#{dir}/#{el[:url]}"}
  nav dic.map{|el| {content: "#{el[:url]}", label: el[:name]}}

end
epub.save("#{title}.epub")

(I parse the html in between)
seems like toc initializer is using the whole hash for uid where it should only use :value .

Permission denied when calling EeePub::Maker#save

Errno::EACCES: Permission denied - /tmp/d20120913-3060-hu4p2b/.
initialize at org/jruby/RubyFile.java:465
open at org/jruby/RubyIO.java:1135
remove_entry_secure at /home/hnse/.rvm/rubies/jruby-1.6.7-d19/lib/ruby/1.9/fileutils.rb:708
save at /home/hnse/.rvm/gems/jruby-1.6.7-d19@annnotator/gems/eeepub-0.8.0/lib/eeepub/ocf.rb:105
save at /home/hnse/.rvm/gems/jruby-1.6.7-d19@annnotator/gems/eeepub-0.8.0/lib/eeepub/maker.rb:83

windows path error when invocating zip command

Hi
under linux, eeepub looks working but, under windows the zip creation fails
I presume it's due to the file path separator / instead of \ used when calling zip command.
File.join always returns / as separator, even in windows. I think you must manually change it , if under windows, before executing the zip command

mimetype should be first in archive

Apparently to be a valid ePub mimetype must be the first file in the archive. I'll probably have a pull request for this in the next couple of days unless someone else beats me to it. Figured I should report the bug first anyways.

maker 80行あたりでfile[:path]などがnilになっていてエラーになっているみたいです

始めまして。epubに興味があり、rubyにも興味があったので
このソースでrubyを勉強させてもらっています。

macのruby 1.8.7とbuilderを入れた環境でexample/simple_epub.rbを実行すると

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1407:in fu_each_src_dest0': undefined methodto_str' for nil:NilClass (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1393:in fu_each_src_dest' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:382:incp'
from ./../lib/eeepub/maker.rb:80:in save' from ./../lib/eeepub/maker.rb:78:ineach'
from ./../lib/eeepub/maker.rb:78:in save' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tmpdir.rb:129:inmktmpdir'
from ./../lib/eeepub/maker.rb:77:in `save'
from simple_epub.rb:23

となりました。中のソースを見てみると、ただ単なる文字列である[file]という変数なのに、
file[:dir]やfile[:path]とアクセスしていて、その結果がnilになるのが原因のようでした。

これは僕の環境が悪く、パスのような文字列だと何もせずに連想配列のようにアクセスできるものなのでしょうか?

それともサンプルのバージョンが間違っていて、いまではfilesで配列を渡すようになっているのでしょうか?

This version not published...

There's a "cover" instance variable in the latest maker.rb here, but not in rubygems.org. Both are showing the same version number (0.8.0), so methinks this one should be bumped and published.

tmpfiles aren't cleaned up after a document is created

I am running out of space in my /tmp directory because the tmpdir isn't cleaning up after itself (as far as I can tell). I am on a Joyent SmartMachine, and /tmp has a hard limit at 2GB. This fills up pretty quickly when looping over a big directory of documents and converting them all to epub. This didn't happen in earlier versions (0.6) but I see that you've switched to a different Zip technique.

My /tmp directory fills up with directories named like this: d20110719-28360-8srs14, each containing the un-compressed version of the final Zip/Epub document. In looking through the documentation for tmpdir, it seems that there needs to be an explicit call to remove this file if you don't pass a block to the Dir.mktmpdir call.

It's not clear to me if this is something that is being called from within your code (can't find it) or the Zip wrapper you're using. Either way, the effect is the same. I was able to get my program to run only by manually cleaning out the /tmp directory after each loop, which is very ugly and will break something else on the same machine one day.

Can you help?

Use of rubyzip

Hi,
I came across a problem with eeepub and had an error message looking like :

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- zip/zip (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.9.1/gems/eeepub-0.8.1/lib/eeepub/ocf.rb:1:in `<top (required)>'

In fact, it turns out that the last versions of rubyzip need to be called like this :
require 'zip'
instead of this
require 'zip/zip'
as is done in the file /lib/eeepub/ocf.rb, line 1.
This fixed the bug. However I'm not very skilled in Ruby, so I merely post this here.
Hope it can be useful !

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.