1
1
# apiez
2
2
3
- Easily generate API documentation for javascript from runtime instead of source.
3
+ Easily generate API documentation at runtime, rather than from the source code .
4
4
5
- Contract:
6
-
7
- The document is a continuous comment at the top of the function body
5
+ Results details to see [ test] ( ./test.js ) and [ test-class] ( ./test-class.js )
8
6
9
7
## Install
10
8
@@ -15,65 +13,50 @@ $ npm install apiez
15
13
## Useage
16
14
17
15
``` js
18
- var apidoc = require (' apiez' );
16
+ var apiez = require (' apiez' );
19
17
20
- apidoc ( require ( ' buffer ' ) )
18
+ apiez (apiez )
21
19
```
22
20
23
21
cli
24
22
25
23
``` shell
26
- $ apiez buffer
24
+ $ apiez apiez
27
25
```
28
26
29
- ## Example
30
-
31
- ``` js
32
- var apiez = require (' apiez' ),
33
- assert = require (' assert' );
34
-
35
- function A () {
36
- /* A*/
37
- }
38
-
39
- A .prototype .a = function (a /* */ ) {
40
- /*
41
- a
42
-
43
- b
44
- */
45
-
46
- // After the blank line is not a document
47
- }
27
+ output
48
28
49
- A .prototype .b = function a (a /* */ ) {
50
- //
51
- // a
52
- //
53
- // b
54
- //
55
-
56
- // After the blank line is not a document
57
- }
58
-
59
- function test (x , s ) {
60
- assert .equal (apiez (x, JSON .stringify ), s)
61
- }
62
-
63
- test (function a (/* ignore*/ a , /* c,*/ /* ignore*/ b /* ,c
64
- c*/ , /* ignore*/ c /* c*/ ) {
65
-
66
- }, ' {"a":{"args":[["a","c,"],["b",",c","c"],["c","c"]]}}' )
67
-
68
- test (A , ' {"A":{"methods":{' +
69
- ' "a":{"args":["a"],"doc":["a",""," b"]},' +
70
- ' "b":{"args":["a"],"doc":["a",""," b"]}' +
71
- ' }}}' )
72
-
73
- test ({ B : A }, ' {"B":{"methods":{' +
74
- ' "a":{"args":["a"],"doc":["a",""," b"]},' +
75
- ' "b":{"args":["a"],"doc":["a",""," b"]}' +
76
- ' }}}' )
29
+ ```
30
+ apiez
31
+ params
32
+ funcInside
33
+ a function or object
34
+ results
35
+ default Object.create(null)
36
+ object as
37
+
38
+ {
39
+ name:{
40
+ params:[["paramN","doc"...]...],
41
+ notes:["doc"...]
42
+ }
43
+ }
44
+ notes
45
+ Generate API documentation object for funcInside.
46
+
47
+ Contract:
48
+
49
+ The summary is a continuous comment at the top of the function body
50
+ Anonymous functions named ""
51
+
52
+ Feature:
53
+
54
+ Parameter Comment
55
+ Prototype methods
56
+ Extends class
57
+ Constructor, if it is first method
58
+ Remove head and tail empty lines
59
+ Remove the same indent white-spaces
77
60
```
78
61
79
62
# License
0 commit comments