0.1.1 • Published 6 months ago

docusaurus-plugin-react-docgen v0.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
6 months ago

Docusaurus Plugin react-docgen

A Docusaurus 2.x plugin that help generate and consume auto-generated docs from react-docgen.

Installation

Grab from NPM and install along with react-docgen:

npm i docusaurus-plugin-react-docgen react-docgen # or
yarn add docusaurus-plugin-react-docgen react-docgen

Usage

Inside your docusaurus.config.js add to the plugins field and configure with the src option with full glob support :+1:

module.exports = {
  plugins: [
    [
      'docusaurus-plugin-react-docgen',
      {
        // pass in a single string or an array of strings
        src: ['path/to/**/*.tsx', '!path/to/**/*test.*'],
        route: {
          path: '/docs/api',
          component: require.resolve('./src/components/MyDataHandler.js'),
          exact: true,
        },
      },
    ],
  ],
};

Any pattern supported by fast-glob is allowed here (including negations)

Options

NameTypeRequiredDescription
srcstring | string[]YesTell react-docgen where to ook for source files. Use relative, absolute, and/or globbing syntax
globalbooleanNoStore results so they're globally accessible in docusaurus
routeRouteConfigNoMakes docgen results accessible at the specified URL. Note modules cannot be overridden.
docgendocgen configNoPass custom resolvers and handlers to react-docgen
parserOptionsbabel parser optionsNoPass custom options to @babel/parser
babeldocgen optionsNoPass specific options to @babel/parse that aids in resolving the correct babel config file
0.1.1

6 months ago

0.1.0

1 year ago

0.0.3

2 years ago

0.0.2

3 years ago

0.0.1

4 years ago