Skip to content

Commit

Permalink
chore: update dependencies and integrate rehype-pretty-code
Browse files Browse the repository at this point in the history
- Removed @shikijs/rehype dependency from package.json and pnpm-lock.yaml.
- Added rehype-pretty-code as a new dependency for enhanced code formatting.
- Updated Markdown component to utilize rehype-pretty-code for rendering code blocks with a specified theme.
- Cleaned up package management files to reflect the changes in dependencies.
  • Loading branch information
altaywtf committed Dec 6, 2024
1 parent aa1d6b0 commit 42f8ec5
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"knip": "knip"
},
"dependencies": {
"@shikijs/rehype": "^1.24.0",
"@vercel/analytics": "^1.4.1",
"@vercel/speed-insights": "^1.1.0",
"date-fns": "^4.1.0",
Expand All @@ -26,6 +25,7 @@
"query-string": "^9.1.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rehype-pretty-code": "^0.14.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0"
},
Expand Down
118 changes: 103 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/components/md.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import rehypeShiki from "@shikijs/rehype";
import { MDXRemote } from "next-mdx-remote/rsc";
import Link from "next/link";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";

Expand Down Expand Up @@ -30,7 +30,10 @@ export function Markdown({ children }: { children: string }) {
}}
options={{
mdxOptions: {
rehypePlugins: [rehypeSlug, [rehypeShiki, { theme: "dark-plus" }]],
rehypePlugins: [
rehypeSlug,
[rehypePrettyCode, { theme: "dark-plus" }],
],
remarkPlugins: [remarkGfm],
},
}}
Expand Down

0 comments on commit 42f8ec5

Please sign in to comment.