Files
joelhooks__joelclaw/apps/web/lib/mdx-plugins.ts
Joel Hooks 4b1e5fc527 feat: shiki code blocks with Dank Mono + Catppuccin Macchiato
- Dank Mono woff2 (Regular, Italic, Bold) loaded as --font-dank-mono
- rehype-pretty-code theme switched to catppuccin-macchiato
- Code blocks: Dank Mono with ligatures, rounded borders, relaxed leading
- Inline code: hot pink text on subtle dark bg
- --font-code CSS variable with Dank Mono → Geist Mono fallback
2026-02-15 10:46:56 -08:00

33 lines
1.2 KiB
TypeScript

import remarkGfm from "remark-gfm";
import remarkSmartypants from "remark-smartypants";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeExternalLinks from "rehype-external-links";
import rehypeUnwrapImages from "rehype-unwrap-images";
import type { Options as PrettyCodeOptions } from "rehype-pretty-code";
const prettyCodeOptions: PrettyCodeOptions = {
theme: {
dark: "catppuccin-macchiato",
light: "catppuccin-macchiato",
},
keepBackground: true,
defaultLang: {
block: "text",
},
};
export const remarkPlugins: any[] = [
remarkGfm, // tables, strikethrough, autolinks, task lists
remarkSmartypants, // smart quotes, em dashes, ellipses
];
export const rehypePlugins: any[] = [
rehypeSlug, // id attributes on headings
[rehypeAutolinkHeadings, { behavior: "wrap" }], // clickable heading links
[rehypePrettyCode, prettyCodeOptions], // shiki syntax highlighting
[rehypeExternalLinks, { target: "_blank", rel: ["noopener", "noreferrer"] }], // external link handling
rehypeUnwrapImages, // remove <p> wrapper around images
];