Skip to content

Commit 73b212d

Browse files
authored
Prepare release v2.2.1 (#876)
1 parent 0c67e99 commit 73b212d

File tree

7 files changed

+148
-114
lines changed

7 files changed

+148
-114
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 2.2.1 (Jul 3, 2024)
2+
3+
High level enhancements
4+
5+
- Fixed regression bug
6+
7+
Other enhancements and bug fixes
8+
9+
- Fall back to languageSet if no languageTabs provided ([#871](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/871))
10+
111
## 2.2.0 (Jul 3, 2024)
212

313
High level enhancements

README.md

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<div align="center">
88

9-
OpenAPI plugin for generating API reference docs in Docusaurus v2.
9+
OpenAPI plugin for generating API reference docs in Docusaurus v3.
1010

1111
<img src="https://img.shields.io/badge/dynamic/json?style=for-the-badge&logo=meta&color=blueviolet&label=Docusaurus&query=dependencies%5B%22%40docusaurus%2Fcore%22%5D&url=https%3A%2F%2Fraw.githubusercontent.com%2FPaloAltoNetworks%2Fdocusaurus-openapi-docs%2Fmain%2Fdemo%2Fpackage.json" />
1212
<br/><br/>
@@ -28,11 +28,11 @@ OpenAPI plugin for generating API reference docs in Docusaurus v2.
2828

2929
## Overview
3030

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.
3232

3333
Key Features:
3434

35-
- **Compatible:** Works with Swagger 2.0 and OpenAPI 3.0.
35+
- **Compatible:** Works with Swagger 2.0 and OpenAPI 3.x.
3636
- **Fast:** Convert large OpenAPI specs into MDX docs in seconds. 🔥
3737
- **Stylish:** Based on the same [Infima styling framework](https://infima.dev/) that powers the Docusaurus UI.
3838
- **Flexible:** Supports single, multi and _even micro_ OpenAPI specs.
@@ -41,16 +41,16 @@ Key Features:
4141

4242
| Docusaurus OpenAPI Docs | Docusaurus |
4343
| ----------------------- | --------------- |
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` |
4646
| 1.7.3 (legacy) | `2.0.1 - 2.2.0` |
4747

4848
## Bootstrapping from Template (new Docusaurus site)
4949

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

5252
```bash
53-
npx create-docusaurus@2.4.3 my-website --package-manager yarn
53+
npx create-docusaurus@3.4.0 my-website --package-manager yarn
5454
```
5555

5656
> When prompted to select a template choose `Git repository`.
@@ -61,77 +61,75 @@ Template Repository URL:
6161
https://github.com/PaloAltoNetworks/docusaurus-template-openapi-docs.git
6262
```
6363

64-
> 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".
6565
6666
```bash
6767
cd my-website
6868
yarn start
6969
```
7070

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+
7173
## Installation (existing Docusaurus site)
7274

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
7478

7579
```bash
7680
yarn add docusaurus-plugin-openapi-docs
7781
```
7882

79-
Theme:
83+
### Theme
8084

8185
```bash
8286
yarn add docusaurus-theme-openapi-docs
8387
```
8488

85-
## Configuring `docusaurus.config.js` (Plugin and theme usage)
89+
## Configuring `docusaurus.config.ts` (Plugin and theme usage)
8690

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.
8892

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
98+
import type * as Preset from "@docusaurus/preset-classic";
99+
import type { Config } from "@docusaurus/types";
100+
import type * as Plugin from "@docusaurus/types/src/plugin";
101+
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
91102

92103
{
93104
presets: [
94105
[
95106
"classic",
96-
/** @type {import('@docusaurus/preset-classic').Options} */
97-
({
107+
{
98108
docs: {
99-
sidebarPath: require.resolve("./sidebars.js"),
100-
editUrl:
101-
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
102-
docLayoutComponent: "@theme/DocPage",
103-
docItemComponent: "@theme/ApiItem" // derived from docusaurus-theme-openapi-docs
104-
},
105-
blog: {
106-
showReadingTime: true,
107-
editUrl:
108-
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/"
109+
sidebarPath: "./sidebars.ts",
110+
docItemComponent: "@theme/ApiItem", // Derived from docusaurus-theme-openapi
109111
},
110112
theme: {
111-
customCss: require.resolve("./src/css/custom.css")
112-
}
113-
})
114-
]
113+
customCss: "./src/css/custom.css",
114+
},
115+
} satisfies Preset.Options,
116+
],
115117
],
116118

117119
plugins: [
118120
[
119121
'docusaurus-plugin-openapi-docs',
120122
{
121123
id: "api", // plugin id
122-
docsPluginId: "classic", // id of plugin-content-docs or preset for rendering docs
124+
docsPluginId: "classic", // configured for preset-classic
123125
config: {
124-
petstore: { // the <id> referenced when running CLI commands
125-
specPath: "examples/petstore.yaml", // path to OpenAPI spec, URLs supported
126-
outputDir: "api/petstore", // output directory for generated files
127-
sidebarOptions: { // optional, instructs plugin to generate sidebar.js
128-
groupPathsBy: "tag", // group sidebar items by operation "tag"
126+
petstore: {
127+
specPath: "examples/petstore.yaml",
128+
outputDir: "docs/petstore",
129+
sidebarOptions: {
130+
groupPathsBy: "tag",
129131
},
130-
},
131-
burgers: {
132-
specPath: "examples/food/burgers/openapi.yaml",
133-
outputDir: "api/food/burgers",
134-
}
132+
} satisfies OpenApiPlugin.Options,
135133
}
136134
},
137135
]
@@ -226,11 +224,12 @@ Commands:
226224
write-translations [options] [siteDir] Extract required translations of your site.
227225
write-heading-ids [options] [siteDir] [files...] Generate heading ids in Markdown content.
228226
docs:version <version> Tag a new docs version
229-
gen-api-docs <id> Generates OpenAPI docs in MDX file format and sidebar.js (if enabled).
230-
gen-api-docs:version <id:version> Generates versioned OpenAPI docs in MDX file format, versions.js and sidebar.js (if enabled).
231-
clean-api-docs <id> Clears the generated OpenAPI docs MDX files and sidebar.js (if enabled).
232-
clean-api-docs:version <id:version> Clears the versioned, generated OpenAPI docs MDX files, versions.json and sidebar.js (if
227+
gen-api-docs [options] <id> Generates OpenAPI docs in MDX file format and sidebar.ts (if enabled).
228+
gen-api-docs:version [options] <id:version> Generates versioned OpenAPI docs in MDX file format, versions.js and sidebar.ts (if
233229
enabled).
230+
clean-api-docs [options] <id> Clears the generated OpenAPI docs MDX files and sidebar.ts (if enabled).
231+
clean-api-docs:version [options] <id:version> Clears the versioned, generated OpenAPI docs MDX files, versions.json and sidebar.ts
232+
(if enabled)
234233
```
235234

236235
### Generating OpenAPI Docs
@@ -252,10 +251,10 @@ yarn docusaurus gen-api-docs <id>
252251
Example:
253252

254253
```bash
255-
yarn docusaurus gen-api-docs burgers
254+
yarn docusaurus gen-api-docs petstore
256255
```
257256

258-
> The example above will only generate API docs relative to `burgers`.
257+
> The example above will only generate API docs relative to `petstore`.
259258
260259
### Cleaning API Docs
261260

@@ -274,7 +273,7 @@ yarn docusaurus clean-api-docs <id>
274273
Example:
275274

276275
```bash
277-
yarn docusaurus clean-api-docs burgers
276+
yarn docusaurus clean-api-docs petstore
278277
```
279278

280279
> The example above will remove all API docs relative to `burgers`.

demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "demo",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
@@ -27,7 +27,7 @@
2727
"@mdx-js/react": "^1.6.22",
2828
"clsx": "^1.1.1",
2929
"docusaurus-plugin-openapi-docs": "^2.2.0",
30-
"docusaurus-theme-openapi-docs": "^2.2.0",
30+
"docusaurus-theme-openapi-docs": "^2.2.1",
3131
"prism-react-renderer": "^1.3.1",
3232
"react": "^18.2.0",
3333
"react-dom": "^18.2.0"

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.2.0",
2+
"version": "2.2.1",
33
"npmClient": "yarn",
44
"useWorkspaces": true
55
}

0 commit comments

Comments
 (0)