@vuepress/plugin-shiki 2.0.0-beta.49 → 2.0.0-beta.50-pre.1
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.
- package/lib/node/index.d.ts +2 -2
- package/lib/node/index.js +3 -19
- package/lib/node/shikiPlugin.js +6 -8
- package/package.json +9 -4
package/lib/node/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { shikiPlugin } from './shikiPlugin';
|
|
2
|
-
export * from './shikiPlugin';
|
|
1
|
+
import { shikiPlugin } from './shikiPlugin.js';
|
|
2
|
+
export * from './shikiPlugin.js';
|
|
3
3
|
export default shikiPlugin;
|
package/lib/node/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const shikiPlugin_1 = require("./shikiPlugin");
|
|
18
|
-
__exportStar(require("./shikiPlugin"), exports);
|
|
19
|
-
exports.default = shikiPlugin_1.shikiPlugin;
|
|
1
|
+
import { shikiPlugin } from './shikiPlugin.js';
|
|
2
|
+
export * from './shikiPlugin.js';
|
|
3
|
+
export default shikiPlugin;
|
package/lib/node/shikiPlugin.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.shikiPlugin = void 0;
|
|
4
|
-
const shiki_1 = require("shiki");
|
|
5
|
-
const shikiPlugin = ({ theme = 'nord', langs = [], } = {}) => ({
|
|
1
|
+
import { getHighlighter } from 'shiki';
|
|
2
|
+
export const shikiPlugin = ({ theme = 'nord', langs = [], } = {}) => ({
|
|
6
3
|
name: '@vuepress/plugin-shiki',
|
|
7
4
|
extendsMarkdown: async (md) => {
|
|
8
|
-
const highlighter = await
|
|
5
|
+
const highlighter = await getHighlighter({
|
|
9
6
|
theme,
|
|
10
7
|
langs,
|
|
11
8
|
});
|
|
12
|
-
md.options.highlight = (code, lang) => highlighter.codeToHtml(code,
|
|
9
|
+
md.options.highlight = (code, lang) => highlighter.codeToHtml(code, {
|
|
10
|
+
lang,
|
|
11
|
+
});
|
|
13
12
|
},
|
|
14
13
|
});
|
|
15
|
-
exports.shikiPlugin = shikiPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/plugin-shiki",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.50-pre.1",
|
|
4
4
|
"description": "VuePress plugin - shiki",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-plugin",
|
|
@@ -19,13 +19,18 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"author": "meteorlxy",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./lib/node/index.js",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"main": "./lib/node/index.js",
|
|
28
|
+
"types": "./lib/node/index.d.ts",
|
|
24
29
|
"files": [
|
|
25
30
|
"lib"
|
|
26
31
|
],
|
|
27
32
|
"dependencies": {
|
|
28
|
-
"@vuepress/core": "2.0.0-beta.
|
|
33
|
+
"@vuepress/core": "2.0.0-beta.50-pre.1",
|
|
29
34
|
"shiki": "^0.10.1"
|
|
30
35
|
},
|
|
31
36
|
"publishConfig": {
|