npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-react-docs--templates

v0.2.0-alpha

Published

A gulp plugin for generating documentation in Markdown format for React components based on their `propTypes`.

Downloads

6

Readme

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

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