-
-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathpage.tsx
More file actions
24 lines (22 loc) · 649 Bytes
/
page.tsx
File metadata and controls
24 lines (22 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Content from "./content.md"
import { RawCode, Pre, highlight } from "codehike/code"
import { AnnotationHandler } from "codehike/code"
export default function Page() {
return <Content components={{ Code }} />
}
export async function Code({ codeblock }: { codeblock: RawCode }) {
const highlighted = await highlight(codeblock, "github-dark")
return (
<Pre
className="m-0 bg-zinc-950"
code={highlighted}
handlers={[borderHandler]}
/>
)
}
const borderHandler: AnnotationHandler = {
name: "border",
Block: ({ annotation, children }) => (
<div style={{ border: "1px solid red" }}>{children}</div>
),
}