Skip to content

Commit

Permalink
Prepare release v3.0.0-beta.5 (#702)
Browse files Browse the repository at this point in the history
* Prepare release v3.0.0-beta.5

* Add markdown support to example summary (#690)

* Add Markdown import to api doc generator

* support markdown rendering for example summary

* add markdown component

* install missing eslint package

* fix import order

* update lock file

* Remove deprecated node packages (#699)

* Remove deprecated node packages

* Update languages.json

* Update languagetabs.md

* Prepare release v3.0.0-beta.5

---------

Co-authored-by: Doron Bargo <62555360+Doron-Bargo@users.noreply.github.com>
  • Loading branch information
sserrata and Doron-Bargo committed Jan 18, 2024
1 parent b326185 commit 1f9c9fa
Show file tree
Hide file tree
Showing 14 changed files with 1,371 additions and 13 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 3.0.0-beta.5 (Jan 18, 2024)

High level enhancements

- Add support for x-CodeSamples
- Add callbacks support
- Add markdown support to example/examples summary
- Remove deprecated node packages from generated snippets

Other enhancements and bug fixes

- Add support to x-codeSamples in v3 ([#701](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/701))
- Add Callbacks Support to V3 ([#700](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/700))
- Remove deprecated node packages ([#699](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/699))
- Add markdown support to example summary ([#690](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/690))

## 3.0.0-beta.4 (Jan 5, 2024)

High level enhancements
Expand Down
2 changes: 1 addition & 1 deletion demo/docs/customization/languagetabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Docusaurus OpenAPI docs plugin comes with support for 8 languages which you
| `curl` | bash | `curl`\* |
| `python` | python | `requests`\*, `http.client` |
| `go` | go | `native`\* |
| `nodejs` | javascript | `axios`\*, `native`, `requests`, `unirest` |
| `nodejs` | javascript | `axios`\*, `native` |
| `ruby` | ruby | `net::http`\* |
| `csharp` | csharp | `restsharp`\*, `httpclient` |
| `php` | php | `curl`\*, `guzzle`, `pecl_http`, `http_request2` |
Expand Down
6 changes: 3 additions & 3 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "demo",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -25,8 +25,8 @@
"@docusaurus/plugin-google-gtag": "3.0.1",
"@docusaurus/preset-classic": "3.0.1",
"clsx": "^1.1.1",
"docusaurus-plugin-openapi-docs": "^3.0.0-beta.4",
"docusaurus-theme-openapi-docs": "^3.0.0-beta.4",
"docusaurus-plugin-openapi-docs": "^3.0.0-beta.5",
"docusaurus-theme-openapi-docs": "^3.0.0-beta.5",
"prism-react-renderer": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"npmClient": "yarn",
"useWorkspaces": true
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@eslint-community/eslint-utils": "^4.4.0",
"@testing-library/cypress": "^8.0.1",
"@types/jest": "^27.0.2",
"@types/node": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-openapi-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docusaurus-plugin-openapi-docs",
"description": "OpenAPI plugin for Docusaurus.",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"license": "MIT",
"keywords": [
"openapi",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function createResponseExamples(
value: `${exampleName}`,
children: [
guard(exampleValue.summary, (summary) => [
create("p", {
create("Markdown", {
children: ` ${summary}`,
}),
]),
Expand All @@ -143,7 +143,7 @@ export function createResponseExamples(
value: `${exampleName}`,
children: [
guard(exampleValue.summary, (summary) => [
create("p", {
create("Markdown", {
children: ` ${summary}`,
}),
]),
Expand Down Expand Up @@ -171,7 +171,7 @@ export function createResponseExample(responseExample: any, mimeType: string) {
value: `Example`,
children: [
guard(responseExample.summary, (summary) => [
create("p", {
create("Markdown", {
children: ` ${summary}`,
}),
]),
Expand All @@ -187,7 +187,7 @@ export function createResponseExample(responseExample: any, mimeType: string) {
value: `Example`,
children: [
guard(responseExample.summary, (summary) => [
create("p", {
create("Markdown", {
children: ` ${summary}`,
}),
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function createApiPageMD({
`import ResponseSamples from "@theme/ResponseSamples";\n`,
`import SchemaItem from "@theme/SchemaItem";\n`,
`import SchemaTabs from "@theme/SchemaTabs";\n`,
`import Markdown from "@theme/Markdown";\n`,
`import OperationTabs from "@theme/OperationTabs";\n`,
`import TabItem from "@theme/TabItem";\n\n`,
createHeading(title),
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-openapi-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docusaurus-theme-openapi-docs",
"description": "OpenAPI theme for Docusaurus.",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"license": "MIT",
"keywords": [
"openapi",
Expand Down Expand Up @@ -44,7 +44,7 @@
"clsx": "^1.1.1",
"copy-text-to-clipboard": "^3.1.0",
"crypto-js": "^4.1.1",
"docusaurus-plugin-openapi-docs": "^3.0.0-beta.4",
"docusaurus-plugin-openapi-docs": "^3.0.0-beta.5",
"docusaurus-plugin-sass": "^0.2.3",
"file-saver": "^2.0.5",
"lodash": "^4.17.20",
Expand Down
4 changes: 4 additions & 0 deletions packages/docusaurus-theme-openapi-docs/src/theme-openapi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ declare module "@theme/SchemaTabs" {
export default function SchemaTabs(props: any): JSX.Element;
}

declare module "@theme/Markdown" {
export default function Markdown(props: any): JSX.Element;
}

declare module "@theme/ApiExplorer/Accept" {
export default function Accept(): JSX.Element;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import FormSelect from "@theme/ApiExplorer/FormSelect";
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
import LiveApp from "@theme/ApiExplorer/LiveEditor";
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
import Markdown from "@theme/Markdown";
import SchemaTabs from "@theme/SchemaTabs";
import TabItem from "@theme/TabItem";
import { RequestBodyObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
Expand Down Expand Up @@ -303,6 +304,7 @@ function Body({
</TabItem>
{/* @ts-ignore */}
<TabItem label="Example" value="example">
{example.summary && <Markdown children={example.summary} />}
{exampleBody && (
<LiveApp
action={dispatch}
Expand Down Expand Up @@ -340,7 +342,7 @@ function Body({
value={example.label}
key={example.label}
>
{example.summary && <p>{example.summary}</p>}
{example.summary && <Markdown children={example.summary} />}
{example.body && (
<LiveApp action={dispatch} language={language}>
{example.body}
Expand Down

0 comments on commit 1f9c9fa

Please sign in to comment.