redocusaurus

Redoc for DocusaurusV2

Usage no npm install needed!

<script type="module">
  import redocusaurus from 'https://cdn.skypack.dev/redocusaurus';
</script>

README

Redocusaurus

npm

Redoc for Docusaurus v2.

Usage

  1. Install redocusaurus:

    npm i --save redocusaurus
    
  2. Add it as a preset to your docusaurus config and pass options:

    • Pass it a OpenAPI spec URL

      // docusaurus.config.js
      
      module.exports = {
        // ...
        presets: [
          [
            'redocusaurus',
            {
              specs: [{
                specUrl: 'https://redocly.github.io/redoc/openapi.yaml',
              }],
            }
          ],
        ],
        // ...
      }
      
  • Pass it a OpenAPI spec local path

     ```js
     // docusaurus.config.js
    
     module.exports = {
       // ...
       presets: [
         [
           'redocusaurus',
           {
             specs: [{
               spec: 'openapi.yaml',
             }],
           }
         ],
       ],
       // ...
     }
     ```
    

The API Doc will be available by default at /api/ path. 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://rohit-gohri.github.io/redocusaurus/docs