mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 06:31:49 +00:00
OpenAPI: Improve UI
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': minor
|
||||
---
|
||||
|
||||
Improve generated sample requests
|
||||
@@ -13,16 +13,6 @@ void OpenAPI.generateFiles({
|
||||
input: ['./*.yaml'],
|
||||
output: './content/docs/ui',
|
||||
per: 'operation',
|
||||
renderer: {
|
||||
Root(props, child) {
|
||||
return OpenAPI.createElement(
|
||||
'Root',
|
||||
props,
|
||||
'<div className="bg-fd-secondary p-4 rounded-lg">Demo Only</div>',
|
||||
...child,
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const demoRegex = /^---type-table-demo---\r?\n(?<content>.+)\r?\n---end---$/gm;
|
||||
|
||||
@@ -85,10 +85,10 @@ export function APIInfo({
|
||||
...props
|
||||
}: APIInfoProps): React.ReactElement {
|
||||
return (
|
||||
<div className={cn('min-w-0 flex-1 prose-no-margin', className)} {...props}>
|
||||
<div className={cn('min-w-0 flex-1', className)} {...props}>
|
||||
<div
|
||||
className={cn(
|
||||
'sticky top-24 z-[2] flex flex-row items-center gap-2 rounded-lg border bg-fd-card p-3 md:top-10',
|
||||
'sticky top-24 z-[2] mb-4 flex flex-row items-center gap-2 rounded-lg border bg-fd-card p-3 md:top-10',
|
||||
)}
|
||||
>
|
||||
<span
|
||||
@@ -104,7 +104,7 @@ export function APIInfo({
|
||||
<CopyRouteButton className="ms-auto size-6 p-1" route={route} />
|
||||
</div>
|
||||
|
||||
{children}
|
||||
<div className="prose-no-margin">{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user