docs: 引入 Fumadocs

ci: set up github actions
This commit is contained in:
Palm Civet
2025-09-05 20:00:05 +08:00
parent f89a17f14d
commit 29232afadc
32 changed files with 1422 additions and 4 deletions

23
docs/lib/media-adapter.ts Normal file
View File

@@ -0,0 +1,23 @@
import type { MediaAdapter } from 'fumadocs-openapi';
export const OpenIsleMediaAdapter: MediaAdapter = {
encode(data) {
return JSON.stringify(data.body);
},
// returns code that inits a `body` variable, used for request body
generateExample(data, ctx) {
if (ctx.lang === 'js') {
return `const body = "hello world"`;
}
if (ctx.lang === 'python') {
return `body = "hello world"`;
}
if (ctx.lang === 'go' && 'addImport' in ctx) {
ctx.addImport('strings');
return `body := strings.NewReader("hello world")`;
}
},
};