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
[](https://percy.io/fef74697/redocusaurus)
10
10
11
-
[Redoc](https://github.com/redocly/redoc) for [Docusaurus v2](https://v2.docusaurus.io/).
11
+
[Redoc](https://github.com/redocly/redoc) for [Docusaurus](https://docusaurus.io/).
12
12
13
13
## Usage
14
14
@@ -52,4 +52,4 @@ See this issue, [https://github.com/facebook/docusaurus/issues/638](https://gith
1. Add it as a preset to your docusaurus config along with [@docusaurus/preset-classic](https://docusaurus.io/docs/using-plugins#docusauruspreset-classic) and pass options:
18
22
19
-
- Pass it a path to a local OpenAPI YAML file
20
-
21
-
```js
22
-
// docusaurus.config.js
23
-
24
-
module.exports= {
25
-
// ...
26
-
presets: [
27
-
// .. Your other presets' config
28
-
'@docusaurus/preset-classic',
29
-
// Redocusaurus config
30
-
[
31
-
'redocusaurus',
32
-
{
33
-
// Plugin Options for loading OpenAPI files
34
-
specs: [
35
-
{
36
-
spec:'openapi/openapi.yaml',
37
-
route:'/api/',
38
-
},
39
-
],
40
-
// Theme Options for modifying how redoc renders them
// Theme Options for modifying how redoc renders them
60
+
theme: {
61
+
// Change with your site colors
62
+
primaryColor:'#1890ff',
63
+
},
64
+
},
65
+
] satisfies Redocusaurus.PresetEntry,
66
+
],
67
+
// ... Rest of your config
68
+
};
69
+
70
+
exportdefaultconfig;
71
+
```
84
72
85
73
The API Doc will be available at the route specified (`/api/` in the example above). To customize it see [full plugin options](https://redocusaurus.vercel.app/docs/getting-started/plugin-options).
1. Add it as a preset to your docusaurus config along with [@docusaurus/preset-classic](https://docusaurus.io/docs/using-plugins#docusauruspreset-classic) and pass the following options:
19
-
20
-
- Pass the path to the local OpenAPI YAML file.
21
-
22
-
```js
23
-
// docusaurus.config.js
24
-
25
-
module.exports= {
26
-
// ...
27
-
presets: [
28
-
// .. Your other presets' config
29
-
[
30
-
'redocusaurus',
31
-
{
32
-
// Plugin Options for loading OpenAPI files
33
-
specs: [
34
-
{
35
-
spec:'openapi/openapi.yaml',
36
-
route:'/api/',
37
-
},
38
-
],
39
-
// Theme Options for modifying how redoc renders them
40
-
theme: {
41
-
// Change with your site colors
42
-
primaryColor:'#1890ff',
43
-
},
20
+
1. Add it as a preset to your docusaurus config along with [@docusaurus/preset-classic](https://docusaurus.io/docs/using-plugins#docusauruspreset-classic) and pass options:
// Theme Options for modifying how redoc renders them
59
+
theme: {
60
+
// Change with your site colors
61
+
primaryColor:'#1890ff',
75
62
},
76
-
],
77
-
],
78
-
// ...
79
-
};
80
-
```
63
+
},
64
+
] satisfies Redocusaurus.PresetEntry,
65
+
],
66
+
// ... Rest of your config
67
+
};
68
+
69
+
exportdefaultconfig;
70
+
```
81
71
82
72
The API Doc will be available at the path specific by `route`. To skip adding a route altogether just don't set the `route` property.
83
73
You will still be able to reference schema elements manually using [Schema Imports](/docs/guides/schema-imports) or create Custom React Pages using the data and theme components.
0 commit comments