• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

AdRoll/gulp-react-docs: Gulp plugin for generating Markdown documentation for Re ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

AdRoll/gulp-react-docs

开源软件地址(OpenSource Url):

https://github.com/AdRoll/gulp-react-docs

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

gulp-react-docs

A gulp plugin for generating documentation in Markdown format for React components based on their propTypes. The plugin uses react-docgen to extract component prop information, and then render the markdown using handlebars.

This plugin is an extension of the automatic documentation generation tool we use at AdRoll for our reusable component library as written about here.

Installation

Install package with npm and add it to your development dependencies:

npm install gulp-react-docs --save-dev

Information

Packagegulp-react-docs
Description Generates Markdown documentation for React components based on component `propTypes`.
Node Version >= 10

Usage

var gulpReactDocs = require('gulp-react-docs');

gulp.task('react-docs', function() {
    var docsDest = 'docs';

    return gulp.src('./components/**/*.jsx')
        .pipe(gulpReactDocs({
            path: docsDest
        }))
        .pipe(gulp.dest(docsDest));
});

For example usage, see our example gulpfile.js here.

For example output, see the generated docs example/docs generated from the files in example/components.

Options

The gulp-react-docs plugin can take an options object. The following attributes may be passed as part of the options object:

path

  • Type: string OR function
  • Default: undefined

The path specifying the destination directory for your generated documentation files. This option is used to generate links from the output .md files to the source code. See the link produced below the heading here for an example. If this option is not given, the link to the source code will not be generated. The path can be either a string or a function.

If you pass in a string, path should be the relative path from the gulpfile.js using the gulp-react-docs plugin to where the generated documentation will be output. The path will then be used to generate the relative path from the output documentation to the source code.

If you pass in a function, path is expected to return a string. The return value can be either a relative from where the generated documentation will be output to the source code, or an absolute path / URL pointing to the source code.

Contributors




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap