Skip to content

Commit 7aecafe

Browse files
feat: integrate Redocusaurus for interactive OFREP OpenAPI docs page
Signed-off-by: Jonathan Norris <[email protected]>
1 parent 7bdf1c6 commit 7aecafe

File tree

4 files changed

+682
-13
lines changed

4 files changed

+682
-13
lines changed

docusaurus.config.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = {
172172
},
173173
prism: {
174174
theme: themes.oceanicNext,
175-
additionalLanguages: ['java', 'csharp', 'powershell', 'php', 'kotlin', 'ruby', 'dart'],
175+
additionalLanguages: ['java', 'csharp', 'powershell', 'php', 'kotlin', 'ruby', 'dart', 'scala'],
176176
magicComments: [
177177
{
178178
className: 'theme-code-block-highlighted-line',
@@ -284,7 +284,31 @@ const config: Config = {
284284
},
285285
},
286286
],
287-
presets: [['classic', presetClassicOptions]],
287+
presets: [
288+
['classic', presetClassicOptions],
289+
[
290+
'redocusaurus',
291+
{
292+
specs: [
293+
{
294+
id: 'ofrep-api',
295+
spec: 'https://raw.githubusercontent.com/open-feature/protocol/refs/heads/main/service/openapi.yaml',
296+
},
297+
],
298+
theme: {
299+
primaryColor: '#1890ff',
300+
options: {
301+
disableSearch: true,
302+
theme: {
303+
sidebar: {
304+
width: '0px',
305+
},
306+
},
307+
},
308+
},
309+
},
310+
],
311+
],
288312
plugins: [
289313
async function tailwind() {
290314
return {
@@ -377,7 +401,7 @@ const config: Config = {
377401
markdown: {
378402
mermaid: true,
379403
},
380-
themes: ['@docusaurus/theme-mermaid'],
404+
themes: ['@docusaurus/theme-mermaid', 'docusaurus-theme-redoc'],
381405
};
382406

383407
export default config;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"react-instantsearch": "^7.15.8",
5858
"react-lite-youtube-embed": "^2.5.1",
5959
"react-transition-group": "^4.4.5",
60+
"redocusaurus": "^2.5.0",
6061
"rehype-github-alerts": "^4.1.1",
6162
"remark-gfm": "^4.0.1",
6263
"remarkable": "2.0.1",
@@ -72,8 +73,8 @@
7273
"@docusaurus/tsconfig": "^3.9.1",
7374
"@types/fs-extra": "11.0.4",
7475
"@types/react": "^19.1.6",
75-
"@typescript-eslint/parser": "8.35.1",
7676
"@typescript-eslint/eslint-plugin": "8.35.1",
77+
"@typescript-eslint/parser": "8.35.1",
7778
"eslint": "^8.57.0",
7879
"eslint-config-prettier": "10.1.5",
7980
"eslint-mdx": "3.6.0",

src/css/custom.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,52 @@ details[open] .mcp-install-summary strong::before {
333333
[data-theme='dark'] .mcp-install-button:hover {
334334
background-color: var(--ifm-color-primary-light);
335335
border-color: var(--ifm-color-primary-light);
336+
color: #fff;
337+
text-decoration: none;
338+
}
339+
340+
/* Full width Redoc API viewer */
341+
.redocusaurus {
342+
max-width: none !important;
343+
width: 100% !important;
344+
}
345+
346+
.redocusaurus .api-content {
347+
max-width: none !important;
348+
}
349+
350+
.redoc-wrap {
351+
max-width: none !important;
352+
}
353+
354+
/* Expand main container for Redoc pages */
355+
article:has(.redocusaurus) {
356+
max-width: none !important;
357+
}
358+
359+
.docMainContainer_TBSr:has(.redocusaurus) {
360+
max-width: 100% !important;
361+
}
362+
363+
.container:has(.redocusaurus) {
364+
max-width: 100% !important;
365+
}
366+
367+
.docItemContainer_Djhp:has(.redocusaurus) {
368+
max-width: none !important;
369+
width: 100%;
370+
}
371+
372+
.docItemCol_VOVn:has(.redocusaurus) {
373+
max-width: none !important;
374+
flex-basis: 100% !important;
375+
}
376+
377+
/* Hide Redocly branding footer */
378+
.redocusaurus a[href*="redocly.com"] {
379+
display: none !important;
380+
}
381+
382+
.redocusaurus [class*="powered-by"] {
383+
display: none !important;
336384
}

0 commit comments

Comments
 (0)