Skip to content

The only tool you need to know what is happening and how to fix it.

feat: code on the blog page (#185)

narrow-adventureb8291b442c56
diff --git a/website/app/blog/[slug]/page.tsx b/website/app/blog/[slug]/page.tsx
index e0ac0295..92a96128 100644
--- a/website/app/blog/[slug]/page.tsx
+++ b/website/app/blog/[slug]/page.tsx
@@ -3,14 +3,24 @@ import { notFound } from "next/navigation";
import type { Metadata } from "next";
import { MDXRemote } from "next-mdx-remote/rsc";
import remarkGfm from "remark-gfm";
+import rehypePrettyCode, {
+ type Options as RehypePrettyCodeOptions,
+} from "rehype-pretty-code";
import { ArrowLeft } from "lucide-react";
import { Eyebrow } from "@/components/eyebrow";
import { BlogByline } from "@/components/blog-byline";
import { BlogSubscribe } from "@/components/blog-subscribe";
import { getAllPosts, getPostBySlug } from "@/lib/blog";
+import { tracewayShiki } from "@/lib/shiki-theme";
type Params = { slug: string };
+const prettyCodeOptions: RehypePrettyCodeOptions = {
+ theme: tracewayShiki,
+ keepBackground: false,
+ defaultLang: "plaintext",
+};
+
// Note: "engineering" is reserved by the static /blog/engineering route, so no
// post may be named engineering.mdx; the static segment would shadow it here.
export function generateStaticParams(): Params[] {
@@ -77,7 +87,12 @@ export default async function BlogPostPage({
<div className="blog-body">
<MDXRemote
source={post.content}
- options={{ mdxOptions: { remarkPlugins: [remarkGfm] } }}
+ options={{
+ mdxOptions: {
+ remarkPlugins: [remarkGfm],
+ rehypePlugins: [[rehypePrettyCode, prettyCodeOptions]],
+ },
+ }}
/>
</div>
</div>
diff --git a/website/app/globals.css b/website/app/globals.css
index a842896b..fd3bf1f0 100644
--- a/website/app/globals.css
+++ b/website/app/globals.css
@@ -240,14 +240,13 @@
color: inherit;
cursor: pointer;
}
- code {
+ :not(pre) > code {
font-family: var(--font-mono);
font-size: 0.92em;
- background: color-mix(in oklab, var(--a2) 10%, transparent);
- color: var(--a2);
+ background: color-mix(in oklab, var(--a2) 8%, transparent);
+ color: color-mix(in oklab, var(--a2) 60%, var(--fg-1));
padding: 2px 6px;
border-radius: 4px;
- border: 1px solid color-mix(in oklab, var(--a2) 20%, transparent);
}
}
@@ -1068,6 +1067,99 @@
font-family: var(--font-mono);
}
+ .blog-body figure[data-rehype-pretty-code-figure] {
+ margin: 32px 0;
+ }
+ .blog-body pre {
+ background: var(--ink-0);
+ border: 1px solid var(--hair);
+ border-radius: var(--radius-lg);
+ padding: 16px 18px;
+ margin: 32px 0;
+ overflow-x: auto;
+ font-family: var(--font-mono);
+ font-size: 13.5px;
+ line-height: 1.7;
+ tab-size: 2;
+ }
+ .blog-body figure[data-rehype-pretty-code-figure] > pre {
+ margin: 0;
+ }
+ .blog-body pre code {
+ display: block;
+ font-family: inherit;
+ font-size: inherit;
+ background: none;
+ border: 0;
+ padding: 0;
+ color: inherit;
+ }
+ .blog-body pre [data-line] {
+ display: block;
+ }
+ .blog-body figcaption[data-rehype-pretty-code-title] {
+ font-family: var(--font-mono);
+ font-size: 12.5px;
+ color: var(--fg-2);
+ background: var(--ink-2);
+ border: 1px solid var(--hair);
+ border-bottom: 0;
+ border-radius: var(--radius-lg) var(--radius-lg) 0 0;
+ padding: 8px 18px;
+ }
+ .blog-body figcaption[data-rehype-pretty-code-title] + pre {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ }
+
+ .blog-body table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 32px 0;
+ font-family: var(--font-body);
+ font-size: 15px;
+ line-height: 1.6;
+ }
+ .blog-body th {
+ font-family: var(--font-mono);
+ font-size: 12.5px;
+ font-weight: 500;
+ color: var(--fg-2);
+ text-align: left;
+ white-space: nowrap;
+ padding: 10px 18px 10px 0;
+ border-bottom: 1px solid var(--hair-2);
+ }
+ .blog-body td {
+ padding: 10px 18px 10px 0;
+ color: var(--fg-1);
+ vertical-align: top;
+ border-bottom: 1px solid var(--hair);
+ }
+ .blog-body th:last-child,
+ .blog-body td:last-child {
+ padding-right: 0;
+ }
+ @media (max-width: 720px) {
+ .blog-body table {
+ display: block;
+ overflow-x: auto;
+ }
+ }
+
+ .blog-body hr {
+ border: 0;
+ border-top: 1px solid var(--hair-2);
+ margin: 48px 0 40px;
+ }
+ .blog-body hr + h2 {
+ margin-top: 40px;
+ }
+ .blog-body hr + p {
+ color: var(--fg-2);
+ font-size: 15.5px;
+ }
+
/* Highlight a key phrase. Use sparingly (raw <mark> in MDX). */
.blog-body mark {
background: color-mix(in oklab, var(--a1) 24%, transparent);
diff --git a/website/content/blog/deep-dive-into-the-sourcemaps.mdx b/website/content/blog/deep-dive-into-the-sourcemaps.mdx
index eccf51ab..ae220f6c 100644
--- a/website/content/blog/deep-dive-into-the-sourcemaps.mdx
+++ b/website/content/blog/deep-dive-into-the-sourcemaps.mdx
@@ -19,9 +19,7 @@ Everything below is real output. I generated every table and trace by running th
The smallest program I could write that throws across more than one stack frame is two files.
-`src/user.ts`:
-
-```ts
+```ts title="src/user.ts"
export interface User {
name: string;
}
@@ -35,9 +33,7 @@ export function validateUser(user: User): User {
}
```
-`src/index.ts`:
-
-```ts
+```ts title="src/index.ts"
import { validateUser, type User } from "./user";
function handleSignup(form: User): User {
diff --git a/website/lib/shiki-theme.ts b/website/lib/shiki-theme.ts
new file mode 100644
index 00000000..8bc8ab0c
--- /dev/null
+++ b/website/lib/shiki-theme.ts
@@ -0,0 +1,133 @@
+import type { RawThemeSetting, ThemeRegistrationRaw } from "shiki";
+
+const tokenColors: RawThemeSetting[] = [
+ {
+ settings: { foreground: "#c9d0dd", background: "#00000000" },
+ },
+ {
+ scope: ["comment", "punctuation.definition.comment", "string.comment"],
+ settings: { foreground: "#5a6374", fontStyle: "italic" },
+ },
+ {
+ scope: [
+ "keyword",
+ "storage.type",
+ "storage.modifier",
+ "keyword.control",
+ "keyword.operator.new",
+ "keyword.operator.expression",
+ ],
+ settings: { foreground: "#7c5cff" },
+ },
+ {
+ scope: [
+ "keyword.operator",
+ "punctuation.separator",
+ "punctuation.terminator",
+ "punctuation.accessor",
+ "meta.brace",
+ "punctuation.definition.parameters",
+ ],
+ settings: { foreground: "#8a93a6" },
+ },
+ {
+ scope: [
+ "string",
+ "string.quoted",
+ "string.template",
+ "punctuation.definition.string",
+ ],
+ settings: { foreground: "#22e0a8" },
+ },
+ {
+ scope: [
+ "constant.numeric",
+ "constant.language",
+ "constant.character",
+ "constant.other",
+ "support.constant",
+ ],
+ settings: { foreground: "#ffd166" },
+ },
+ {
+ scope: [
+ "entity.name.function",
+ "support.function",
+ "meta.function-call.generic",
+ "variable.function",
+ ],
+ settings: { foreground: "#00d4ff" },
+ },
+ {
+ scope: [
+ "entity.name.type",
+ "entity.name.class",
+ "support.type",
+ "support.class",
+ "entity.other.inherited-class",
+ "storage.type.class",
+ ],
+ settings: { foreground: "#00d4ff" },
+ },
+ {
+ scope: [
+ "variable",
+ "variable.other",
+ "variable.parameter",
+ "meta.definition.variable",
+ ],
+ settings: { foreground: "#c9d0dd" },
+ },
+ {
+ scope: [
+ "variable.other.property",
+ "meta.object-literal.key",
+ "support.type.property-name",
+ ],
+ settings: { foreground: "#c9d0dd" },
+ },
+ {
+ scope: ["support.type.property-name.json"],
+ settings: { foreground: "#00d4ff" },
+ },
+ {
+ scope: ["meta.tag", "entity.name.tag", "punctuation.definition.tag"],
+ settings: { foreground: "#7c5cff" },
+ },
+ {
+ scope: ["entity.other.attribute-name", "entity.name.label"],
+ settings: { foreground: "#ffd166" },
+ },
+ {
+ scope: ["invalid", "invalid.illegal", "message.error"],
+ settings: { foreground: "#ff5a5f" },
+ },
+ {
+ scope: [
+ "keyword.other.import",
+ "keyword.control.import",
+ "keyword.control.export",
+ "keyword.control.flow",
+ ],
+ settings: { foreground: "#7c5cff" },
+ },
+ {
+ scope: [
+ "entity.name.namespace",
+ "entity.name.type.class.dart",
+ "storage.type.annotation.dart",
+ ],
+ settings: { foreground: "#00d4ff" },
+ },
+];
+
+export const tracewayShiki: ThemeRegistrationRaw = {
+ name: "traceway-dark",
+ type: "dark",
+ colors: {
+ "editor.background": "#00000000",
+ "editor.foreground": "#c9d0dd",
+ },
+ settings: tokenColors,
+ tokenColors,
+};
diff --git a/website/package-lock.json b/website/package-lock.json
index ab929b25..346f921d 100644
--- a/website/package-lock.json
+++ b/website/package-lock.json
@@ -23,9 +23,11 @@
"next-sitemap": "^4.2.3",
"react": "19.2.3",
"react-dom": "19.2.3",
+ "rehype-pretty-code": "^0.14.3",
"remark-gfm": "^4.0.1",
"rrweb": "^2.0.0-alpha.4",
"rrweb-player": "^1.0.0-alpha.4",
+ "shiki": "^4.2.0",
"tailwind-merge": "^3.4.0"
},
"devDependencies": {
@@ -2125,6 +2127,106 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@shikijs/core": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.2.0.tgz",
+ "integrity": "sha512-Hc87Ab1Ld/vEbZRCbwx344I5v+4RU8CVToUTRkqXL1+TjbuOp9U5Xa0M23V4GEWHxVn+yO5otb+HkQVm3ptWQQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/primitive": "4.2.0",
+ "@shikijs/types": "4.2.0",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.4",
+ "hast-util-to-html": "^9.0.5"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/engine-javascript": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.2.0.tgz",
+ "integrity": "sha512-fjETeq1k5ffyXqRgS6+3hpvqseLalp1kjNfRbXpUgWR8FpZ1CmQfiNHovc5lncYjt/Vg5JK/WJEmLahjwMa0og==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.2.0",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "oniguruma-to-es": "^4.3.6"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/engine-oniguruma": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.2.0.tgz",
+ "integrity": "sha512-hTorK1dffPkpbMUk6Z+828PgRo7d07HbnizoP0hNPFjhxMHctj0Px/qoHeGMYafc6ju+u9iMldN4JbVzNQM++g==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.2.0",
+ "@shikijs/vscode-textmate": "^10.0.2"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/langs": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.2.0.tgz",
+ "integrity": "sha512-bwrVRlJ0wUhZxAbVdvBbv2TTC9yLsh4C/IO5Ofz0T8MQntgDvyVnkbjw9vi50r1kx7RCIJdnJnjZAwmAsXFLZQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.2.0"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/primitive": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.2.0.tgz",
+ "integrity": "sha512-NOq+DtUkVBJtZMVXL5A0vI0Xk8nvDYaXetFHSJFlOqjDZIVhIPRYFdGkSoElDqNuegikcc3A76SNUa8dTqtAYA==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.2.0",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.4"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/themes": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.2.0.tgz",
+ "integrity": "sha512-RX8IHYeLv8Cu2W6ruc3RxUqWn0IYCqSrMBzi/uRGAmfyDNOnNO5BF/Px7o97n4XTpmFTo5GbRaazuOWj+2ak2w==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.2.0"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/types": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.2.0.tgz",
+ "integrity": "sha512-VT/MKtlpOhEPZloSH3Pb9WCZEBDoQVMa9jedp5UAwmJOar1DVc9DRODAxmYPW9M93IK4ryuqRejFfmlvlVDemw==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.4"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/vscode-textmate": {
+ "version": "10.0.2",
+ "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz",
+ "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==",
+ "license": "MIT"
+ },
"node_modules/@swc/helpers": {
"version": "0.5.15",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
@@ -4015,6 +4117,18 @@
"node": ">=10.13.0"
}
},
+ "node_modules/entities": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
"node_modules/es-abstract": {
"version": "1.24.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz",
@@ -5276,6 +5390,57 @@
"node": ">= 0.4"
}
},
+ "node_modules/hast-util-from-html": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz",
+ "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "devlop": "^1.1.0",
+ "hast-util-from-parse5": "^8.0.0",
+ "parse5": "^7.0.0",
+ "vfile": "^6.0.0",
+ "vfile-message": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-from-parse5": {
+ "version": "8.0.3",
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz",
+ "integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "@types/unist": "^3.0.0",
+ "devlop": "^1.0.0",
+ "hastscript": "^9.0.0",
+ "property-information": "^7.0.0",
+ "vfile": "^6.0.0",
+ "vfile-location": "^5.0.0",
+ "web-namespaces": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-parse-selector": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
+ "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hast-util-to-estree": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz",
@@ -5304,6 +5469,29 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/hast-util-to-html": {
+ "version": "9.0.5",
+ "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz",
+ "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "@types/unist": "^3.0.0",
+ "ccount": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-whitespace": "^3.0.0",
+ "html-void-elements": "^3.0.0",
+ "mdast-util-to-hast": "^13.0.0",
+ "property-information": "^7.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "stringify-entities": "^4.0.0",
+ "zwitch": "^2.0.4"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hast-util-to-jsx-runtime": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz",
@@ -5331,6 +5519,19 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/hast-util-to-string": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz",
+ "integrity": "sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hast-util-whitespace": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
@@ -5344,6 +5545,23 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/hastscript": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz",
+ "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-parse-selector": "^4.0.0",
+ "property-information": "^7.0.0",
+ "space-separated-tokens": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hermes-estree": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz",
@@ -5361,6 +5579,16 @@
"hermes-estree": "0.25.1"
}
},
+ "node_modules/html-void-elements": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
+ "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/ignore": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
@@ -7820,6 +8048,23 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/oniguruma-parser": {
+ "version": "0.12.2",
+ "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz",
+ "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==",
+ "license": "MIT"
+ },
+ "node_modules/oniguruma-to-es": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz",
+ "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==",
+ "license": "MIT",
+ "dependencies": {
+ "oniguruma-parser": "^0.12.2",
+ "regex": "^6.1.0",
+ "regex-recursion": "^6.0.2"
+ }
+ },
"node_modules/optionator": {
"version": "0.9.4",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
@@ -7926,6 +8171,24 @@
"integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",
"license": "MIT"
},
+ "node_modules/parse-numeric-range": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz",
+ "integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==",
+ "license": "ISC"
+ },
+ "node_modules/parse5": {
+ "version": "7.3.0",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
+ "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
+ "license": "MIT",
+ "dependencies": {
+ "entities": "^6.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -8259,6 +8522,30 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz",
+ "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==",
+ "license": "MIT",
+ "dependencies": {
+ "regex-utilities": "^2.3.0"
+ }
+ },
+ "node_modules/regex-recursion": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz",
+ "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==",
+ "license": "MIT",
+ "dependencies": {
+ "regex-utilities": "^2.3.0"
+ }
+ },
+ "node_modules/regex-utilities": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz",
+ "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==",
+ "license": "MIT"
+ },
"node_modules/regexp.prototype.flags": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz",
@@ -8280,6 +8567,41 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/rehype-parse": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.1.tgz",
+ "integrity": "sha512-ksCzCD0Fgfh7trPDxr2rSylbwq9iYDkSn8TCDmEJ49ljEUBxDVCzCHv7QNzZOfODanX4+bWQ4WZqLCRWYLfhag==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "hast-util-from-html": "^2.0.0",
+ "unified": "^11.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/rehype-pretty-code": {
+ "version": "0.14.3",
+ "resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.14.3.tgz",
+ "integrity": "sha512-Cz692FeYusTjT5cfFWLc4r7JhgC3/JlJptgUh4iffBxWxUnWW1oqbWFi7jGCeq00DYUm8yzoTnvpocaYa5x82g==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.4",
+ "hast-util-to-string": "^3.0.0",
+ "parse-numeric-range": "^1.3.0",
+ "rehype-parse": "^9.0.0",
+ "unified": "^11.0.5",
+ "unist-util-visit": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "shiki": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0"
+ }
+ },
"node_modules/rehype-recma": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz",
@@ -8704,6 +9026,25 @@
"node": ">=8"
}
},
+ "node_modules/shiki": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.2.0.tgz",
+ "integrity": "sha512-hjNax6o/ylDy9lefQEaSDtzaT3iVNtZ3WmpQnbuQNoG4xvnSKf2kSKbihZVO4JRG1TTMejs7CmNRYlWgAL66pQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/core": "4.2.0",
+ "@shikijs/engine-javascript": "4.2.0",
+ "@shikijs/engine-oniguruma": "4.2.0",
+ "@shikijs/langs": "4.2.0",
+ "@shikijs/themes": "4.2.0",
+ "@shikijs/types": "4.2.0",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.4"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/side-channel": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
@@ -9630,6 +9971,20 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/vfile-location": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz",
+ "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0",
+ "vfile": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/vfile-matter": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/vfile-matter/-/vfile-matter-5.0.1.tgz",
@@ -9658,6 +10013,16 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/web-namespaces": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/website/package.json b/website/package.json
index b7d135c4..aed282f1 100644
--- a/website/package.json
+++ b/website/package.json
@@ -24,9 +24,11 @@
"next-sitemap": "^4.2.3",
"react": "19.2.3",
"react-dom": "19.2.3",
+ "rehype-pretty-code": "^0.14.3",
"remark-gfm": "^4.0.1",
"rrweb": "^2.0.0-alpha.4",
"rrweb-player": "^1.0.0-alpha.4",
+ "shiki": "^4.2.0",
"tailwind-merge": "^3.4.0"
},
"devDependencies": {