Skip to content

Commit c33fe6b

Browse files
committed
Add usage doc for node usage
1 parent c04ea4f commit c33fe6b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/USAGE_NODE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Using documentation.js as a node library
2+
3+
You might want to do this if you're
4+
5+
* building an integration, like our gulp or grunt integrations
6+
* using documentation.js's AST parsing or some other component
7+
* mad science
8+
9+
Basic concepts:
10+
11+
* documentation.js takes an array of entry points, which can be filenames
12+
or objects with `source` and `file` members
13+
* generating documentation is a two-step process: parsing, in the
14+
documentation.build and documentation.buildSync methods, and generating
15+
output in documentation.formats.md, json, or html.
16+
17+
### Example
18+
19+
```js
20+
var documentation = require('./');
21+
22+
var docs = documentation.buildSync([{
23+
source: '/** hi this is a doc\n@name myDoc */',
24+
file: 'direct.js'
25+
}]);
26+
27+
documentation.formats.md(docs, {}, function(err, res) {
28+
console.log(res);
29+
});
30+
```

0 commit comments

Comments
 (0)