@vuepress/plugin-shiki 2.0.0-rc.11 → 2.0.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BundledLanguage, BundledTheme, LanguageInput, SpecialLanguage, StringLiteralUnion, ThemeRegistration, ThemeRegistrationRaw } from '
|
|
1
|
+
import type { BundledLanguage, BundledTheme, LanguageInput, SpecialLanguage, StringLiteralUnion, ThemeRegistration, ThemeRegistrationRaw } from 'shiki';
|
|
2
2
|
import type { Plugin } from 'vuepress/core';
|
|
3
3
|
export type ShikiLang = LanguageInput | StringLiteralUnion<BundledLanguage> | SpecialLanguage;
|
|
4
4
|
export type ShikiTheme = ThemeRegistration | ThemeRegistrationRaw | StringLiteralUnion<BundledTheme>;
|
|
@@ -9,22 +9,22 @@ export interface ShikiPluginOptions {
|
|
|
9
9
|
/**
|
|
10
10
|
* Languages to be loaded.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* Shiki does not preload any languages to avoid extra overhead. So you need
|
|
13
13
|
* to specify the languages you want to use.
|
|
14
14
|
*
|
|
15
|
-
* @see https://
|
|
15
|
+
* @see https://shiki.style/languages
|
|
16
16
|
*/
|
|
17
17
|
langs?: ShikiLang[];
|
|
18
18
|
/**
|
|
19
19
|
* The single theme to use
|
|
20
20
|
*
|
|
21
|
-
* @see https://
|
|
21
|
+
* @see https://shiki.style/themes
|
|
22
22
|
*/
|
|
23
23
|
theme?: ShikiTheme;
|
|
24
24
|
/**
|
|
25
25
|
* The dark and light themes to use
|
|
26
26
|
*
|
|
27
|
-
* @see https://
|
|
27
|
+
* @see https://shiki.style/themes
|
|
28
28
|
*/
|
|
29
29
|
themes?: {
|
|
30
30
|
dark: ShikiTheme;
|
package/lib/node/shikiPlugin.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { getHighlighter } from '
|
|
2
|
-
|
|
1
|
+
import { bundledLanguages, getHighlighter } from 'shiki/bundle/full';
|
|
2
|
+
const DEFAULT_LANGS = Object.keys(bundledLanguages);
|
|
3
|
+
export const shikiPlugin = ({ langs = DEFAULT_LANGS, theme = 'nord', themes, } = {}) => ({
|
|
3
4
|
name: '@vuepress/plugin-shiki',
|
|
4
5
|
extendsMarkdown: async (md) => {
|
|
5
6
|
const highlighter = await getHighlighter({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/plugin-shiki",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.12",
|
|
4
4
|
"description": "VuePress plugin - shiki",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-plugin",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"clean": "rimraf --glob ./lib ./*.tsbuildinfo"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"
|
|
38
|
+
"shiki": "^1.0.0-rc.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"vuepress": "2.0.0-rc.
|
|
41
|
+
"vuepress": "2.0.0-rc.7"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ec1ce0f857e9b05bee848bedcfb395a00bdda4c6"
|
|
47
47
|
}
|