Skip to content

ly-tools/gulp-react-prop-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-react-prop-table

Test coverage Build Status Dependency Status devDependency Status NPM version node License npm download

A gulp plugin use react-prop-table to generate documentation for React project

Installation

$ npm install --save-dev gulp
$ npm install --save-dev gulp-react-prop-table

Usage

.
├── doc
│   ├── group.md
│   ├── index.md
│   └── option.md
├── gulpfile.js
└── src
    ├── group.jsx
    ├── index.jsx
    └── option.jsx
var gulp = require('gulp');
var plugin = require('gulp-react-prop-table');

gulp.task('demo', function() {
  return gulp.src('src/**/*')
    .pipe(plugin({
      // your options
    }))
    .pipe(gulp.dest('doc'));
});

Options

template

String, Default '# <%= path %>\n\n<%= contents %>'

String template of documentation, path will be path of the file and contents will be the markdown result

headers

Configuration of the header

  • config.headers:Array(Object) => Headers config
    • header.name:String => key in data object
    • header.align:String => text align of the column
    • header.title:String => title of the column

Default:

[{
  name: 'name',
  align: ':---'
}, {
  name: 'description',
  align: ':-----'
}, {
  name: 'type',
  align: ':---'
}, {
  name: 'required',
  align: ':---:'
}, {
  name: 'defaultValue',
  align: ':---:',
  title: 'Default Value'
}]

Test

$ npm run test
$ npm run test-cov
$ npm run test-travis

License

The MIT License (MIT)

Copyright (c) 2015 ly-tools

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A gulp plugin use react-prop-table to generate documentation for React project

Resources

License

Stars

Watchers

Forks

Packages

No packages published