emigre / openseadragon-annotations

Draw annotations over deep zoom images
BSD 3-Clause "New" or "Revised" License
97 stars 40 forks source link

Add short info on how to use without npm #7

Closed thunfischbrot closed 7 years ago

thunfischbrot commented 7 years ago

In the README it mentions that one can use a package manager, which implies that it is possible to use it without. I am unable to accomplish just that.

I tried including the main.js and others, failing with Uncaught SyntaxError: Unexpected token import It would be great if there was a demo or one line on how to use it without a package manager.

emigre commented 7 years ago

Hey @thunfischbrot. I have created a branch in this repo where you can see a project that does not depend on npm, so you can use it as an example.

You can just open index.html and it will work. The images in OpenSeadragon won't show correctly, though. This is because OpenSeadragon searches for the images in the root folder, you will need to start a local server for that to work properly.

You can start a local server in many ways. If you have Node.js installed, http-server is an easy way, for example. You just have to install it globally with npm i -g http-server and then execute it in that example's folder with http-server .. If you use Python, you can start a local server like this: python -m SimpleHTTPServer 8000.

You are totally correct, the project needs some examples of usage and better docs. I'm going to try to release a new version that will have a number of improvements and I will add docs and examples.

cheers!

thunfischbrot commented 7 years ago

Thanks, that's great. I also read up on npm and got it running that way locally. Great idea about adding some more examples!