jugyo / eeepub

EeePub is a Ruby ePub generator
MIT License
219 stars 61 forks source link

invalid noc.tcx > dtb:uid problem #28

Open c0ze opened 11 years ago

c0ze commented 11 years ago

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 .

gioele commented 11 years ago

This is a dupe of issue #27. See the issue and the attached pull request.