https://github.com/thebuilder/react-docs-markdown
Convert the output of react-docgen into markdown
https://github.com/thebuilder/react-docs-markdown
Last synced: over 1 year ago
JSON representation
Convert the output of react-docgen into markdown
- Host: GitHub
- URL: https://github.com/thebuilder/react-docs-markdown
- Owner: thebuilder
- License: mit
- Created: 2016-08-30T09:40:16.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T02:23:29.000Z (over 3 years ago)
- Last Synced: 2024-10-20T04:33:05.392Z (over 1 year ago)
- Language: JavaScript
- Size: 1.07 MB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
React Docs Markdown
===========================
[](https://greenkeeper.io/)
At the moment this is a simple package, that takes the output from [react-docgen](https://github.com/reactjs/react-docgen), and returns it as Markdown. You can then save it to a file, append more content, or whatever you need.
### API
#### docsToMarkdown(api: object, name: string, options: Object)
* **api** - The output from react-docgen.
* **name** - Component name to set as page title
* **options** _(Optional)_
* excludeKeys
* excludeTypes
* excludeDescription
### Example
```js
var fs = require('fs');
var docsToMarkdown = require('react-docs-markdown');
var md = docsToMarkdown(api, 'Button');
// Use fs to write the markdown to dist
fs.writeFile('docs/button.md', md, (err) => {
if (err) throw err;
});
```
## Publishing
Use [np](https://www.npmjs.com/package/np) when publishing a new version to ensure everything is done correctly.