Skip to content

Commit

Permalink
docs: add transformerMetaHighlight (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Sep 5, 2024
1 parent b63b8d3 commit 456d8f1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
16 changes: 8 additions & 8 deletions apps/docs/content/docs/ui/shadcn-ui/Scrollbar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ Add the following CSS to your `globals.css`:

The resulting MyThread component should look like this:

```tsx
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; // [!code highlight]
import { ScrollBar } from "@/components/ui/scroll-area"; // [!code highlight]
```tsx {1-2,6,8,12-13,15}
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
import { ScrollBar } from "@/components/ui/scroll-area";

const MyThread: FC = () => {
return (
<ScrollAreaPrimitive.Root asChild> /* [!code highlight] */
<ScrollAreaPrimitive.Root asChild>
<ThreadPrimitive.Root className="...">
<ScrollAreaPrimitive.Viewport className="thread-viewport" asChild> /* [!code highlight] */
<ScrollAreaPrimitive.Viewport className="thread-viewport" asChild>
<ThreadPrimitive.Viewport className="...">
...
</ThreadPrimitive.Viewport>
</ScrollAreaPrimitive.Viewport> /* [!code highlight] */
<ScrollBar /> /* [!code highlight] */
</ScrollAreaPrimitive.Viewport>
<ScrollBar />
</ThreadPrimitive.Root>
</ScrollAreaPrimitive.Root> /* [!code highlight] */
</ScrollAreaPrimitive.Root>
);
};
```
2 changes: 2 additions & 0 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import createMDX from "fumadocs-mdx/config";
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
import { transformerTwoslash } from "fumadocs-twoslash";
import { transformerMetaHighlight } from "@shikijs/transformers";

const withMDX = createMDX({
mdxOptions: {
rehypeCodeOptions: {
transformers: [
...rehypeCodeDefaultOptions.transformers,
transformerMetaHighlight(),
transformerTwoslash({
twoslashOptions: {
compilerOptions: {
Expand Down
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@radix-ui/themes": "^3.1.3",
"@shikijs/transformers": "^1.16.2",
"ai": "^3.3.21",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand Down
53 changes: 40 additions & 13 deletions pnpm-lock.yaml

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

0 comments on commit 456d8f1

Please sign in to comment.