Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rksm/doc-comments
https://github.com/rksm/doc-comments
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/rksm/doc-comments
- Owner: rksm
- Created: 2015-09-10T04:40:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T00:17:18.000Z (over 5 years ago)
- Last Synced: 2024-05-02T06:03:58.219Z (8 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# doc-comments
Extract comments from JavaScript source code and generate API documentation.
Typically you want to add it to the dev dependencies `npm install --save-dev
doc-comments.Then call it from a script, e.g. put
```json
"scripts": {
"doc": "node -e 'require(process.cwd())({files: [\"index.js\"]})'"
}
```into your package.json and run `npm run doc`.
## API
#### generateDoc(options, thenDo)
Reads JS source files, extracts toplevel, object, and function comments
and generates a documentation from these. Will insert doc into README.md or
doc files.
options `{dryRun: BOOL, projectPath: STRING, files: ARRAY[STRING], intoFiles: BOOL}`
`intoFiles`: split documentation into individual doc/xxx.md files or README.md (default).
The README.md file should include insertion markers
`` and
``.
```js
var files = ["lib/foo.js", "lib/bar.js"];
require("doc-comments")({
projectPath: "/foo/bar", files: files},
function(err, markup, fileData) { /*...*/ })/
````.