@vuepress/plugin-shiki 2.0.0-rc.3 → 2.0.0-rc.30

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,3 +1,4 @@
1
1
  import { shikiPlugin } from './shikiPlugin.js';
2
2
  export * from './shikiPlugin.js';
3
+ /** @deprecated Use named export instead */
3
4
  export default shikiPlugin;
package/lib/node/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  import { shikiPlugin } from './shikiPlugin.js';
2
2
  export * from './shikiPlugin.js';
3
+ /** @deprecated Use named export instead */
3
4
  export default shikiPlugin;
@@ -1,4 +1,4 @@
1
- import type { BundledLanguage, BundledTheme, LanguageInput, SpecialLanguage, StringLiteralUnion, ThemeRegistration, ThemeRegistrationRaw } from 'shikiji';
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>;
@@ -9,26 +9,27 @@ export interface ShikiPluginOptions {
9
9
  /**
10
10
  * Languages to be loaded.
11
11
  *
12
- * Shikiji does not preload any languages to avoid extra overhead. So you need
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://shikiji.netlify.app/languages
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://shikiji.netlify.app/themes
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://shikiji.netlify.app/themes
27
+ * @see https://shiki.style/themes
28
28
  */
29
29
  themes?: {
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;
@@ -1,5 +1,6 @@
1
- import { getHighlighter } from 'shikiji';
2
- export const shikiPlugin = ({ langs, theme = 'nord', themes, } = {}) => ({
1
+ import { bundledLanguages, getHighlighter } from 'shiki';
2
+ const DEFAULT_LANGS = Object.keys(bundledLanguages);
3
+ export const shikiPlugin = ({ langs = DEFAULT_LANGS, theme = 'nord', themes, transformers = [], } = {}) => ({
3
4
  name: '@vuepress/plugin-shiki',
4
5
  extendsMarkdown: async (md) => {
5
6
  const highlighter = await getHighlighter({
@@ -8,6 +9,7 @@ export const shikiPlugin = ({ langs, theme = 'nord', themes, } = {}) => ({
8
9
  });
9
10
  md.options.highlight = (code, lang) => highlighter.codeToHtml(code, {
10
11
  lang,
12
+ transformers,
11
13
  ...(themes ? { themes } : { theme }),
12
14
  });
13
15
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/plugin-shiki",
3
- "version": "2.0.0-rc.3",
3
+ "version": "2.0.0-rc.30",
4
4
  "description": "VuePress plugin - shiki",
5
5
  "keywords": [
6
6
  "vuepress-plugin",
@@ -9,7 +9,7 @@
9
9
  "shiki",
10
10
  "highlight"
11
11
  ],
12
- "homepage": "https://github.com/vuepress",
12
+ "homepage": "https://ecosystem.vuejs.press/plugins/shiki.html",
13
13
  "bugs": {
14
14
  "url": "https://github.com/vuepress/ecosystem/issues"
15
15
  },
@@ -35,13 +35,13 @@
35
35
  "clean": "rimraf --glob ./lib ./*.tsbuildinfo"
36
36
  },
37
37
  "dependencies": {
38
- "shikiji": "^0.10.2"
38
+ "shiki": "^1.5.2"
39
39
  },
40
40
  "peerDependencies": {
41
- "vuepress": "2.0.0-rc.2"
41
+ "vuepress": "2.0.0-rc.11"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "7247c765f50c3b2d5a622e0f7cf22bfb13a463c4"
46
+ "gitHead": "e84a9e154e119525784f6934f06a795029798f8f"
47
47
  }