0.0.11 • Published 8 years ago

react-markdown-gen v0.0.11

Weekly downloads
27
License
MIT
Repository
github
Last release
8 years ago

react-markdown-gen

use react-docgen to extract information from React component, and convert to markdown.

Install

npm install -g react-markdown-gen

##Usage:

rmd <component_name> <input_file> [output_file]

##example

rmd Calendar index.js readme.md

#If no output file exists, markdown string will be printed out.
rmd Calendar index.js

For the following component

import React, {Component} from 'react';

/**
 * General component description.
 */
export default class MyComponent extends Component {
    render() {
        // ...
    }
}

MyComponent.defaultProps = {
    showPagination: true,
    paginationColor: '#09c',
    paginationSpace: 20
}

MyComponent.propTypes = {
    /** Description of prop "children". */
    children: React.PropTypes.node.isRequired,
    showPagination: React.PropTypes.bool,
    paginationColor: React.PropTypes.string,
    paginationSpace: React.PropTypes.number,
}

we are getting this output:

MyComponent

General component description.

Props

PropTypeDefaultRequiredDescription
childrennodeYesDescription of prop "children".
showPaginationbooltrueNo
paginationColorstring'#09c'No
paginationSpacenumber20No
0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago