Skip to content

Commit 05ecf65

Browse files
committedJul 23, 2024
Fix example
1 parent f864886 commit 05ecf65

File tree

4 files changed

+882
-602
lines changed

4 files changed

+882
-602
lines changed
 

Diff for: ‎docs/docs/getting-started.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,9 @@ MDX files can be imported in [Bun][] by using
814814
preload = ["./bun-mdx.ts"]
815815
```
816816

817-
```js twoslash path="bun-mdx.ts"
817+
```ts twoslash path="bun-mdx.ts"
818+
/// <reference types="bun-types" />
819+
// ---cut---
818820
import mdx from '@mdx-js/esbuild'
819821
import {type BunPlugin, plugin} from 'bun'
820822

Diff for: ‎package-lock.json

+876-600
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"acorn": "^8.0.0",
4343
"ap-style-title-case": "^2.0.0",
4444
"autoprefixer": "^10.0.0",
45+
"bun-types": "^1.0.0",
4546
"c8": "^10.0.0",
4647
"copy-to-clipboard": "^3.0.0",
4748
"cross-env": "^7.0.0",

Diff for: ‎website/mdx-config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {fileURLToPath, pathToFileURL} from 'node:url'
1919
import {nodeTypes} from '@mdx-js/mdx'
2020
import {common} from '@wooorm/starry-night'
2121
import sourceMdx from '@wooorm/starry-night/source.mdx'
22+
import sourceToml from '@wooorm/starry-night/source.toml'
2223
import sourceTsx from '@wooorm/starry-night/source.tsx'
2324
import {valueToEstree} from 'estree-util-value-to-estree'
2425
import {h, s} from 'hastscript'
@@ -95,7 +96,7 @@ const options = {
9596
[
9697
rehypeStarryNight,
9798
{
98-
grammars: [...common, sourceMdx, sourceTsx],
99+
grammars: [...common, sourceMdx, sourceToml, sourceTsx],
99100
plainText: ['mdx-invalid', 'txt']
100101
}
101102
],

0 commit comments

Comments
 (0)
Please sign in to comment.