Skip to content

Commit f71e660

Browse files
authoredFeb 9, 2024
chore: change to shiki again (#2658)
* chore: change to shiki again * chore: update rehype plugin * add changeset
1 parent 79cb631 commit f71e660

File tree

9 files changed

+62
-51
lines changed

9 files changed

+62
-51
lines changed
 

‎.changeset/mighty-items-cough.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nextra': minor
3+
---
4+
5+
change to shiki again

‎docs/components/index-page/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export const IndexPage = () => (
331331
</h3>
332332
<p>
333333
Performant and reliable build-time syntax highlighting powered by{' '}
334-
<Link href="https://shiki.matsu.io">Shiki</Link>.
334+
<Link href="https://shiki.style">Shiki</Link>.
335335
</p>
336336
</Feature>
337337
<Feature index={3} href="/docs/guide/i18n">

‎docs/pages/about.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Nextra is powered by these incredible open source projects:
2626
- https://pnpm.io
2727
- https://tailwindcss.com
2828
- https://github.com/pacocoursey/next-themes
29-
- https://github.com/antfu/shikiji
29+
- https://github.com/shikijs/shiki
3030
- https://github.com/nextapps-de/flexsearch
3131
- https://github.com/atomiks/rehype-pretty-code
3232
- https://github.com/Brooooooklyn/simple-git

‎docs/pages/docs/guide/syntax-highlighting.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Callout } from 'nextra/components'
33

44
# Syntax Highlighting
55

6-
Nextra uses [Shiki](https://shiki.matsu.io) to do syntax highlighting at build
6+
Nextra uses [Shiki](https://shiki.style) to do syntax highlighting at build
77
time. It's very reliable and performant. For example, adding this in your
88
Markdown file:
99

‎examples/docs/src/pages/advanced/code-highlighting.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Code Highlighting
22

3-
`Nextra` uses [Shiki](https://shiki.matsu.io) and
3+
`Nextra` uses [Shiki](https://shiki.style) and
44
[Rehype Pretty Code](https://github.com/FormidableLabs/prism-react-renderer) to
55
highlight the code blocks. This section covers how you can customze it.
66

‎packages/nextra/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"@mdx-js/mdx": "^3.0.0",
122122
"@mdx-js/react": "^3.0.0",
123123
"@napi-rs/simple-git": "^0.1.9",
124+
"@shikijs/twoslash": "^1.0.0",
124125
"@theguild/remark-mermaid": "^0.0.5",
125126
"@theguild/remark-npm2yarn": "0.3.0",
126127
"better-react-mathjax": "^2.0.3",
@@ -134,15 +135,14 @@
134135
"katex": "^0.16.9",
135136
"p-limit": "^4.0.0",
136137
"rehype-katex": "^7.0.0",
137-
"rehype-pretty-code": "0.12.6",
138+
"rehype-pretty-code": "0.13.0",
138139
"rehype-raw": "^7.0.0",
139140
"remark-frontmatter": "^5.0.0",
140141
"remark-gfm": "^4.0.0",
141142
"remark-math": "^6.0.0",
142143
"remark-reading-time": "^2.0.1",
143144
"remark-smartypants": "^2.1.0",
144-
"shikiji": "^0.10.2",
145-
"shikiji-twoslash": "^0.10.2",
145+
"shiki": "^1.0.0",
146146
"slash": "^5.1.0",
147147
"title": "^3.5.3",
148148
"unist-util-remove": "^4.0.0",

‎packages/nextra/src/server/compile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import path from 'node:path'
22
import type { ProcessorOptions } from '@mdx-js/mdx'
33
import { createProcessor } from '@mdx-js/mdx'
44
import type { Processor } from '@mdx-js/mdx/lib/core'
5+
import { rendererRich, transformerTwoslash } from '@shikijs/twoslash'
56
import { remarkMermaid } from '@theguild/remark-mermaid'
67
import { remarkNpm2Yarn } from '@theguild/remark-npm2yarn'
78
import type { Program } from 'estree'
@@ -13,7 +14,6 @@ import remarkGfm from 'remark-gfm'
1314
import remarkMath from 'remark-math'
1415
import remarkReadingTime from 'remark-reading-time'
1516
import remarkSmartypants from 'remark-smartypants'
16-
import { rendererRich, transformerTwoslash } from 'shikiji-twoslash'
1717
import type { Pluggable, Plugin } from 'unified'
1818
import type {
1919
FrontMatter,

‎packages/nextra/src/server/rehype-plugins/rehype.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Element } from 'hast'
22
import type { Options as RehypePrettyCodeOptions } from 'rehype-pretty-code'
3-
import { bundledLanguages, getHighlighter } from 'shikiji'
3+
import { bundledLanguages, getHighlighter } from 'shiki'
44
import type { Plugin } from 'unified'
55
import { visit } from 'unist-util-visit'
66

‎pnpm-lock.yaml

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

0 commit comments

Comments
 (0)
Please sign in to comment.