Documentation Sites
Starlight
Section titled “Starlight”@rapidoc/starlight adds an API reference page per OpenAPI document to a Starlight site. The page uses Starlight’s layout and themes, and the API’s operations appear in Starlight’s sidebar.
npm install @rapidoc/starlightimport { defineConfig } from 'astro/config';import starlight from '@astrojs/starlight';import starlightRapidoc from '@rapidoc/starlight';
export default defineConfig({ integrations: [ starlight({ title: 'My docs', plugins: [starlightRapidoc({ uiPath: '/api', spec: './openapi.yaml' })], }), ],});spec is a file, a URL or an object, read when the site is built. For several APIs pass { apis: [...] }.
VitePress
Section titled “VitePress”VitePress has no plugin system, so there are two steps: wrap the config, and put the component on a page.
import { defineConfig } from 'vitepress';import { withRapidoc, rapidocSidebar } from '@rapidoc/vitepress';
export default withRapidoc( defineConfig({ themeConfig: { sidebar: [{ text: 'Pets API', items: await rapidocSidebar({ spec: './openapi.yaml', uiPath: '/api' }) }], }, }), { apis: { pets: './openapi.yaml' } },);---layout: page---
<script setup>import { RapidocReference } from '@rapidoc/vitepress/client';</script>
<RapidocReference api="pets" />Docusaurus
Section titled “Docusaurus”Three steps: the plugin, a doc page, and the sidebar.
export default { plugins: [['@rapidoc/docusaurus', { apis: { pets: './openapi.yaml' } }]],};---hide_table_of_contents: true---
import RapidocReference from '@rapidoc/docusaurus/client';
<RapidocReference api="pets" />import { rapidocSidebarSync } from '@rapidoc/docusaurus';
export default { docs: [ { type: 'category', label: 'Pets API', items: rapidocSidebarSync({ spec: './openapi.yaml', uiPath: '/docs/api', docId: 'api' }), }, ],};For another framework or site generator, see Build an Integration.