Skip to content

Commit b64e79b

Browse files
committed
feat(website): add twoslash
1 parent 447a92c commit b64e79b

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

apps/website/app/docs/[[...slug]]/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Popup, PopupContent, PopupTrigger } from "fumadocs-twoslash/ui";
12
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
23
import defaultMdxComponents from "fumadocs-ui/mdx";
34
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
@@ -7,6 +8,9 @@ import { source } from "#/lib/source";
78

89
const mdxComponents = {
910
...defaultMdxComponents,
11+
Popup,
12+
PopupContent,
13+
PopupTrigger,
1014
Tab,
1115
Tabs,
1216
};

apps/website/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"react": "^19.0.0",
2525
"react-dom": "^19.0.0",
2626
"shiki": "^3.1.0",
27-
"tailwind-merge": "^3.0.2"
27+
"tailwind-merge": "^3.0.2",
28+
"twoslash": "^0.3.1"
2829
},
2930
"devDependencies": {
3031
"@eslint-react/eslint-plugin": "workspace:*",

apps/website/source.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
22
import { remarkDocGen, remarkInstall } from "fumadocs-docgen";
33
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
4+
import { transformerTwoslash } from "fumadocs-twoslash";
45

56
export const { meta, docs } = defineDocs({
67
dir: "content/docs",
@@ -20,6 +21,7 @@ export default defineConfig({
2021
},
2122
transformers: [
2223
...rehypeCodeDefaultOptions.transformers ?? [],
24+
transformerTwoslash(),
2325
],
2426
},
2527
remarkPlugins: [

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)