Epub.js

From TSAS Library
Jump to: navigation, search

Local Installation

  1. Install Git
  2. Install Node.js
  3. Clone latest branch from here with git clone [url]
  4. (For 0.3) Install the project dependencies with npm npm install[1]
  5. Install bower bower install
    1. If that install fails, run npm config set prefix /usr/local, then npm install -g bower[2]
    2. Install bower with npm install -g bower[3]
  6. Run server with ./tools/server
  7. Navigate to http://localhost:8080/tests and lament the errors.
  8. Navigate to http://localhost:8080 and celebrate the successful test.

Viewing Your ebooks

  1. Copy source code from an example html file at epub.js\examples. Contained.html is recommended if using standard (zipped) epub files. Save as trial.html in epub.js\examples
  2. Place .epub file in /books
  3. Open .html in editor, copy epub path to var Book = ePub("../reader/moby-dick.epub");. Something like var Book = ePub("../books/[your epub filename");
  4. Make sure server is running (see step 6, above)
  5. Open browser to http://localhost:8080/examples/trial.html
  6. Rejoice.

Annotations

Hypothes.is

To run hypothes.is annotations that are bundled with epub.js, add <script src="annotator.min.js"></script> to trial.html.

Annotator

  1. Download recent full release .zip
  2. Unzip to /epub.js/annotator
  3. Copy <script src="../annotator/annotator-full.min.js"></script> to trial.html file above, just before </body>

See Also

http://annotatorjs.org/ Using it without node.js http://annotateit.org/

References