The Baker manifest file
A guide to creating your own book.json file.
What it is
The manifest is a file specifying all the properties you can configure in a Baker book, following the HPub 1.0 format.
To be recognized by Baker, the manifest must be a JSON file named "book.json", residing in the root of your "book" folder.
Creating a basic manifest
The HPub specification dictates that some parameters have to be declared in the manifest. The mandatory parameters are shown in this example:
"title": "The Study in Scarlet",
"author": "Arthur Conan Doyle",
The mandatory parameters are
- The title of your publication.
- The author (or authors) of the publication.
- A unique identifier for the publication. It has the same structure as a web URL, with the exception of the "book://" protocol in place of "http://". This of this as an ISBN for digital publications.
- The list of pages in the publication. Baker will only display these HTML pages, in the order they are specified in the manifest.
Please note that, as of Baker 3.0, the title, author and url parameters are not yet used anywhere in the apps built with the framework.
Using all the HPub properties
The HPub specification declares some more parameters, which are optional and can be used in addition to the mandatory ones. They are shown in the following example (note that this is shown just as an explanation and it depicts an invalid manifest, since the mandatory properties are not present):
"creator": ["D. Casali", "M. Colombo", "A. Morandi", "F. Fortes"],
"publisher": "Baker Pubs",
The optional HPub parameters are:
- Version of the HPub specification the publication is built for.
- The creator (or creators) of the publication. This is usually different than the author and it refers to people that edited and prepared the digital publication itself.
- The publisher of the publication.
- The date the publication was released.
- The path to an image file to be used as a book cover.
- The orientation supported by the publication (portrait, landscape, or both).
- Whether zooming pages is allowed in the publication. This is usually set to false as it interferes with the user experience of navigating the book using gestures.
Please note that, as of Baker 3.0, the creator, publisher, date, and cover parameters are not yet used anywhere in the apps built with the framework.
Using Baker specific properties
In addition to the properties from the HPub specification, Baker supports its own set of properties. All the properties, which are optional, are shown in the following examples (as above, note that this is not a valid manifest):
The Baker parameters are:
- Background color to be shown before pages are loaded.
- Whether a bounce animation should be shown when a vertical scrolling interaction reaches the end of a page. This behavior is usually on in iOS applications, but it might be worth disabling it if the publication does not support vertical scrolling.
- Height for the index bar. If not specified, the index bar will automatically adapt to the page it contains.
- Whether a bounce animation should be shown when a scrolling interaction reaches the end of the page in the index bar. Contrary to -baker-vertical-bounce, this is usually better left disabled.
- Whether to automatically start playing media (e.g. audio, video) when a page is loaded.
- The path to an image file to be used as background when in portrait mode.
- The path to an image file to be used as background when in landscape mode.
- Foreground color for the elements (page number, spinner, title) to be shown before pages are loaded.
- Opacity of the elements (page number, spinner, title) to be shown before pages are loaded.
- Whether vertical page scrolling should be paginated. When this property is on, pages can only be scrolled vertically by a fixed amount of pixels (usually a little less than the height of the page).
- Rendering mode to use for the publication. As a rule of thumb, heavier publications will benefit from the "screenshots" rendering, while highly interactive publications will require the "three-cards" rendering.
For a more technical explanation of the properties listed here (and informations such as supported types and defaults for each one of them), see the HPub specification and the page on Baker extension parameters.