Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nknapp/multilang-apidocs
https://github.com/nknapp/multilang-apidocs
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nknapp/multilang-apidocs
- Owner: nknapp
- License: mit
- Created: 2015-05-27T20:11:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-18T22:31:02.000Z (almost 8 years ago)
- Last Synced: 2024-10-06T03:20:18.939Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# multilang-apidocs
> api-doc generator for multiple languages
# Installation
```
npm install multilang-apidocs
```
## UsageThe following example demonstrates how to use this module:
```js
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](https://github.com/nknapp/multilang-apidocs/blob/master/index.js#L44)
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'](#filterDefinitions) 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](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
[![standard][standard-image]][standard-url]
This repository uses [`standard`][standard-url] 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.
[standard-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg
[standard-url]: https://github.com/feross/standard