Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

#openapi generated documents (should be re-generated each deployment)
docs/api
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
$ yarn
```

### Generating swagger pages

```
yarn docusaurus gen-api-docs all
```
The static pages are generated from the swagger.yaml file, update if necessary.

### Local Development

```
Expand Down
33 changes: 28 additions & 5 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const config = {
docs: {
sidebarPath: './sidebars.js',
routeBasePath: '/',

docItemComponent: '@theme/ApiItem', // Derived from docusaurus-theme-openapi
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
Expand Down Expand Up @@ -74,7 +74,25 @@ const config = {
}),
],
],

plugins: [
[
'docusaurus-plugin-openapi-docs',
{
id: 'api', // plugin id
docsPluginId: 'classic', // configured for preset-classic
config: {
api: {
specPath: './static/openapi/swagger.yaml', // Path to your OpenAPI spec
outputDir: 'docs/api', // Where to output generated docs
sidebarOptions: {
groupPathsBy: 'tag',
},
},
},
},
],
],
themes: ['docusaurus-theme-openapi-docs'], // Export theme components
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
Expand All @@ -93,7 +111,7 @@ const config = {
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
position: 'left',
label: 'Docs',
},
{
Expand All @@ -108,6 +126,11 @@ const config = {
label: 'GitHub',
position: 'right',
},
{
to: '/api-client',
label: 'API Client',
position: 'left',
},
],
},
footer: {
Expand Down Expand Up @@ -171,7 +194,7 @@ const config = {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};
})
};

export default config;
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.7.0",
"@docusaurus/preset-classic": "3.7.0",
"@docusaurus/core": "^3.9.2",
"@docusaurus/plugin-content-docs": "^3.9.2",
"@docusaurus/preset-classic": "^3.9.2",
"@docusaurus/utils": "^3.9.2",
"@docusaurus/utils-validation": "^3.9.2",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-plugin-openapi-docs": "^4.3.3",
"docusaurus-plugin-openapi-docs": "4.7.1",
"docusaurus-theme-openapi-docs": "4.7.1",
"prism-react-renderer": "^2.3.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.7.0",
"@docusaurus/types": "3.7.0"
"@docusaurus/module-type-aliases": "^3.9.2",
"@docusaurus/types": "^3.9.2"
},
"browserslist": {
"production": [
Expand Down
53 changes: 25 additions & 28 deletions sidebars.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
// @ts-check
// sidebars.js
import apiSidebarItems from './docs/api/sidebar'; // generated by openapi plugin

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation

The sidebars can be generated from the filesystem, or explicitly defined here.

Create as many sidebars as you want.

@type {import('@docusaurus/plugin-content-docs').SidebarsConfig}
*/
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
export default {
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
label: 'Getting started',
items: [{ type: 'autogenerated', dirName: 'getting-started' }],
},
{
type: 'category',
label: 'Advanced settings',
items: [{ type: 'autogenerated', dirName: 'advance-settings' }],
},
{
type: 'category',
label: 'Notifications',
items: [{ type: 'autogenerated', dirName: 'notifications' }],
},

// API: use the generated grouped items (tagGroups)
{
type: 'category',
label: 'API',
collapsible: true,
collapsed: true,
items: apiSidebarItems,
},
],
*/
};

export default sidebars;
Loading