0.0.9 • Published 5 years ago

react-doc-creator v0.0.9

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

Create documentation for your React projects in an easy way using standard PropTypes declarations.

Share the documentation in your project's repository.

Demo

It parses the files using React Docgen. Please refer to its documentation for details.

Installation

$ npm install --save-dev react-doc-creator

Usage

In your package.json insert:

{
  // ...
  "scripts": {
    "build:doc": "react-doc-creator"
  }
  // ...
}

To run it:

$ npm run build:doc

It will search for React Components in your src folder and write the documentation in a COMPONENTS.md file

Options

react-doc-creator [path] ...[options]

  path     A component file or directory. Default: src

  Options:
    -o, --out <file>         Target markdown file. (default: COMPONENTS.md)
    -x, --extension <items>  Include only these file extensions. (default: js,jsx)
    -i, --ignore <items>     Folders to ignore. (default: node_modules,__tests__,__mocks__)
    -e, --exclude [regexp]   Filename pattern to exclude.
    -t, --title [value]      Document title. (default: React Components)

Use Examples

The options should be added to the corresponding react-doc-creator script in package.json.

Exclude specific file

react-doc-creator src --exclude demo\.jsx

Period (.) must be escaped since the exclude option works with RegExp.

Ignore directories

react-doc-creator src --ignore tests,utils

Warning: Avoid spaces between directory names.

Set custom title

react-doc-creator src --title 'Project shared components'