# @typebot.io/docusaurus-theme-openapi

> OpenAPI theme for Docusaurus.

Latest version **0.6.5** (published 2022-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @typebot.io/docusaurus-theme-openapi
pnpm add @typebot.io/docusaurus-theme-openapi
yarn add @typebot.io/docusaurus-theme-openapi
bun add @typebot.io/docusaurus-theme-openapi
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.6.5 |
| Published | 2022-11-28 |
| First published | 2022-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 19 |
| Unpacked size | 373.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 537 |
| Maintainers | baptistearnaud |

## Links

- npm: https://www.npmjs.com/package/@typebot.io/docusaurus-theme-openapi
- Repository: https://github.com/cloud-annotations/docusaurus-openapi
- Homepage: https://github.com/cloud-annotations/docusaurus-openapi#readme
- Issues: https://github.com/cloud-annotations/docusaurus-openapi/issues
- npm.io page: https://npm.io/package/@typebot.io/docusaurus-theme-openapi

## Dependencies (19)

- [clsx](https://npm.io/package/clsx.md) ^1.1.1
- [immer](https://npm.io/package/immer.md) ^9.0.7
- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [process](https://npm.io/package/process.md) ^0.11.10
- [webpack](https://npm.io/package/webpack.md) ^5.73.0
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [react-redux](https://npm.io/package/react-redux.md) ^7.2.0
- [@mdx-js/react](https://npm.io/package/@mdx-js/react.md) ^1.6.22
- [monaco-editor](https://npm.io/package/monaco-editor.md) ^0.31.1
- [@reduxjs/toolkit](https://npm.io/package/@reduxjs/toolkit.md) ^1.7.1
- [postman-collection](https://npm.io/package/postman-collection.md) ^4.1.0
- [@monaco-editor/react](https://npm.io/package/@monaco-editor/react.md) ^4.3.1
- [prism-react-renderer](https://npm.io/package/prism-react-renderer.md) ^1.2.1
- [react-magic-dropzone](https://npm.io/package/react-magic-dropzone.md) ^1.0.1
- [postman-code-generators](https://npm.io/package/postman-code-generators.md) ^1.0.0
- [@docusaurus/theme-common](https://npm.io/package/@docusaurus/theme-common.md) ^2.0.0
- [redux-devtools-extension](https://npm.io/package/redux-devtools-extension.md) ^2.13.8
- [@typebot.io/docusaurus-plugin-openapi](https://npm.io/package/@typebot.io/docusaurus-plugin-openapi.md) ^0.6.5

## Recent versions

- 0.6.5 (latest) — 2022-11-28
- 0.6.4 — 2022-11-28

## README

<h1 align="center">Docusaurus OpenAPI</h1>

<div align="center">

OpenAPI plugin for generating API reference docs in Docusaurus.

[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cloud-annotations/docusaurus-plugin-openapi/blob/HEAD/LICENSE)
[![npm latest package](https://img.shields.io/npm/v/docusaurus-preset-openapi/latest.svg)](https://www.npmjs.com/package/docusaurus-preset-openapi)
[![npm downloads](https://img.shields.io/npm/dm/docusaurus-plugin-openapi.svg)](https://www.npmjs.com/package/docusaurus-preset-openapi)
[![build](https://github.com/cloud-annotations/docusaurus-plugin-openapi/actions/workflows/validate.yaml/badge.svg)](https://github.com/cloud-annotations/docusaurus-plugin-openapi/actions/workflows/validate.yaml)
<br/>
[![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/)
[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/cloud-annotations/docusaurus-plugin-openapi/blob/HEAD/CONTRIBUTING.md#pull-requests)

</div>

<p align="center">

![](https://user-images.githubusercontent.com/4212769/85324376-b9e3d900-b497-11ea-9765-c42a8ad1ff61.png)

</p>

## Quick Overview

```sh
npx create-docusaurus-openapi my-website
cd my-website
npm start
```

> Coming from `v0.1.0`? See the [migration guide](https://github.com/cloud-annotations/docusaurus-plugin-openapi/releases/tag/v0.2.0).

_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher)_

Then open [http://localhost:3000/](http://localhost:3000/) to see your site.<br>
When you’re ready to deploy to production, create a minified bundle with `npm run build`.

## Creating a new Site

**You’ll need to have Node 14.0.0 or later version on your local development machine** (but it’s not required on the server). We recommend using the latest LTS version. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.

To create a new site, you may choose one of the following methods:

- ### npx

  ```sh
  npx create-docusaurus-openapi my-website
  ```

  _([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) is a package runner tool that comes with npm 5.2+ and higher)_

- ### npm

  ```sh
  npm init docusaurus-openapi my-website
  ```

  _`npm init <initializer>` is available in npm 6+_

- ### yarn

  ```sh
  yarn create docusaurus-openapi my-website
  ```

  _[`yarn create <starter-kit-package>`](https://yarnpkg.com/lang/en/docs/cli/create/) is available in Yarn 0.25+_

It will create a directory called `my-website` inside the current folder.<br>
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

```
my-website
├── blog
│   ├── 2019-05-28-hola.md
│   ├── 2019-05-29-hello-world.md
│   └── 2020-05-30-welcome.md
├── docs
│   ├── doc1.md
│   ├── doc2.md
│   ├── doc3.md
│   └── mdx.md
├── src
│   ├── css
│   │   └── custom.css
│   └── pages
│       ├── styles.module.css
│       └── index.js
├── static
│   └── img
├── .gitignore
├── openapi.json
├── docusaurus.config.js
├── babel.config.js
├── package.json
├── sidebars.js
└── README.md
```

- `/docusaurus.config.js` - A config file containing the site configuration. This can be used to configure the OpenAPI preset
- `/openapi.json` - The default OpenAPI definition that will be served _(path can be configured in `docusaurus.config.js`)_.

For more info see [project structure rundown](https://docusaurus.io/docs/installation#project-structure-rundown).

Once the installation is done, you can open your project folder:

```sh
cd my-website
```

Inside the newly created project, you can run some built-in commands:

### `npm start` or `yarn start`

Runs the site in development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will automatically reload if you make changes to the code.

### `npm run build` or `yarn build`

Builds the site for production to the `build` folder.

Docusaurus is a modern static website generator that will build the website into a directory of static contents, which can be copied to any static file hosting service like [GitHub pages](https://pages.github.com/), [Vercel](https://vercel.com/) or [Netlify](https://www.netlify.com/).

## Add to an existing Site

1. Install the dependency

   ```sh
   npm install docusaurus-preset-openapi
   ```

2. Edit your `docusaurus.config.js` file to use this preset
   ```js
   presets: [
     [
       "docusaurus-preset-openapi",
       /** @type {import('docusaurus-preset-openapi').Options} */
       {
         api: {
           path: "<PATH_TO_YOUR_OPENAPI_DOCUMENT>",
           routeBasePath: "/api",
         },
         docs: {
           sidebarPath: require.resolve("./sidebars.js"),
           routeBasePath: "/",
         },
         theme: {
           customCss: require.resolve("./src/css/custom.css"),
         },
       },
     ],
   ];
   ```

## Popular Alternatives

Docusaurus OpenAPI is great for:

- **Static generation** All OpenAPI operations will be rendered as static pages at build time, giving many performance benefits.
- **Demo panel** Allow users to try out your API with an interactive demo panel.
- **Native Docusaurus feel** Built from scratch to work with Docusaurus.

Here are a few common cases where you might want to try something else:

- If you need better support for more advanced OpenAPI features, check out [Redocusaurus](https://github.com/rohit-gohri/redocusaurus/). Redocusaurus embeds the much more mature OpenAPI documentation generator, [Redoc](https://github.com/Redocly/redoc), into Docusaurus as a React component.

## Contributing

We encourage you to contribute to Docusaurus OpenAPI! Please check out the
[Contributing to Docusaurus OpenAPI guide](https://github.com/cloud-annotations/docusaurus-plugin-openapi/blob/main/CONTRIBUTING.md) for guidelines about how to proceed.

## License

Docusaurus OpenAPI is released under the [MIT License](https://opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/@typebot.io/docusaurus-theme-openapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
