|
1 |
| -# [Redocusaurus](https://github.com/rohit-gohri/redocusaurus) |
| 1 | +# [Redocusaurus](https://redocusaurus.vercel.app/) |
2 | 2 |
|
3 | 3 | 
|
4 | 4 |
|
|
8 | 8 |
|
9 | 9 | 1. Install redocusaurus:
|
10 | 10 |
|
11 |
| - ```sh |
12 |
| - npm i --save redocusaurus |
13 |
| - ``` |
| 11 | + ```sh |
| 12 | + npm i --save redocusaurus |
| 13 | + # OR |
| 14 | + yarn add redocusaurus |
| 15 | + ``` |
14 | 16 |
|
15 | 17 | 1. Add it as a preset to your docusaurus config and pass options:
|
16 | 18 |
|
17 | 19 | - Pass it a path to a local OpenAPI YAML file
|
18 | 20 |
|
19 |
| - ```js |
20 |
| - // docusaurus.config.js |
21 |
| - |
22 |
| - module.exports = { |
23 |
| - // ... |
24 |
| - presets: [ |
25 |
| - [ |
26 |
| - 'redocusaurus', |
27 |
| - { |
28 |
| - specs: [ |
29 |
| - { |
30 |
| - spec: 'openapi.yaml', |
31 |
| - }, |
32 |
| - ], |
33 |
| - }, |
34 |
| - ], |
35 |
| - ], |
36 |
| - // ... |
37 |
| - }; |
38 |
| - ``` |
39 |
| - |
40 |
| - - Pass it a OpenAPI spec URL |
41 |
| - |
42 |
| - ```js |
43 |
| - // docusaurus.config.js |
44 |
| -
|
45 |
| - module.exports = { |
46 |
| - // ... |
47 |
| - presets: [ |
48 |
| - [ |
49 |
| - 'redocusaurus', |
50 |
| - { |
51 |
| - specs: [ |
52 |
| - { |
53 |
| - spec: 'https://redocly.github.io/redoc/openapi.yaml', |
54 |
| - }, |
55 |
| - ], |
56 |
| - }, |
57 |
| - ], |
58 |
| - ], |
59 |
| - // ... |
60 |
| - }; |
61 |
| - ``` |
62 |
| - |
63 |
| -The API Doc will be available by default at `/api/` path. To customize it see [full plugin options](../docusaurus-plugin-redoc/Readme.md). |
| 21 | + ```js |
| 22 | + // docusaurus.config.js |
| 23 | + |
| 24 | + module.exports = { |
| 25 | + // ... |
| 26 | + presets: [ |
| 27 | + [ |
| 28 | + 'redocusaurus', |
| 29 | + { |
| 30 | + // Plugin Options for loading OpenAPI files |
| 31 | + specs: [ |
| 32 | + { |
| 33 | + spec: 'openapi/openapi.yaml', |
| 34 | + route: '/api/', |
| 35 | + }, |
| 36 | + ], |
| 37 | + // Theme Options for modifying how redoc renders them |
| 38 | + theme: { |
| 39 | + // Change with your site colors |
| 40 | + primaryColor: '#1890ff', |
| 41 | + }, |
| 42 | + }, |
| 43 | + ], |
| 44 | + ], |
| 45 | + // ... |
| 46 | + }; |
| 47 | + ``` |
| 48 | + |
| 49 | +- OR Pass it a OpenAPI spec URL |
| 50 | + |
| 51 | + ```js |
| 52 | + // docusaurus.config.js |
| 53 | +
|
| 54 | + module.exports = { |
| 55 | + // ... |
| 56 | + presets: [ |
| 57 | + [ |
| 58 | + 'redocusaurus', |
| 59 | + { |
| 60 | + // Plugin Options for loading OpenAPI files |
| 61 | + specs: [ |
| 62 | + { |
| 63 | + spec: 'https://redocly.github.io/redoc/openapi.yaml', |
| 64 | + route: '/api/', |
| 65 | + }, |
| 66 | + ], |
| 67 | + // Theme Options for modifying how redoc renders them |
| 68 | + theme: { |
| 69 | + // Change with your site colors |
| 70 | + primaryColor: '#1890ff', |
| 71 | + }, |
| 72 | + }, |
| 73 | + ], |
| 74 | + ], |
| 75 | + // ... |
| 76 | + }; |
| 77 | + ``` |
| 78 | + |
| 79 | +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). |
64 | 80 |
|
65 | 81 | ### Options
|
66 | 82 |
|
67 | 83 | #### specs
|
68 | 84 |
|
69 |
| -Pass it an array of plugin options, see [docusaurus-plugin-redoc](../docusaurus-plugin-redoc/Readme.md) for individual option details. |
| 85 | +Pass it an array of plugin options, see [docusaurus-plugin-redoc](https://redocusaurus.vercel.app/docs/getting-started/plugin-options) for individual option details. |
70 | 86 |
|
71 | 87 | #### theme
|
72 | 88 |
|
73 |
| -Pass options to customize the theme, see [docusaurus-theme-redoc](../docusaurus-theme-redoc/Readme.md) for individual option details. |
| 89 | +Pass options to customize the theme, see [docusaurus-theme-redoc](https://redocusaurus.vercel.app/docs/getting-started/theme-options) for individual option details. |
74 | 90 |
|
75 | 91 | ## Docs
|
76 | 92 |
|
|
0 commit comments