GithubHelp home page GithubHelp logo

konradkierus / react-doc-creator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oct-cr/react-doc-creator

0.0 2.0 0.0 111 KB

Generate documentation for React Components based on its PropTypes.

License: MIT License

JavaScript 95.76% HTML 4.24%

react-doc-creator's Introduction

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'

react-doc-creator's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.