Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goto-bus-stop/prop-types-table
create a markdown table documenting a React component's propTypes
https://github.com/goto-bus-stop/prop-types-table
Last synced: 27 days ago
JSON representation
create a markdown table documenting a React component's propTypes
- Host: GitHub
- URL: https://github.com/goto-bus-stop/prop-types-table
- Owner: goto-bus-stop
- License: other
- Created: 2018-07-11T14:37:17.000Z (over 6 years ago)
- Default Branch: default
- Last Pushed: 2024-06-30T11:57:59.000Z (5 months ago)
- Last Synced: 2024-10-05T16:26:10.900Z (about 1 month ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# prop-types-table
create a markdown table documenting a React component's `propTypes`
> Adapted from material-ui's `PropTypeDescription` component:
> https://github.com/callemall/material-ui/blob/82482758573dc714b210529dcf092dab904db0ba/docs/src/app/components/PropTypeDescription.js[Install](#install) - [Usage](#usage) - [License: Apache-2.0](#license)
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url][npm-image]: https://img.shields.io/npm/v/prop-types-table.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/prop-types-table
[travis-image]: https://img.shields.io/travis/goto-bus-stop/prop-types-table.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/prop-types-table
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard## Install
```
npm install prop-types-table
```## Usage
```bash
prop-types-table src/index.js > generated-docs.md
```The result looks a bit like this:
| Name | Type | Default | Description |
|:-----|:-----|:-----|:-----|
| video | string | | An 11-character string representing a YouTube video ID.. |
| id | string | | DOM ID for the player element. |
| className | string | | CSS className for the player element. |
| width | number, string | | Width of the player element. |
| height | number, string | | Height of the player element. |
| onCued | function | () => {} | Sent when the video is cued and ready to play. |
| onBuffering | function | () => {} | Sent when the video is buffering. |You can use this together with [md-insert][] to put prop type documentation for
components into your markdown readme.```bash
prop-types-table src/index.js | md-insert -i README.md --header Props
```## License
[Apache-2.0](LICENSE.md)
[md-insert]: https://github.com/goto-bus-stop/md-insert#readme