
Redoc for Docusaurus.
Usage
yarn add redocusaurus
pnpm add redocusaurus
npm i --save redocusaurus
-
Add it as a preset to your docusaurus config along with @docusaurus/preset-classic and pass options:
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type * as Redocusaurus from 'redocusaurus';
const config: Config = {
presets: [
[
'@docusaurus/preset-classic',
{
googleAnalytics: {
trackingID: 'XXXXXX',
},
} satisfies Preset.Options,
]
[
'redocusaurus',
{
specs: [
{
spec: 'openapi/index.yaml',
route: '/api/',
},
{
spec: 'https://redocly.github.io/redoc/openapi.yaml',
route: '/openapi/',
},
],
theme: {
primaryColor: '#1890ff',
},
},
] satisfies Redocusaurus.PresetEntry,
],
};
export default config;
The API Doc will be available at the route specified (/api/
in the example above). To customize it see full plugin options.
Options
specs
Pass it an array of plugin options, see docusaurus-plugin-redoc for individual option details.
theme
Pass options to customize the theme, see docusaurus-theme-redoc for individual option details.
Docs
See: https://redocusaurus.vercel.app/docs