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",
"url": "book://bakerframework.com/books/arthurconandoyle-thestudyinscarlet",
"contents": [
"Article-Lorem.html",
"Article-Ipsum.html",
"Article-Gaium.html",
"Article-Sit.html",
"Article-Amet.html"
]
}
The mandatory parameters are
- title
- The title of your publication.
- author
- The author (or authors) of the publication.
- url
- 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.
- contents
- 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):
{
"hpub": 1,
"creator": ["D. Casali", "M. Colombo", "A. Morandi", "F. Fortes"],
"publisher": "Baker Pubs",
"date": "2011-08-23",
"cover": "assets/study-in-scarlet.png",
"orientation": "both",
"zoomable": false
}
The optional HPub parameters are:
- hpub
- Version of the HPub specification the publication is built for.
- creator
- 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.
- publisher
- The publisher of the publication.
- date
- The date the publication was released.
- cover
- The path to an image file to be used as a book cover.
- orientation
- The orientation supported by the publication (portrait, landscape, or both).
- zoomable
- 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):
{
"-baker-background": "#000000",
"-baker-vertical-bounce": true,
"-baker-index-height": 150,
"-baker-index-bounce": true,
"-baker-media-autoplay": true,
"-baker-background-image-portrait": "assets/background-portrait.png",
"-baker-background-image-landscape": "assets/background-landscape.png",
"-baker-page-numbers-color": "#FFFFFF",
"-baker-page-numbers-alpha": 0.5,
"-baker-vertical-pagination": false,
"-baker-rendering": "three-cards"
}
The Baker parameters are:
- -baker-background
- Background color to be shown before pages are loaded.
- -baker-vertical-bounce
- 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.
- -baker-index-height
- Height for the index bar. If not specified, the index bar will automatically adapt to the page it contains.
- -baker-index-bounce
- 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.
- -baker-media-autoplay
- Whether to automatically start playing media (e.g. audio, video) when a page is loaded.
- -baker-background-image-portrait
- The path to an image file to be used as background when in portrait mode.
- -baker-background-image-landscape
- The path to an image file to be used as background when in landscape mode.
- -baker-page-numbers-color
- Foreground color for the elements (page number, spinner, title) to be shown before pages are loaded.
- -baker-page-numbers-alpha
- Opacity of the elements (page number, spinner, title) to be shown before pages are loaded.
- -baker-vertical-pagination
- 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).
- -baker-rendering
- 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.
Going deeper
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.