# docusaurus-plugin-react-docgen

> A small plugin that integrates react-docgen with docusaurus 2.x

Latest version **0.1.1** (published 2023-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install docusaurus-plugin-react-docgen
pnpm add docusaurus-plugin-react-docgen
yarn add docusaurus-plugin-react-docgen
bun add docusaurus-plugin-react-docgen
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-11-09 |
| First published | 2020-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 35.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Dennis Thompson |
| Maintainers | djthomps |
| Keywords | docusaurus, plugin, react-docgen |

## Links

- npm: https://www.npmjs.com/package/docusaurus-plugin-react-docgen
- Repository: https://github.com/atomicpages/docusaurus-plugin-react-docgen
- Homepage: https://github.com/atomicpages/docusaurus-plugin-react-docgen#readme
- Issues: https://github.com/atomicpages/docusaurus-plugin-react-docgen/issues
- npm.io page: https://npm.io/package/docusaurus-plugin-react-docgen

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^8.0.3
- [superstruct](https://npm.io/package/superstruct.md) ^1.0.3

## Recent versions

- 0.1.1 (latest) — 2023-11-09
- 0.1.0 — 2023-02-11
- 0.0.3 — 2022-06-20
- 0.0.2 — 2020-11-24
- 0.0.1 — 2020-08-31

## README

# 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`:

```sh
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:

```js
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`](https://github.com/mrmlnc/fast-glob) is allowed here
(including negations)

## Options

| Name            | Type                                                                                                             | Required | Description                                                                                                                                                |
| --------------- | ---------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `src`           | `string` \| `string[]`                                                                                           | Yes      | Tell `react-docgen` where to ook for source files. Use relative, absolute, and/or globbing syntax                                                          |
| `global`        | `boolean`                                                                                                        | No       | Store results so they're [globally accessible](https://v2.docusaurus.io/docs/docusaurus-core#useplugindatapluginname-string-pluginid-string) in docusaurus |
| `route`         | [`RouteConfig`](https://v2.docusaurus.io/docs/lifecycle-apis#actions)                                            | No       | Makes docgen results accessible at the specified URL. Note `modules` cannot be overridden.                                                                 |
| `docgen`        | [docgen config](https://github.com/reactjs/react-docgen#source)                                                  | No       | Pass custom resolvers and handlers to `react-docgen`                                                                                                       |
| `parserOptions` | [babel parser options](https://github.com/reactjs/react-docgen#-parseroptions)                                   | No       | Pass custom options to `@babel/parser`                                                                                                                     |
| `babel`         | [docgen options](https://github.com/reactjs/react-docgen#-babelrc-babelrcroots-root-rootmode-configfile-envname) | No       | Pass specific options to `@babel/parse` that aids in resolving the correct babel config file                                                               |

---
_Source: https://npm.io/package/docusaurus-plugin-react-docgen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
