@vuepress/plugin-shiki 2.0.0-beta.9 → 2.0.0-rc.0
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 -15
- package/lib/node/shikiPlugin.d.ts +2 -2
- package/lib/node/shikiPlugin.js +7 -9
- package/package.json +15 -11
- package/CHANGELOG.md +0 -51
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,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const shikiPlugin_1 = require("./shikiPlugin");
|
|
14
|
-
__exportStar(require("./shikiPlugin"), exports);
|
|
15
|
-
exports.default = shikiPlugin_1.shikiPlugin;
|
|
1
|
+
import { shikiPlugin } from './shikiPlugin.js';
|
|
2
|
+
export * from './shikiPlugin.js';
|
|
3
|
+
export default shikiPlugin;
|
|
@@ -3,5 +3,5 @@ import type { HighlighterOptions } from 'shiki';
|
|
|
3
3
|
/**
|
|
4
4
|
* Options of @vuepress/plugin-shiki
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export declare const shikiPlugin: Plugin
|
|
6
|
+
export type ShikiPluginOptions = Pick<HighlighterOptions, 'theme' | 'langs'>;
|
|
7
|
+
export declare const shikiPlugin: ({ theme, langs, }?: ShikiPluginOptions) => Plugin;
|
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
|
-
async
|
|
8
|
-
const highlighter = await
|
|
4
|
+
extendsMarkdown: async (md) => {
|
|
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-
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "VuePress plugin - shiki",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-plugin",
|
|
@@ -19,21 +19,25 @@
|
|
|
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
|
-
"scripts": {
|
|
28
|
-
"build": "tsc -b tsconfig.build.json",
|
|
29
|
-
"clean": "rimraf lib *.tsbuildinfo"
|
|
30
|
-
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
33
|
+
"shiki": "^0.14.5",
|
|
34
|
+
"@vuepress/core": "2.0.0-rc.0"
|
|
34
35
|
},
|
|
35
36
|
"publishConfig": {
|
|
36
37
|
"access": "public"
|
|
37
38
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc -b tsconfig.build.json",
|
|
41
|
+
"clean": "rimraf lib *.tsbuildinfo"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [2.0.0-beta.9](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.8...v2.0.0-beta.9) (2021-04-21)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @vuepress/plugin-shiki
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [2.0.0-beta.8](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.7...v2.0.0-beta.8) (2021-04-11)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
### Code Refactoring
|
|
18
|
-
|
|
19
|
-
* normalize themes and plugins structure ([7781172](https://github.com/vuepress/vuepress-next/commit/77811722401bf1ed1fec44c64158ab0cd1ab3179))
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### BREAKING CHANGES
|
|
23
|
-
|
|
24
|
-
* client API that provided by plugins should be imported from `plugin-foo/lib/client`
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# [2.0.0-beta.7](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.6...v2.0.0-beta.7) (2021-04-09)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @vuepress/plugin-shiki
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# [2.0.0-beta.6](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.5...v2.0.0-beta.6) (2021-03-26)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @vuepress/plugin-shiki
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# [2.0.0-beta.5](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.4...v2.0.0-beta.5) (2021-03-26)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Features
|
|
50
|
-
|
|
51
|
-
* **plugin-shiki:** add shiki plugin ([66bbcbd](https://github.com/vuepress/vuepress-next/commit/66bbcbde497cca525fc585b4046b11784e8d61bc))
|