Git Product home page Git Product logo

acme-labs's Introduction

###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.

Goals

  1. 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.

  2. The publications themselves should not need any scripts to function.

  3. The publications should work offline.

  4. It should be possible to save publications to a local filesystem.

Publications

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:

  1. 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"
  }],
  1. 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.

Reading System

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 "zip" button downloads a zip of the publication. The highly experimental "package" button downloads a package based on the W3C TAG Packaging on the Web draft, as extended by Dmitry Titov.

Warning

Warning: the code is really rough, as I don't know what I'm doing.

Usage

Use python -m SimpleHTTPServer to host the repo at http://localhost:8000/

Contributing

Currently, the repository is a mix of ES5 and ES6/ES2015. We are using eslint and the AirBnB JavaScript code styles to keep things tidy. kroner.js is the one ES6/ES2015 file we have atm, so to lint it do the following:

$ npm i -g eslint eslint-config-airbnb # once to install things
$ eslint kroner.js # prior to committing changes

Acknowledgments

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.

acme-labs's People

Contributors

bigbluehat avatar dauwhe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

bigbluehat

acme-labs's Issues

Make Manifests More Manifesty

Manifests are untested for installing on Android, as I don't have such a device. They are missing scopes, icons, and other useful things.

Design for Mobile

Early dev work has been on a laptop. The design needs to support mobile.

Re-architect linking to documents

Right now the main library page index.html opens publications with a query string:

main.html?manifest=MobyDick/manifest.json

Ideally we'd link right to the publication

MobyDick/index.html

That file contains link rel=manifest. Could we read that location, and then redirect to main.html? So this reading system would do the right thing, but if the server didn't understand the manifest, it would just open as normal HTML?

Add EPUB export

It should be possible for simple files to be saved as EPUB, possibly something beyond EPUB 3.1 if we don't want to reserialize HTML (and we don't).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.