multilang-apidocs
v0.2.1
Published
api-doc generator for multiple languages
Downloads
933
Readme
multilang-apidocs
api-doc generator for multiple languages
Installation
npm install multilang-apidocs
Usage
The following example demonstrates how to use this module:
var multilangApiDocs = require('multilang-apidocs')
var fs = require('fs')
var apidocs = multilangApiDocs(fs.readFileSync('fixture.js', 'utf8'), {
filename: 'fixture.js'
}).join('\n')
console.log(apidocs)
This will generate the following output
[object Object]
[object Object]
API-reference
multilangApidocs
The function extracts apidoc comments from a string and returns a list with one markdown-string per comment.
Parameters:
- string: string - contents of the source-code file.
- options: object= - options
- options.filename: string= - the name of the source-code file (Used to apply language-specific comment patterns and code-context detection.
- options.defaults: object= - specify default values for values of the code-context and the parsed comment
- options.filter: (FilterDefinition | function(object):boolean)= - filter the displayed comments This parameter can either be a function or a plain object. See 'filter definitions' for details
Returns:
- Array<{marddown: string, parsed: ApiDefinition}> - a list of strings containing the apidoc in markdown format.
License
multilang-apidocs
is published under the MIT-license.
See LICENSE.md for details.
Contributing Guidelines
Contributions are always welcome!
Before spending lots of time on something, ask for feedback on your idea first!
Please search issues and pull requests before adding something new to avoid duplicating efforts and conversations.
Installing
Fork and clone the repo, then npm install
to install all dependencies and npm test
to
ensure all is okay before you start anything.
Testing
Tests are run with npm test
. Please ensure all tests are passing before submitting
a pull request (unless you're creating a failing test to increase test coverage or show a problem).
Code Style
This repository uses standard
to maintain code style and consistency,
and to avoid style arguments.
npm i standard -g
It is intentional to don't have standard
, istanbul
and coveralls
in the devDependencies. Travis will handle all that stuffs. That approach will save bandwidth also installing and development time.