bell notificationshomepageloginedit profileclubsdmBox

10% popularity   0 Reactions

I'll post an answer which seems to be working for me.

I found relevant documentation here: www.idpf.org/epub/30/spec/epub30-publications.html#sec-package-documents
Using Ruby and Nokogiri, I decompressed the ePub file, read the package document as HTML, then used an XPath statement:

unzipped_file = Zip::File.open(epub_file)
package_file = unzipped_file.glob("*/package.opf").first
package_as_html = Nokogiri::HTML(package_file.get_input_stream.read)
package = package_as_html.at_xpath("html/body/package")

nav_file_name = package.
at_xpath("manifest/item[@properties='nav']").
attribute("href").
text


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

Login to follow story

More posts by @Ted

0 Comments

Sorted by latest first Latest Oldest Best

 

Back to top