( file: MDFile, options: CompileOptions, render: (Content: MDXContent) => any = defaultRender, )
| 63 | } |
| 64 | |
| 65 | export async function renderHTML( |
| 66 | file: MDFile, |
| 67 | options: CompileOptions, |
| 68 | render: (Content: MDXContent) => any = defaultRender, |
| 69 | ) { |
| 70 | const result = await compile(file, { |
| 71 | ...options, |
| 72 | outputFormat: "function-body", |
| 73 | }) |
| 74 | const { default: Content } = await run( |
| 75 | result, |
| 76 | (options.development ? devRuntime : runtime) as any, |
| 77 | ) |
| 78 | |
| 79 | const html = await rscToHTML(render(Content)) |
| 80 | return html |
| 81 | } |
| 82 | |
| 83 | function defaultRender(Content: MDXContent) { |
| 84 | // @ts-ignore |
searching dependent graphs…