0.0.11 • Published 10 years ago

react-markdown-gen v0.0.11

Weekly downloads
27
License
MIT
Repository
github
Last release
10 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

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago