Skip to content

Commit

Permalink
chore: change to shiki again
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Feb 3, 2024
1 parent d3841a8 commit 82fdeb5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/pages/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Nextra is powered by these incredible open source projects:
- https://pnpm.io
- https://tailwindcss.com
- https://github.com/pacocoursey/next-themes
- https://github.com/antfu/shikiji
- https://github.com/shikijs/shiki
- https://github.com/nextapps-de/flexsearch
- https://github.com/atomiks/rehype-pretty-code
- https://github.com/Brooooooklyn/simple-git
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
"remark-math": "^6.0.0",
"remark-reading-time": "^2.0.1",
"remark-smartypants": "^2.1.0",
"shikiji": "^0.10.2",
"shikiji-twoslash": "^0.10.2",
"shiki": "1.0.0-beta.5",
"@shikijs/twoslash": "1.0.0-beta.5",
"slash": "^5.1.0",
"title": "^3.5.3",
"unist-util-remove": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra/src/server/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from 'node:path'
import type { ProcessorOptions } from '@mdx-js/mdx'
import { createProcessor } from '@mdx-js/mdx'
import type { Processor } from '@mdx-js/mdx/lib/core'
import { rendererRich, transformerTwoslash } from '@shikijs/twoslash'
import { remarkMermaid } from '@theguild/remark-mermaid'
import { remarkNpm2Yarn } from '@theguild/remark-npm2yarn'
import type { Program } from 'estree'
Expand All @@ -13,7 +14,6 @@ import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import remarkReadingTime from 'remark-reading-time'
import remarkSmartypants from 'remark-smartypants'
import { rendererRich, transformerTwoslash } from 'shikiji-twoslash'
import type { Pluggable, Plugin } from 'unified'
import type {
FrontMatter,
Expand Down
3 changes: 2 additions & 1 deletion packages/nextra/src/server/rehype-plugins/rehype.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Element } from 'hast'
import type { Options as RehypePrettyCodeOptions } from 'rehype-pretty-code'
import { bundledLanguages, getHighlighter } from 'shikiji'
import { bundledLanguages, getHighlighter } from 'shiki'
import type { Plugin } from 'unified'
import { visit } from 'unist-util-visit'

Expand All @@ -27,6 +27,7 @@ export const DEFAULT_REHYPE_PRETTY_CODE_OPTIONS: RehypePrettyCodeOptions = {
light: 'github-light',
dark: 'github-dark'
},
// @ts-expect-error wait for https://github.com/rehype-pretty/rehype-pretty-code/pull/172
getHighlighter(opts) {
return getHighlighter({
...opts,
Expand Down
69 changes: 40 additions & 29 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 82fdeb5

Please sign in to comment.