Diff
Highlight diffs
Install
$ pnpm dlx shadcn@latest add https://docskit.codehike.org/r/diff
Add the diff
handler:
@/components/code.handlers.tsx
+import { diff } from "./diff"export function getHandlers(options: CodeGroup["options"]) {return [line,+diff,]}
ExampleTry it in the Playground
content.mdx
```jsfunction lorem(ipsum) {// !diff -return ipsum// !diff(1:3) +return {dolor: ipsum,}}```
preview
function lorem(ipsum) {-return ipsum+return {+dolor: ipsum,+}}