You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -28,11 +28,11 @@ OpenAPI plugin for generating API reference docs in Docusaurus v2.
28
28
29
29
## Overview
30
30
31
-
The `docusaurus-plugin-openapi-docs` package extends the Docusaurus CLI with commands for generating MDX using the OpenAPI specification as the source. The resulting MDX is fully compatible with [plugin-content-docs](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs) and can be used to render beautiful reference API docs by setting `docItemComponent` to `@theme/ApiItem`, a custom component included in the `docusaurus-theme-openapi-docs` theme.
31
+
The `docusaurus-plugin-openapi-docs` package extends the Docusaurus CLI with commands for generating MDX using the OpenAPI specification as the source. The resulting MDX is fully compatible with [plugin-content-docs](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs) and can be used to render beautiful reference API docs when combined with the `docusaurus-theme-openapi-docs` theme.
32
32
33
33
Key Features:
34
34
35
-
-**Compatible:** Works with Swagger 2.0 and OpenAPI 3.0.
35
+
-**Compatible:** Works with Swagger 2.0 and OpenAPI 3.x.
36
36
-**Fast:** Convert large OpenAPI specs into MDX docs in seconds. 🔥
37
37
-**Stylish:** Based on the same [Infima styling framework](https://infima.dev/) that powers the Docusaurus UI.
38
38
-**Flexible:** Supports single, multi and _even micro_ OpenAPI specs.
@@ -41,16 +41,16 @@ Key Features:
41
41
42
42
| Docusaurus OpenAPI Docs | Docusaurus |
43
43
| ----------------------- | --------------- |
44
-
| 3.0.0-beta.x (beta) |`3.0.1 - 3.1.1`|
45
-
| 2.0.x (current)|`2.4.1 - 2.4.3`|
44
+
| 3.0.1 (current) |`3.0.1 - 3.4.0`|
45
+
| 2.2.1 (legacy) |`2.4.1 - 2.4.3`|
46
46
| 1.7.3 (legacy) |`2.0.1 - 2.2.0`|
47
47
48
48
## Bootstrapping from Template (new Docusaurus site)
49
49
50
-
Run the following to bootstrap a Docsaurus v2 site (classic theme) with `docusaurus-openapi-docs`:
50
+
Run the following to bootstrap a Docsaurus v3 site (classic theme) with `docusaurus-openapi-docs`:
> When asked how the template repo should be cloned choose "copy" (unless you know better).
64
+
> When asked how the template repo should be cloned choose "copy".
65
65
66
66
```bash
67
67
cd my-website
68
68
yarn start
69
69
```
70
70
71
+
If all goes well, you should be greeted by a brand new Docusaurus site that includes API reference docs for the ubiquitous Petstore API!
72
+
71
73
## Installation (existing Docusaurus site)
72
74
73
-
Plugin:
75
+
> Both the plugin and theme are currently designed to pair with a specific Docusaurus release. The Docusaurus badge in the `README.md` and at the top of this page will always reflect the current compatible versions.
76
+
77
+
### Plugin
74
78
75
79
```bash
76
80
yarn add docusaurus-plugin-openapi-docs
77
81
```
78
82
79
-
Theme:
83
+
### Theme
80
84
81
85
```bash
82
86
yarn add docusaurus-theme-openapi-docs
83
87
```
84
88
85
-
## Configuring `docusaurus.config.js` (Plugin and theme usage)
89
+
## Configuring `docusaurus.config.ts` (Plugin and theme usage)
86
90
87
-
Here is an example of properly configuring `docusaurus.config.js` file for `docusaurus-plugin-openapi-docs` and `docusaurus-theme-openapi-docs` usage.
91
+
Here is an example of properly configuring `docusaurus.config.ts` for `docusaurus-plugin-openapi-docs` and `docusaurus-theme-openapi-docs` usage.
88
92
89
-
```js
90
-
// docusaurus.config.js
93
+
> Note: Instructions may differ slightly for sites that haven't migrated to typescript.
94
+
95
+
```typescript
96
+
// docusaurus.config.ts
97
+
// note that parts of the complete config were left out for brevity
0 commit comments