Consider a text book made with iBooks Author, using HTML widgets for interactive features, for example a quiz at the end of every chapter. You end up with a lot of widgets (one per chapter) that share a lot of assets (image files, javascript libraries).
Casual use of iBooks Author seems to indicate that every widget is its own independent bundle that gets copied into the book. This would be horribly wasteful in this scenario.
Can I include the same bundle multiple times (so that is appears in many locations, but does not take up redundant disk space)?
Can I pass parameters to the widget (so that I can tell it which chapter's data to display)?
If 1+2 don't work, can a widget refer to assets stored in a shared location somewhere else in the same book (so that I can produce fifty lean widgets that don't have to contain images and Javascript themselves)?
Just have an answer for 3., still trying to figure out the other two.
The ibooks file created by IBA is basically an EPUB document. Because this is the case, you can refer to files within the package itself with HTML from your widgets.
IBA creates an assets
folder where it stores all the images, widgets, and other items.
For example, <img src='../../images/image.jpg' />
in the HTML in your widget will display image.jpg
.
To see and add images, js, whatever to the iBook after it is generated, unzip
your iBooks file.
localstorage
is shared between all the widgets, so you can store shared information there (base-64 encode the images?).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.