|
1 | 1 | Hacking on Annotator
|
2 | 2 | ====================
|
3 | 3 |
|
4 |
| -Quick setup for lazy people (on a Mac) |
5 |
| --------------------------------------- |
6 |
| - |
7 |
| -:: |
8 |
| - |
9 |
| - $ ./tools/setup |
10 |
| - |
11 |
| -Slower introduction for industrious people (and those on Linux/Windows) |
12 |
| ------------------------------------------------------------------------ |
13 |
| - |
14 |
| -If you wish to develop Annotator, you'll need to have a working |
15 |
| -installation of `Node.js <http://nodejs.org/>`__ (v0.8.x). Once |
16 |
| -installed (on most systems Node comes bundled with |
17 |
| -`NPM <http://npmjs.org/>`__) you should run the following to install |
18 |
| -Annotator's development dependencies:: |
| 4 | +If you wish to develop Annotator, you'll need to have a working installation of |
| 5 | +`Node.js <http://nodejs.org/>`__ (>= v0.10.x). Once installed (on most systems |
| 6 | +Node comes bundled with `NPM <http://npmjs.org/>`__) you should run the |
| 7 | +following to install Annotator's development dependencies:: |
19 | 8 |
|
20 | 9 | $ npm install .
|
21 | 10 |
|
22 |
| -The Annotator source is found in ``src/``, and is written in |
23 |
| -CoffeeScript, which is a little language that compiles to Javascript. |
24 |
| -See the `CoffeeScript website <http://coffeescript.org/>`__ for more |
25 |
| -information. |
26 |
| - |
27 |
| -``dev.html`` loads the raw development files from ``lib/`` and can be |
28 |
| -useful when developing. |
| 11 | +The Annotator source is found in ``src/``. You can use the ``tools/serve`` |
| 12 | +script while developing to serve bundle the source files. ``dev.html`` can be useful |
| 13 | +when developing. |
29 | 14 |
|
30 |
| -The tests can be found in ``test/spec/``. You can run the tests in your |
31 |
| -browser (using ``test/runner.html``), but while you're working it's |
32 |
| -probably easiest to run the tests using ``npm test`` from the root of |
33 |
| -the repository. This will require |
34 |
| -`PhantomJS <http://www.phantomjs.org/>`__ and the mocha runner:: |
| 15 | +The tests can be found in ``test/`` and can be run with:: |
35 | 16 |
|
36 |
| - $ npm install -g phantomjs mocha-phantomjs |
| 17 | + $ npm test |
37 | 18 |
|
38 |
| -For inline documentation we use `TomDoc <http://tomdoc.org/>`__. It's a |
39 |
| -Ruby specification but it also works nicely with CoffeeScript. |
40 | 19 |
|
41 |
| -Tools |
| 20 | +Build |
42 | 21 | -----
|
43 | 22 |
|
44 |
| -There are a number of useful development tools shipped in the ``tools/`` |
45 |
| -directory:: |
| 23 | +Building the packaged version of Annotator involves running the appropriate |
| 24 | +``make`` task. To build everything, run:: |
| 25 | + |
| 26 | + $ make |
46 | 27 |
|
47 |
| - $ ./tools/build # compiles src/*.coffee and test/*.coffee into lib/*.js |
48 |
| - $ ./tools/watch # like the above, but automatically recompiles files when they change |
49 |
| - $ ./tools/test # runs the test suite with PhantomJS |
| 28 | +To build just the main Annotator bundle, run:: |
50 | 29 |
|
51 |
| -Building the packaged version of Annotator involves running the |
52 |
| -appropriate ``make`` task. For example:: |
| 30 | + $ make pkg/annotator.min.js |
53 | 31 |
|
54 |
| - $ make # build everything |
55 |
| - $ make bookmarklet # build the bookmarklet |
56 |
| - $ make annotator plugins # build annotator and individual plugin files. |
| 32 | +To build a standalone extension module, run:: |
57 | 33 |
|
| 34 | + $ make pkg/annotator.document.min.js |
0 commit comments