Skip to content

Commit a8a21fc

Browse files
committed
[Enhancement] Add support for powershell (#507)
* Switch to BASH icon * Ugprade to postman-code-generators 1.5.0-patch.1 * Add powershell and enable all langs * Add powershell * Add powershell styles and add background to bash icon * Switch to python requests variant * Add title to code blocks * Unhide send button for Petstore * Adjust size of code block logos * Downgrade to legacy postman-code-generators * Disable csharp * Disable powershell * Enable powershell * Switch to postman-code-generators 1.1.15-patch.2
1 parent c3bf28b commit a8a21fc

File tree

5 files changed

+552
-17
lines changed

5 files changed

+552
-17
lines changed

demo/docusaurus.config.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const config = {
136136
copyright: `Copyright © ${new Date().getFullYear()} Palo Alto Networks, Inc. Built with Docusaurus ${DOCUSAURUS_VERSION}.`,
137137
},
138138
prism: {
139-
additionalLanguages: ["ruby", "csharp", "php", "java"],
139+
additionalLanguages: ["ruby", "csharp", "php", "java", "powershell"],
140140
},
141141
languageTabs: [
142142
{
@@ -148,7 +148,7 @@ const config = {
148148
highlight: "python",
149149
language: "python",
150150
logoClass: "python",
151-
variant: "http.client",
151+
variant: "requests",
152152
},
153153
{
154154
highlight: "go",
@@ -161,28 +161,33 @@ const config = {
161161
logoClass: "nodejs",
162162
variant: "axios",
163163
},
164-
// {
165-
// highlight: "ruby",
166-
// language: "ruby",
167-
// logoClass: "ruby",
168-
// },
164+
{
165+
highlight: "ruby",
166+
language: "ruby",
167+
logoClass: "ruby",
168+
},
169169
{
170170
highlight: "csharp",
171171
language: "csharp",
172172
logoClass: "csharp",
173173
variant: "httpclient",
174174
},
175-
// {
176-
// highlight: "php",
177-
// language: "php",
178-
// logoClass: "php",
179-
// },
175+
{
176+
highlight: "php",
177+
language: "php",
178+
logoClass: "php",
179+
},
180180
{
181181
highlight: "java",
182182
language: "java",
183183
logoClass: "java",
184184
variant: "unirest",
185185
},
186+
{
187+
highlight: "powershell",
188+
language: "powershell",
189+
logoClass: "powershell",
190+
},
186191
],
187192
algolia: {
188193
apiKey: "441074cace987cbf4640c039ebed303c",

packages/docusaurus-theme-openapi-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dependencies": {
4646
"@docusaurus/theme-common": "^2.3.0",
4747
"@mdx-js/react": "^1.6.21",
48-
"@paloaltonetworks/postman-code-generators": "^1.1.15",
48+
"@paloaltonetworks/postman-code-generators": "1.1.15-patch.2",
4949
"@paloaltonetworks/postman-collection": "^4.1.0",
5050
"@reduxjs/toolkit": "^1.7.1",
5151
"buffer": "^6.0.3",

packages/docusaurus-theme-openapi-docs/src/theme/ApiDemoPanel/Curl/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ export const languageSet: Language[] = [
108108
},
109109
variant: "OkHttp",
110110
},
111+
{
112+
highlight: "powershell",
113+
language: "powershell",
114+
logoClass: "powershell",
115+
options: {
116+
followRedirect: true,
117+
trimRequestBody: true,
118+
},
119+
variant: "RestMethod",
120+
},
111121
];
112122

113123
export interface Props {
@@ -278,6 +288,7 @@ function Curl({ postman, codeSamples }: Props) {
278288
<CodeBlock
279289
language={lang.highlight}
280290
className="openapi-demo__code-block"
291+
title={`${lang.language} / ${lang.variant}`}
281292
>
282293
{codeText}
283294
</CodeBlock>

0 commit comments

Comments
 (0)