perf: rename shikiji to shiki
This commit is contained in:
parent
5ffcd27bab
commit
d087249840
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -72,6 +72,7 @@
|
||||
"portfinder",
|
||||
"shiki",
|
||||
"shikiji",
|
||||
"shikijs",
|
||||
"taze",
|
||||
"Tongji",
|
||||
"tsbuildinfo",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# `@vuepress-plume/plugin-shikiji`
|
||||
|
||||
使用 [`shikiji`](https://shikiji.netlify.app/) 来为 Markdown 代码块启用代码高亮。
|
||||
使用 [`shiki`](https://shiki.style/) 为 Markdown 代码块启用代码高亮。
|
||||
|
||||
## Install
|
||||
|
||||
@ -39,35 +39,40 @@ interface ShikijiOptions {
|
||||
* @example { theme: { light: 'github-light', dark: 'github-dark' } }
|
||||
*
|
||||
* You can use an existing theme.
|
||||
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#all-themes
|
||||
* @see https://shiki.style/themes
|
||||
* Or add your own theme.
|
||||
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#load-custom-themes
|
||||
* @see https://shiki.style/guide/load-theme
|
||||
*/
|
||||
theme?: ThemeOptions
|
||||
/**
|
||||
* Languages for syntax highlighting.
|
||||
* @see https://github.com/antfu/shikiji/blob/main/docs/languages.md#all-themes
|
||||
* @see https://shiki.style/languages
|
||||
*/
|
||||
languages?: LanguageInput[]
|
||||
/**
|
||||
* Custom language aliases.
|
||||
*
|
||||
* @example { 'my-lang': 'js' }
|
||||
* @see https://github.com/antfu/shikiji/tree/main#custom-language-aliases
|
||||
* @see https://shiki.style/guide/load-lang#custom-language-aliases
|
||||
*/
|
||||
languageAlias?: Record<string, string>
|
||||
/**
|
||||
* Setup Shikiji instance
|
||||
*/
|
||||
shikijiSetup?: (shikiji: Highlighter) => void | Promise<void>
|
||||
shikiSetup?: (shikiji: Highlighter) => void | Promise<void>
|
||||
/**
|
||||
* Fallback language when the specified language is not available.
|
||||
*/
|
||||
defaultHighlightLang?: string
|
||||
/**
|
||||
* Transformers applied to code blocks
|
||||
* @see https://github.com/antfu/shikiji#hast-transformers
|
||||
* @see https://shiki.style/guide/transformers
|
||||
*/
|
||||
codeTransformers?: ShikijiTransformer[]
|
||||
codeTransformers?: ShikiTransformer[]
|
||||
/**
|
||||
* Enable transformerRenderWhitespace
|
||||
* @default false
|
||||
*/
|
||||
whitespace?: boolean
|
||||
}
|
||||
```
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "@vuepress-plume/plugin-shikiji",
|
||||
"type": "module",
|
||||
"version": "1.0.0-rc.29",
|
||||
"description": "The Plugin for VuePres 2",
|
||||
"description": "The Plugin for VuePres 2 - shiki",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme",
|
||||
@ -35,11 +35,11 @@
|
||||
"vuepress": "2.0.0-rc.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@shikijs/transformers": "1.0.0-beta.0",
|
||||
"@shikijs/twoslash": "1.0.0-beta.0",
|
||||
"nanoid": "^5.0.4",
|
||||
"picocolors": "^1.0.0",
|
||||
"shikiji": "^0.10.2",
|
||||
"shikiji-transformers": "^0.10.2",
|
||||
"shikiji-twoslash": "^0.10.2"
|
||||
"shiki": "1.0.0-beta.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@ -47,7 +47,7 @@
|
||||
"keyword": [
|
||||
"VuePress",
|
||||
"vuepress plugin",
|
||||
"shikiji",
|
||||
"vuepress-plugin-shikiji"
|
||||
"shiki",
|
||||
"vuepress-plugin-shiki"
|
||||
]
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@ import type {
|
||||
BuiltinTheme,
|
||||
Highlighter,
|
||||
LanguageInput,
|
||||
ShikijiTransformer,
|
||||
ShikiTransformer,
|
||||
ThemeRegistration,
|
||||
} from 'shikiji'
|
||||
} from 'shiki'
|
||||
|
||||
export type ThemeOptions =
|
||||
| ThemeRegistration
|
||||
@ -24,34 +24,40 @@ export interface HighlighterOptions {
|
||||
* @example { theme: { light: 'github-light', dark: 'github-dark' } }
|
||||
*
|
||||
* You can use an existing theme.
|
||||
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#all-themes
|
||||
* @see https://shiki.style/themes
|
||||
* Or add your own theme.
|
||||
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#load-custom-themes
|
||||
* @see https://shiki.style/guide/load-theme
|
||||
*/
|
||||
theme?: ThemeOptions
|
||||
/**
|
||||
* Languages for syntax highlighting.
|
||||
* @see https://github.com/antfu/shikiji/blob/main/docs/languages.md#all-themes
|
||||
* @see https://shiki.style/languages
|
||||
*/
|
||||
languages?: LanguageInput[]
|
||||
/**
|
||||
* Custom language aliases.
|
||||
*
|
||||
* @example { 'my-lang': 'js' }
|
||||
* @see https://github.com/antfu/shikiji/tree/main#custom-language-aliases
|
||||
* @see https://shiki.style/guide/load-lang#custom-language-aliases
|
||||
*/
|
||||
languageAlias?: Record<string, string>
|
||||
/**
|
||||
* Setup Shikiji instance
|
||||
*/
|
||||
shikijiSetup?: (shikiji: Highlighter) => void | Promise<void>
|
||||
shikiSetup?: (shikiji: Highlighter) => void | Promise<void>
|
||||
/**
|
||||
* Fallback language when the specified language is not available.
|
||||
*/
|
||||
defaultHighlightLang?: string
|
||||
/**
|
||||
* Transformers applied to code blocks
|
||||
* @see https://github.com/antfu/shikiji#hast-transformers
|
||||
* @see https://shiki.style/guide/transformers
|
||||
*/
|
||||
codeTransformers?: ShikijiTransformer[]
|
||||
codeTransformers?: ShikiTransformer[]
|
||||
|
||||
/**
|
||||
* Enable transformerRenderWhitespace
|
||||
* @default false
|
||||
*/
|
||||
whitespace?: boolean
|
||||
}
|
||||
|
||||
64
pnpm-lock.yaml
generated
64
pnpm-lock.yaml
generated
@ -279,21 +279,21 @@ importers:
|
||||
|
||||
plugins/plugin-shikiji:
|
||||
dependencies:
|
||||
'@shikijs/transformers':
|
||||
specifier: 1.0.0-beta.0
|
||||
version: 1.0.0-beta.0
|
||||
'@shikijs/twoslash':
|
||||
specifier: 1.0.0-beta.0
|
||||
version: 1.0.0-beta.0(typescript@5.3.3)
|
||||
nanoid:
|
||||
specifier: ^5.0.4
|
||||
version: 5.0.4
|
||||
picocolors:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
shikiji:
|
||||
specifier: ^0.10.2
|
||||
version: 0.10.2
|
||||
shikiji-transformers:
|
||||
specifier: ^0.10.2
|
||||
version: 0.10.2
|
||||
shikiji-twoslash:
|
||||
specifier: ^0.10.2
|
||||
version: 0.10.2(typescript@5.3.3)
|
||||
shiki:
|
||||
specifier: 1.0.0-beta.0
|
||||
version: 1.0.0-beta.0
|
||||
vuepress:
|
||||
specifier: 2.0.0-rc.2
|
||||
version: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15)
|
||||
@ -3059,6 +3059,26 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@shikijs/core@1.0.0-beta.0:
|
||||
resolution: {integrity: sha512-uicyrkx379Q5sxQuGV3kduHPWIAkjxmeA5A4J6syscx8wiEyIV06i/Q6s9GeKLCb857Hi90H8e/FoFSbcjnZsw==}
|
||||
dev: false
|
||||
|
||||
/@shikijs/transformers@1.0.0-beta.0:
|
||||
resolution: {integrity: sha512-OvIO6RxQ7YaQhp34uXVKUPZDRdTcGwBgX3zn26haSvqPwrTQcxdPgT47sr4u3sz1+RwN3RO9AGxCJFRKNpB+Qw==}
|
||||
dependencies:
|
||||
shiki: 1.0.0-beta.0
|
||||
dev: false
|
||||
|
||||
/@shikijs/twoslash@1.0.0-beta.0(typescript@5.3.3):
|
||||
resolution: {integrity: sha512-zil9WA4aCs2yJ+1vwt1El8+xp8up9ikh48ksTl7Un8/+dHDAVKjkRD20W+G071cl7NOEEWEynnIMkqqVITNlfA==}
|
||||
dependencies:
|
||||
'@shikijs/core': 1.0.0-beta.0
|
||||
twoslash: 0.1.0(typescript@5.3.3)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
dev: false
|
||||
|
||||
/@sindresorhus/is@5.3.0:
|
||||
resolution: {integrity: sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==}
|
||||
engines: {node: '>=14.16'}
|
||||
@ -13158,30 +13178,10 @@ packages:
|
||||
/shell-quote@1.8.1:
|
||||
resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
|
||||
|
||||
/shikiji-core@0.10.2:
|
||||
resolution: {integrity: sha512-9Of8HMlF96usXJHmCL3Gd0Fcf0EcyJUF9m8EoAKKd98mHXi0La2AZl1h6PegSFGtiYcBDK/fLuKbDa1l16r1fA==}
|
||||
dev: false
|
||||
|
||||
/shikiji-transformers@0.10.2:
|
||||
resolution: {integrity: sha512-7IVTwl1af205ywYEq5bOAYOTOFW4V1dVX1EablP0nWKErqZeD1o93VMytxmtJomqS+YwbB8doY8SE3MFMn0aPQ==}
|
||||
/shiki@1.0.0-beta.0:
|
||||
resolution: {integrity: sha512-CcP0IhEDQ3LWfJC44cfxfId9pjJi9Nephl8DxgrL4tKWprI/oz6deZyL0vB+XWxhTx/1uonzWQKaSQPwKx5dTA==}
|
||||
dependencies:
|
||||
shikiji: 0.10.2
|
||||
dev: false
|
||||
|
||||
/shikiji-twoslash@0.10.2(typescript@5.3.3):
|
||||
resolution: {integrity: sha512-BeIo3TsuWMh07dn0RjPvmAxJh6zeZu0kbPW1m6R0kvKOgh/jSa9+Mu75evHfPabNJumtMELT5osnzlv66x87wg==}
|
||||
dependencies:
|
||||
shikiji-core: 0.10.2
|
||||
twoslash: 0.1.0(typescript@5.3.3)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
dev: false
|
||||
|
||||
/shikiji@0.10.2:
|
||||
resolution: {integrity: sha512-wtZg3T0vtYV2PnqusWQs3mDaJBdCPWxFDrBM/SE5LfrX92gjUvfEMlc+vJnoKY6Z/S44OWaCRzNIsdBRWcTAiw==}
|
||||
dependencies:
|
||||
shikiji-core: 0.10.2
|
||||
'@shikijs/core': 1.0.0-beta.0
|
||||
dev: false
|
||||
|
||||
/side-channel@1.0.4:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user