@vuepress/plugin-shiki 2.0.0-rc.17 → 2.0.0-rc.21
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 'shiki';
|
|
1
|
+
import type { BundledLanguage, BundledTheme, LanguageInput, ShikiTransformer, 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>;
|
|
@@ -30,5 +30,6 @@ export interface ShikiPluginOptions {
|
|
|
30
30
|
dark: ShikiTheme;
|
|
31
31
|
light: ShikiTheme;
|
|
32
32
|
};
|
|
33
|
+
transformers?: ShikiTransformer[];
|
|
33
34
|
}
|
|
34
|
-
export declare const shikiPlugin: ({ langs, theme, themes, }?: ShikiPluginOptions) => Plugin;
|
|
35
|
+
export declare const shikiPlugin: ({ langs, theme, themes, transformers, }?: ShikiPluginOptions) => Plugin;
|
package/lib/node/shikiPlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bundledLanguages, getHighlighter } from 'shiki';
|
|
2
2
|
const DEFAULT_LANGS = Object.keys(bundledLanguages);
|
|
3
|
-
export const shikiPlugin = ({ langs = DEFAULT_LANGS, theme = 'nord', themes, } = {}) => ({
|
|
3
|
+
export const shikiPlugin = ({ langs = DEFAULT_LANGS, theme = 'nord', themes, transformers = [], } = {}) => ({
|
|
4
4
|
name: '@vuepress/plugin-shiki',
|
|
5
5
|
extendsMarkdown: async (md) => {
|
|
6
6
|
const highlighter = await getHighlighter({
|
|
@@ -9,6 +9,7 @@ export const shikiPlugin = ({ langs = DEFAULT_LANGS, theme = 'nord', themes, } =
|
|
|
9
9
|
});
|
|
10
10
|
md.options.highlight = (code, lang) => highlighter.codeToHtml(code, {
|
|
11
11
|
lang,
|
|
12
|
+
transformers,
|
|
12
13
|
...(themes ? { themes } : { theme }),
|
|
13
14
|
});
|
|
14
15
|
},
|
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.21",
|
|
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
|
-
"shiki": "^1.
|
|
38
|
+
"shiki": "^1.2.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"vuepress": "2.0.0-rc.
|
|
41
|
+
"vuepress": "2.0.0-rc.9"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "014780ab182c15249ac9d27cee31d080f9ac01cd"
|
|
47
47
|
}
|