Acme Labs https://dauwhe.github.io/acme-labs/
###a toy digital reading system
Can the web platform provide a great reading experience for publications? Can web application manifests and service workers more easily implement the functionality of dedicated reading apps? Acme Labs is an experimental implementation of a browser-friendly ebook format BFF, and aims to explore some of the ideas of (portable) web publications.
-
Provide a reading experience much like common dedicated e-readers like iBooks and Readium. This includes user control over font size, a night mode, easy access to navigation, pagination, etc.
-
The publications themselves should not need any scripts to function.
-
The publications should work offline.
-
It should be possible to save publications to a local filesystem.
Each publication is in a folder. The folder contains a manifest.json
file. The manifest is a web application manifest, but with two additional members:
- The
spine
member. This describes the order of content documents in the publication, as in EPUB.
"spine": [{
"href": "html/c001.html",
"type": "text/html"
}, {
"href": "html/c002.html",
"type": "text/html"
}],
- The
resources
member. This lists all the other required components of the publication—images, fonts, css, scripts, and so on.
"resources": [{
"href": "images/moby-dick-book-cover.jpg",
"type": "image/jpeg"
},{
"href": "css/mobydick.css",
"type": "text/css"
},{
"href": "index.html",
"type": "text/html",
"properties": "nav"
}]
Each publication should contain an html file which could serve as a starting point for readers. This file at least should contain a link to the manifest. See BFF for details.
The reading system is the main.html
page. Book content is displayed in an iframe. Navigation between files is based on reading the manifest.
The service worker caches files listed in the manifest when the "save" button is clicked. The "download" button downloads a zip of the publication.
Warning: the code is really rough, as I don't know what I'm doing.
Jake Archibald wrote the original service worker (kroner.js
) and page.js
files. The manifest format was hashed out with Hadrien Gardeur. All of this is really the work of the entire DPUB/EPUB community.