|
1 | | -# epubreader-js |
| 1 | +# A epub Reader that allow hypothes.is |
2 | 2 |
|
3 | | - |
| 3 | +This cloud-based epub reader allow hypothes.is browser extension (chrome on pc, kiwibroswer on android, resp.) to be run for particular uploaded epub book. |
4 | 4 |
|
5 | | -## About the Reader |
6 | | - |
7 | | -The **epubreader-js** application is based on the [epub.js](https://github.com/futurepress/epub.js) library and is a fork of the [epubjs-reader](https://github.com/futurepress/epubjs-reader) repository. |
8 | | - |
9 | | -## Getting Started |
10 | | - |
11 | | -Open up [epubreader-js](https://intity.github.io/epubreader-js/) in a browser. |
12 | | - |
13 | | -You can change the ePub it opens by passing a link to `bookPath` in the url: |
14 | | - |
15 | | -`?bookPath=https://s3.amazonaws.com/epubjs/books/alice.epub` |
16 | | - |
17 | | -## Running Locally |
18 | | - |
19 | | -Install [node.js](https://nodejs.org/en/) |
20 | | - |
21 | | -Then install the project dependences with npm |
22 | | - |
23 | | -```javascript |
24 | | -npm install |
25 | | -``` |
26 | | - |
27 | | -You can run the reader locally with the command |
28 | | - |
29 | | -```javascript |
30 | | -npm run serve |
31 | | -``` |
32 | | - |
33 | | -Builds are concatenated and minified using [webpack](https://github.com/webpack/webpack) |
34 | | - |
35 | | -To generate a new build run |
36 | | - |
37 | | -```javascript |
38 | | -npm run build |
39 | | -``` |
40 | | - |
41 | | -or rebuilding all *.js files |
42 | | - |
43 | | -```javascript |
44 | | -npm run prepare |
45 | | -``` |
46 | | - |
47 | | -## Pre-configuration |
48 | | - |
49 | | -The **epubreader-js** application settings is a JavaScript object that you pass as an argument to the `Reader` constructor. You can make preliminary settings in the file [index.html](dist/index.html). For example, this is what the default `Reader` initialization looks like: |
50 | | - |
51 | | -```html |
52 | | -<script type="module"> |
53 | | - import { Reader } from "./js/epubreader.min.js" |
54 | | - const url = new URL(window.location) |
55 | | - const path = url.searchParams.get("bookPath") || "https://s3.amazonaws.com/moby-dick/" |
56 | | - window.onload = (e) => new Reader(path) |
57 | | -</script> |
58 | | -``` |
59 | | - |
60 | | -Let's say we want to disable the `openbook` feature, which is designed to open an epub file on a personal computer. This can be useful for integrating a public library into your site. Let's do this: |
61 | | - |
62 | | -```html |
63 | | -<script type="module"> |
64 | | - import { Reader } from "./js/epubreader.min.js" |
65 | | - const url = "{{bookPath}}" |
66 | | - window.onload = (e) => new Reader(url, { openbook: false }) |
67 | | -</script> |
68 | | -``` |
69 | | - |
70 | | -> Note that the `{{bookPath}}` replacement token is used to define the `url` string variable. This simple solution will allow you to set up a route to pass the target URL. |
71 | | -
|
72 | | -## Features |
73 | | - |
74 | | -The **epubreader-js** application supports the following features: |
75 | | - |
76 | | -- Initial support for mobile devices |
77 | | -- Saving settings in the browser’s local storage |
78 | | -- Opening a book file from the device’s file system |
79 | | -- Bookmarks |
80 | | -- Annotations |
81 | | -- Search by sections of the book |
82 | | -- Output epub metadata |
83 | | -- [Keybindings](docs/keybindings.md) |
| 5 | +[Try it](https://structseeker.github.io/hypothes.is-epubjs-reader/)! |
0 commit comments