Skip to content
Aron Carroll edited this page Mar 8, 2011 · 8 revisions

If you wish to develop annotator, you'll need to have a working installation of Node.js (v0.2.x). I'd highly recommend installing both Node.js and the Node Package Manager, after which you can run the following to get up and running:

$ npm install .

In order to run the rake package task with JavaScript and CSS minification you'll need the yui-compressor gem installed:

$ gem install yui-compressor

If that worked, you should be able to run the tests:

$ cake test
Started
.....................................................

Finished in 0.385 seconds
18 tests, 85 assertions, 0 failures

The cake command is provided by CoffeeScript. Note that some tests may fail, due to brokenness in jsdom. There should be a note at the end of the output for that command informing you if we're expecting any tests to fail. The reason we don't simply comment these tests out until jsdom is fixed is that the tests can also be run by opening test/runner.html in a browser.

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. For ease of development, you can run a watcher (cake watch) that will notice any changes you make in src/ and compile them into lib/.

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.

For inline documentation we use TomDoc. It's a Ruby specification but it also works nicely with CoffeeScript.

Clone this wiki locally