({ filePath, metadata, example })
| 9 | metadata: string |
| 10 | example: string |
| 11 | }> = async ({ filePath, metadata, example }) => { |
| 12 | const pageContent = await fs.readFile( |
| 13 | `../examples/${example}/${filePath}`, |
| 14 | 'utf8' |
| 15 | ) |
| 16 | const ext = path.extname(filePath).slice(1) |
| 17 | |
| 18 | const rawJs = await compileMdx( |
| 19 | `~~~${ext} filename="${filePath}" showLineNumbers ${metadata} |
| 20 | ${pageContent.trim()} |
| 21 | ~~~`, |
| 22 | { defaultShowCopyCode: true } |
| 23 | ) |
| 24 | return <MDXRemote compiledSource={rawJs} /> |
| 25 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…