Skip to content

Commit ccb52d8

Browse files
authored
Adds redoc openapi plugin (#1312)
* adds redocusaurus plugin * adds APIs dropdown * adds unknown word to cspell
1 parent 176dc2d commit ccb52d8

File tree

5 files changed

+599
-12
lines changed

5 files changed

+599
-12
lines changed

cspell.json

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"quic",
126126
"quickstart",
127127
"quickstarts",
128+
"redocusaurus",
128129
"refreshdirectory",
129130
"rego",
130131
"Remmina",
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// solution here: https://github.com/rohit-gohri/redocusaurus/issues/236#issuecomment-1449548972
2+
3+
// solution here: https://github.com/rohit-gohri/redocusaurus/issues/236#issuecomment-1449548972
4+
5+
module.exports = async function webpackDebugFix(context, opts) {
6+
const webpack = require('webpack');
7+
8+
return {
9+
name: 'webpack-fix-plugin',
10+
configureWebpack(config, isServer, utils, content) {
11+
return {
12+
plugins: [
13+
new webpack.DefinePlugin({
14+
'process.env.DEBUG': 'process.env.DEBUG',
15+
}),
16+
],
17+
};
18+
},
19+
};
20+
};

docusaurus.config.js

+29
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ const config = {
6161
},
6262
},
6363
],
64+
[
65+
'redocusaurus',
66+
{
67+
specs: [
68+
{
69+
spec: 'https://console.pomerium.app/openapi.yaml',
70+
route: '/docs/api/'
71+
}
72+
]
73+
}
74+
]
6475
],
6576

6677
themeConfig: {
@@ -96,6 +107,23 @@ const config = {
96107
label: 'Reference',
97108
to: '/docs/reference/',
98109
},
110+
{
111+
type: 'dropdown',
112+
position: 'right',
113+
label: 'APIs',
114+
items: [
115+
{
116+
docId: 'docs/api',
117+
label: 'Zero API',
118+
to: '/docs/api/',
119+
},
120+
{
121+
docId: 'docs/capabilities/enterprise-api',
122+
label: 'Enterprise API',
123+
to: 'docs/capabilities/enterprise-api',
124+
}
125+
]
126+
},
99127
{
100128
type: 'docSidebar',
101129
sidebarId: 'guides',
@@ -207,6 +235,7 @@ const config = {
207235
id: process.env.GTM,
208236
},
209237
],
238+
'./docusaurus-plugins/src/webpackDebugFix.js',
210239
],
211240
};
212241

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"raw-loader": "^4.0.2",
3939
"react": "^18.2.0",
4040
"react-dom": "^18.2.0",
41-
"react-mailchimp-subscribe": "^2.1.3"
41+
"react-mailchimp-subscribe": "^2.1.3",
42+
"redocusaurus": "^2.0.2"
4243
},
4344
"browserslist": {
4445
"production": [

0 commit comments

Comments
 (0)