-
Notifications
You must be signed in to change notification settings - Fork 101
How to package an HPub
First of all, a HPub publication is like a HTML5 microsite. You should be able to see it in a standard browser and test it in Mobile Safari (it will miss the pagination and Baker features of course, but it should work). This is important because it means that if your application shows and works correctly in Mobile Safari, then it's almost sure it will work in Baker.
To prepare a publication just write it like a microsite, having a HTML file for each page inside Baker and have them ordered sequentially.
Prepare also an index.html
file, that will be visualized inside Baker when you double-tap the screen. Ideally, it should be just a small stripe (horizontal or vertical) in order to not cover the entire screen when it shows up.
When your publication is ready and tested in Mobile Safari, you have to wrap it up into a nice package to include it in Baker.
- Create a folder and copy all your publication files into that. All the HTML files and book assets must be in the folder, no file outside the folder will be seen by Baker.
- Create a file called
book.json
, with all the parameters required for Baker to display your book correctly. This file is known as a manifest and it must conform to the HPub standard. For a complete explanation of all the parameters, [read here](hpub specification). There are also some extra parameters specific for Baker that you can find [here](Book.json Baker extension parameters).
After these simple steps are completed, your publication folder will contain an upacked HPub. Now there are two alternatives:
- If you are building Baker Standalone, just include the folder you created inside the
books/
folder. - If you are building Baker Newsstand, you have to zip all the files inside the folder itself. Be careful: you have to select all the files inside the folder and zip them, you should not zip the folder.
BONUS: as you may have noticed, the HPub package is just a list of HTML pages. This means that, once you make sure all the pages are linked to each other, you can publish it on the web without any additional work and your users will be able to view it in a standard browser.