1

So ive been trying for a while to install readium cloud reader. I ran into a few problems I fixed and I thought I installed it correctly but I cant seem to get any of my unzipped or zipped epubs to work.

Here are the instructions for installation I followed:

  • Install Node.js (details depend on your operating system)
  • Install the Grunt build tool using the command line:npm install -g grunt-cli
  • From the command line run:git clone https://github.com/readium/readium-js-viewer.git

  • From the command line run cd readium-js-viewer

  • From the command line run git submodule update --init --recursive
  • From the command line run npm install (in the readium-js-viewer directory)
  • From the command line run cd readium-js
  • From the command line run npm install (a second time in the readium-js directory)

After this I changed directory into the parent directory then I ran the grunt command grunt cloudReader but I get an error stating that there are no grunt files. I thought running the last npm install would also generate the grunt files from the package.json. I looked at the npm debug log but I cant see any meaningful error messages. Can anyone help?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Zayd Bhyat
  • 101
  • 1
  • 2
  • 19

1 Answers1

1

You need to run commands using npm, as grunt isn't used as a task runner for the project. You can see a list of the commands in the scripts property of package.json.

I followed the instructions under Git Initialisation in the repo and got things up and running locally:

# replace "BRANCH_NAME" with e.g. "develop"
$ git clone --recursive -b BRANCH_NAME https://github.com/readium/readium-js-viewer.git readium-js-viewer 
$ cd readium-js-viewer
$ git submodule update --init --recursive
$ git checkout BRANCH_NAME && git submodule foreach --recursive "git checkout BRANCH_NAME"
$ cd readium-js/ && npm update && cd ../ # had to update as some dependencies were missing
$ npm run http # launch the development server

I have no idea how to package or add content, though. It looks like the epub_library.opds is updated somehow and books in epub_content appear in the bookshelf.

mzmm56
  • 1,264
  • 1
  • 14
  • 21
  • Darn, I figured this out lastnight and wanted to answer my own question, but this is the correct answer after looking at the git repo readme and asking one of the developers for help. Ill accept this answer as it follows the instructions in the readme file. Thanks for the help – Zayd Bhyat Aug 23 '16 at 01:23
  • 1
    If any one is curious about adding content, its actually very easy once you follow the instructions in the readme file. Epubs and other online media can be added to the library via the epub_library.opds and adding it to epub_content folder or referencing it from an online source. Its actually a very easy and elegant solution for displaying interactive media online. – Zayd Bhyat Aug 23 '16 at 01:50
  • @ZaydBhyat, re: adding content, did you come across a programmatic way of adding entries to the opds? I'd assumed that the build script would parse the contents of the books in epub_contents after running `npm run build` (or some similar process), but the only way I could get new content to show was by adding entries manually – mzmm56 Aug 23 '16 at 02:48
  • also sorry for sniping your self-answer :) – mzmm56 Aug 23 '16 at 02:48
  • re: re: adding content, read through it several times and still cant figure it out. Why I say figure it out is because i am more than certain there is a simple programatic way to add epubs to the library and dynamically update the epub_library.opds. If not looks like I got a little side project to occupy myself when i'm free. Again thanks for the help and this topic can be closed :) – Zayd Bhyat Aug 23 '16 at 04:01