Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/openapi #95

Closed
wants to merge 4 commits into from
Closed
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
30 changes: 24 additions & 6 deletions apps/developer/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type * as Redocusaurus from 'redocusaurus';

const config: Config = {
title: 'Monerium',
Expand Down Expand Up @@ -61,6 +62,28 @@ const config: Config = {
},
} satisfies Preset.Options,
],
[
'redocusaurus',
{
// Plugin Options for loading OpenAPI files
// https://redocusaurus.vercel.app/docs/getting-started/plugin-options
specs: [
// How to use a local instance of OpenAPI spec
// {
// id: 'openapi',
// spec: './src/openapi-v2.yaml',
// route: '/docs/openapi/',
// },

// Let's use the remote instance for now.
{
id: 'api',
spec: 'https://monerium.dev/openapi-v2.yml',
route: '/docs/api/',
},
],
},
] satisfies Redocusaurus.PresetEntry,
],

themeConfig: {
Expand All @@ -73,13 +96,8 @@ const config: Config = {
src: 'img/logo.png',
},
items: [
// {
// type: 'docSidebar',
// sidebarId: 'tutorialSidebar',
// position: 'left',
// label: 'Tutorial',
// },
{ to: '/docs', label: 'Docs', position: 'left' },
{ to: '/docs/api', label: 'API', position: 'left' },
{
href: 'https://github.com/monerium/js-monorepo',
label: 'GitHub',
Expand Down
1 change: 1 addition & 0 deletions apps/developer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@docusaurus/tsconfig": "3.4.0",
"@docusaurus/types": "3.4.0",
"docusaurus-plugin-typedoc": "^1.0.4",
"redocusaurus": "^2.1.1",
"typescript": "~5.2.2"
},
"browserslist": {
Expand Down
36 changes: 36 additions & 0 deletions apps/developer/redocly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
extends:
- recommended
rules:
no-unused-components: error
theme:
openapi:
expandResponses: 200,201,202
theme:
colors:
primary:
main: "#2c6ca7"
light: "#769fc4"
success:
main: "#6ac07a"
light: "#81ec9a"
dark: "#083312"
contrastText: "#000"
error:
main: "#f1706c"
http:
get: "#6ac072"
post: "#2383c5"
rightPanel:
backgroundColor: "#303846"
typography:
fontSize: 14px
fontFamily: Roboto, sans-serif
optimizeSpeed: true
smoothing: antialiased
headings:
fontWeight: bold
lineHeight: 1em
links:
color: "#2c6ca7"
visited: "#2c6ca7"
hover: "#91538a"
39 changes: 29 additions & 10 deletions apps/developer/sidebars.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';

/**
* Creating a sidebar enables you to:
Expand All @@ -12,20 +12,39 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
*/
const sidebars: SidebarsConfig = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
// { type: 'autogenerated', dirName: '.' },
{
id: 'index',
type: 'doc',
label: 'Welcome',
// items: ['index'],
},
{
type: 'link',
label: 'API Documentation',
href: '/docs/api',
},
// {
// type: 'autogenerated',
// dirName: 'packages',
// }
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
label: 'Packages',
items: [
{ type: 'doc', id: 'packages/SDK/index' },
{ type: 'doc', id: 'packages/SDK React Provider/index' },
],
},
],
*/
// customSidebar: [
// {
// type: 'link',
// label: 'Welcome',
// href: '/docs/openapi',
// },
// ],
};

export default sidebars;
1 change: 1 addition & 0 deletions apps/developer/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
--ifm-pre-background: none;
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
Expand Down
Loading
Loading