]>
Commit | Line | Data |
---|---|---|
1 | # API Notation Syntax for Vim | |
2 | ||
3 | This is a syntax for api notation, a simple notation I've been using for | |
4 | annotating module APIs in specs and other documents. | |
5 | ||
6 | ## Installing | |
7 | ||
8 | Install with pathogen: | |
9 | ||
10 | 1. Clone the repo or copy the files to your `.vim/bundle` dir | |
11 | 2. Reload the vim | |
12 | 3. Enjoy the vim | |
13 | ||
14 | ## API Notation Reference | |
15 | ||
16 | The most recent reference as of now is in this [gist][api-reference], so | |
17 | check that to be sure. But here's a reproduction of the notation. | |
18 | ||
19 | ``` | |
20 | Class Members | |
21 | + class property | |
22 | - instance property | |
23 | ~> listened events (socket) | |
24 | +> listened events (class/module) | |
25 | -> listened events (instance) | |
26 | <~ dispatched events (socket) | |
27 | <+ dispatched events(class/module) | |
28 | <- dispatched events (instance) | |
29 | :: class method | |
30 | # instance method | |
31 | ||
32 | Other symbols | |
33 | => returns | |
34 | ->() callback return | |
35 | [xx] optional | |
36 | <xx> data type | |
37 | ||
38 | Recommended order: class first, then sockets, then instance. Internally: | |
39 | Properties, events, methods. | |
40 | ``` | |
41 | ||
42 | ## How does it look like? | |
43 | ||
44 | Like this. | |
45 | ||
46 | ![Like this.][api-example] | |
47 | ||
48 | [api-reference]: https://gist.github.com/benbeltran/4694c46fcec131468e34 | |
49 | [api-example]: http://ns.vc/1gXwQ.png |