mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
29 lines
768 B
TypeScript
29 lines
768 B
TypeScript
import { RenderContext } from '@/types';
|
|
import { processDocument } from '@/utils/document/process';
|
|
import { defaultShikiFactory } from 'fumadocs-core/highlight/shiki/full';
|
|
import * as ClientBoundary from '@/ui/client/boundary.lazy';
|
|
|
|
export async function renderContextFrom(input: string): Promise<RenderContext> {
|
|
const schema = await processDocument(input);
|
|
|
|
return {
|
|
mediaAdapters: {},
|
|
generateTypeScriptDefinitions() {
|
|
return '';
|
|
},
|
|
shiki: defaultShikiFactory,
|
|
shikiOptions: { theme: 'github-light' },
|
|
renderCodeBlock(_lang, code) {
|
|
return code;
|
|
},
|
|
renderHeading(_depth, text) {
|
|
return text;
|
|
},
|
|
clientBoundary: ClientBoundary,
|
|
renderMarkdown(text) {
|
|
return text;
|
|
},
|
|
schema,
|
|
};
|
|
}
|