MCPcopy Create free account
hub / github.com/shuding/nextra / ExampleCode

Function ExampleCode

docs/components/example-code.tsx:11–25  ·  view source on GitHub ↗
({ filePath, metadata, example })

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 1

compileMdxFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…