$ ./tools/setup
If you wish to develop Annotator, you'll need to have a working installation of Node.js (v0.6.x). Once installed (on most systems Node comes bundled with NPM) you should run the following to install Annotator's development dependencies.
$ npm install .
The Annotator source is found in src/
, and is written in CoffeeScript, which is a little language that compiles to Javascript. See the CoffeeScript website for more information.
dev.html
loads the raw development files from lib/
and can be useful when developing.
The tests are to be found in test/spec/
, and use Jasmine to support a BDD process. You can either run the tests in your browser (using test/runner.html
) or using a PhantomJS console runner (see below).
For inline documentation we use TomDoc. It's a Ruby specification but it also works nicely with CoffeeScript.
There are a number of useful development tools shipped in the tools/
directory.
$ ./tools/watch # compiles src/*.coffee files into lib/*.js when they change
$ ./tools/test_phantom # runs the test suite with PhantomJS (requires Python and PhantomJS)
Building the packaged version of Annotator requires Avery Pennarun's excellent redo build tool. Instructions on installing redo can be found below:
$ redo # just build everything
$ redo help # show available build tasks
If you really can't be bothered to install redo
(you should: it's awesome) you can just run the included minimal do
script:
$ ./tools/do
$ brew install redo
$ git clone git://github.com/apenwarr/redo.git
$ cd redo && make install