skoji / gepub

a generic EPUB library for Ruby : supports EPUB 3
Other
240 stars 42 forks source link

Rendition at manifest level setup #56

Open 127 opened 9 years ago

127 commented 9 years ago

Feature request There's no way to add at manifest level rendition properties (current realization supports only spine)

    <meta property="rendition:layout">pre-paginated</meta>
    <meta property="rendition:orientation">portrait</meta>
    <meta property="rendition:spread">none</meta>

By the way, looks like current iBooks fails to read rendition set via properties in spine and works only with meta-section. And there's no need in setting up custom ibooks com.apple.blah-blah properties file in META-INF. Checkout this example http://files.infogridpacific.com/fxl-tb/fxl-portrait-locked-16x9.epub

127 commented 9 years ago

Actually it doesn't work in elder ::Builder notation. But works this way

      book = GEPUB::Book.new
      book.set_primary_identifier('urn:uuid:'+uniqueid, 'pub-id', 'uuid')
      book.language = @document.language
      book.date = DateTime.now.strftime("%Y-%m-%dT%H:%M:%S%:z")
      book.rendition_layout='pre-paginated'
      book.rendition_orientation='landscape'
      book.rendition_spread='false'

Hard to understand withot looking to the core: something sets as property, smth via setters etc

skoji commented 9 years ago

I admit the current API is rather confusing.

Current design is : attribute or metadata with single value sets as property assignment, and setting multiple value via setter (like set_primary_identifier).