vuepress-plugin-md-power 1.0.0-rc.127 → 1.0.0-rc.129
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/client/components/CodeTabs.vue +2 -0
- package/lib/client/styles/steps.css +10 -16
- package/lib/node/index.js +35 -32
- package/package.json +14 -14
|
@@ -134,6 +134,8 @@ function onTabNavClick(index: number): void {
|
|
|
134
134
|
border-radius: 6px 6px 0 0;
|
|
135
135
|
box-shadow: inset 0 -1px var(--vp-code-tab-divider);
|
|
136
136
|
transition: background-color var(--vp-t-color), box-shadow var(--vp-t-color);
|
|
137
|
+
|
|
138
|
+
scrollbar-width: thin;
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
@media print {
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
margin: 16px 0;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.vp-doc .vp-steps > ol,
|
|
6
|
-
.vp-doc .vp-steps > ul {
|
|
5
|
+
.vp-doc .vp-steps > :where(ol,ul) {
|
|
7
6
|
padding-inline-start: 0;
|
|
8
7
|
list-style: none;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
.vp-doc .vp-steps > ol > li
|
|
12
|
-
.vp-doc .vp-steps > ul > li {
|
|
10
|
+
.vp-doc .vp-steps > :where(ol,ul) > li {
|
|
13
11
|
position: relative;
|
|
14
|
-
min-height:
|
|
12
|
+
min-height: 28px;
|
|
15
13
|
padding-bottom: 1px;
|
|
16
14
|
padding-left: 44px;
|
|
15
|
+
line-height: 28px;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
.vp-doc .vp-steps > ol > li::before
|
|
20
|
-
.vp-doc .vp-steps > ul > li::before {
|
|
18
|
+
.vp-doc .vp-steps > :where(ol,ul) > li::before {
|
|
21
19
|
position: absolute;
|
|
22
20
|
inset-inline-start: 0;
|
|
23
21
|
top: 0;
|
|
@@ -36,8 +34,7 @@
|
|
|
36
34
|
transition-property: color, background-color, border-color;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
.vp-doc .vp-steps > ol > li:not(:last-of-type)::after
|
|
40
|
-
.vp-doc .vp-steps > ul > li:not(:last-of-type)::after {
|
|
37
|
+
.vp-doc .vp-steps > :where(ol,ul) > li:not(:last-of-type)::after {
|
|
41
38
|
position: absolute;
|
|
42
39
|
inset-inline-start: 14px;
|
|
43
40
|
top: 34px;
|
|
@@ -48,22 +45,19 @@
|
|
|
48
45
|
transition: background-color var(--vp-t-color);
|
|
49
46
|
}
|
|
50
47
|
|
|
51
|
-
.vp-doc .vp-steps > ol > li > :first-child
|
|
52
|
-
.vp-doc .vp-steps > ul > li > :first-child {
|
|
48
|
+
.vp-doc .vp-steps > :where(ol,ul) > li > :first-child {
|
|
53
49
|
margin-top: 0;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
.vp-doc .vp-steps > ol > li > :first-child:where(h1,h2,h3,h4,h5,h6)
|
|
57
|
-
.vp-doc .vp-steps > ul > li > :first-child:where(h1,h2,h3,h4,h5,h6) {
|
|
52
|
+
.vp-doc .vp-steps > :where(ol,ul) > li > :first-child:where(h1,h2,h3,h4,h5,h6) {
|
|
58
53
|
padding-top: 0;
|
|
59
54
|
border-top: none;
|
|
60
55
|
}
|
|
61
56
|
|
|
62
|
-
.vp-doc .vp-steps > ol > li > :first-child:where(p) {
|
|
57
|
+
.vp-doc .vp-steps > :where(ol,ul) > li > :first-child:where(p) {
|
|
63
58
|
line-height: 28px;
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
.vp-doc .vp-steps > ol > li + li
|
|
67
|
-
.vp-doc .vp-steps > ul > li + li {
|
|
61
|
+
.vp-doc .vp-steps > :where(ol,ul) > li + li {
|
|
68
62
|
margin-top: 1px;
|
|
69
63
|
}
|
package/lib/node/index.js
CHANGED
|
@@ -1942,7 +1942,7 @@ var markdownContainerRender = {
|
|
|
1942
1942
|
|
|
1943
1943
|
// src/node/demo/normal.ts
|
|
1944
1944
|
import fs5 from "node:fs";
|
|
1945
|
-
import
|
|
1945
|
+
import path5 from "node:path";
|
|
1946
1946
|
|
|
1947
1947
|
// src/node/demo/supports/compiler.ts
|
|
1948
1948
|
import { isPackageExists } from "local-pkg";
|
|
@@ -1977,6 +1977,7 @@ async function compileScript(source, type2) {
|
|
|
1977
1977
|
const transform = await compiler.script();
|
|
1978
1978
|
const res = await transform(source, {
|
|
1979
1979
|
target: "es2018",
|
|
1980
|
+
platform: "browser",
|
|
1980
1981
|
format: "cjs",
|
|
1981
1982
|
loader: type2 === "ts" ? "ts" : "js",
|
|
1982
1983
|
sourcemap: false
|
|
@@ -2022,8 +2023,8 @@ function importer(func) {
|
|
|
2022
2023
|
|
|
2023
2024
|
// src/node/demo/supports/insertScript.ts
|
|
2024
2025
|
var SCRIPT_RE = /<script.*?>/;
|
|
2025
|
-
function insertSetupScript({ export: name, path:
|
|
2026
|
-
const imports = `import ${name ? `${name} from ` : ""}'${
|
|
2026
|
+
function insertSetupScript({ export: name, path: path9 }, env) {
|
|
2027
|
+
const imports = `import ${name ? `${name} from ` : ""}'${path9}';`;
|
|
2027
2028
|
const scriptSetup = env.sfcBlocks.scriptSetup ??= {
|
|
2028
2029
|
type: "script",
|
|
2029
2030
|
content: "<script setup>\n</script>",
|
|
@@ -2039,6 +2040,7 @@ ${imports}`);
|
|
|
2039
2040
|
|
|
2040
2041
|
// src/node/demo/watcher.ts
|
|
2041
2042
|
import fs4 from "node:fs";
|
|
2043
|
+
import path4 from "node:path";
|
|
2042
2044
|
import { watch } from "chokidar";
|
|
2043
2045
|
var renderDone = null;
|
|
2044
2046
|
var renderCount = 0;
|
|
@@ -2074,46 +2076,47 @@ function demoWatcher(app, watchers) {
|
|
|
2074
2076
|
if (!watcher) {
|
|
2075
2077
|
watcher = watch([], { ignoreInitial: true });
|
|
2076
2078
|
}
|
|
2077
|
-
Object.keys(tasks).forEach((
|
|
2078
|
-
watcher.add(
|
|
2079
|
+
Object.keys(tasks).forEach((path9) => {
|
|
2080
|
+
watcher.add(path9);
|
|
2079
2081
|
});
|
|
2080
2082
|
const code = readFileSync(app.dir.temp(target));
|
|
2081
2083
|
if (code) {
|
|
2082
2084
|
const paths = JSON.parse(code || "{}");
|
|
2083
|
-
Object.entries(paths).forEach(([
|
|
2084
|
-
watcher.add(
|
|
2085
|
-
tasks[
|
|
2085
|
+
Object.entries(paths).forEach(([path9, output]) => {
|
|
2086
|
+
watcher.add(path9);
|
|
2087
|
+
tasks[path9] = output;
|
|
2086
2088
|
});
|
|
2087
2089
|
}
|
|
2088
2090
|
updateWatchFiles(app);
|
|
2089
|
-
watcher.on("change", (
|
|
2090
|
-
if (tasks[
|
|
2091
|
-
const code2 = readFileSync(
|
|
2091
|
+
watcher.on("change", (path9) => {
|
|
2092
|
+
if (tasks[path9]) {
|
|
2093
|
+
const code2 = readFileSync(path9);
|
|
2092
2094
|
if (code2 === false)
|
|
2093
2095
|
return;
|
|
2094
2096
|
const source = parseEmbedCode(code2);
|
|
2095
|
-
compileCode(source, tasks[
|
|
2097
|
+
compileCode(source, tasks[path9]);
|
|
2096
2098
|
}
|
|
2097
2099
|
});
|
|
2098
|
-
watcher.on("unlink", (
|
|
2099
|
-
delete tasks[
|
|
2100
|
-
watcher.unwatch(
|
|
2100
|
+
watcher.on("unlink", (path9) => {
|
|
2101
|
+
delete tasks[path9];
|
|
2102
|
+
watcher.unwatch(path9);
|
|
2101
2103
|
});
|
|
2102
2104
|
watchers.push(() => {
|
|
2103
2105
|
watcher.close();
|
|
2104
2106
|
watcher = null;
|
|
2105
2107
|
});
|
|
2106
2108
|
}
|
|
2107
|
-
function addTask(app,
|
|
2108
|
-
if (tasks[
|
|
2109
|
+
function addTask(app, path9, output) {
|
|
2110
|
+
if (tasks[path9])
|
|
2109
2111
|
return;
|
|
2110
|
-
tasks[
|
|
2112
|
+
tasks[path9] = output;
|
|
2111
2113
|
if (watcher) {
|
|
2112
|
-
watcher.add(
|
|
2114
|
+
watcher.add(path9);
|
|
2113
2115
|
}
|
|
2114
2116
|
updateWatchFiles(app);
|
|
2115
2117
|
}
|
|
2116
2118
|
async function updateWatchFiles(app) {
|
|
2119
|
+
await fs4.promises.mkdir(app.dir.temp(path4.dirname(target)), { recursive: true });
|
|
2117
2120
|
await fs4.promises.writeFile(app.dir.temp(target), JSON.stringify(tasks));
|
|
2118
2121
|
}
|
|
2119
2122
|
|
|
@@ -2205,7 +2208,7 @@ function normalEmbed(app, md, env, { url, title, desc, codeSetting = "", expande
|
|
|
2205
2208
|
}
|
|
2206
2209
|
const source = parseEmbedCode(code);
|
|
2207
2210
|
const prefix = (env.filePathRelative || "").replace(/\.md$/, "").replace(/\//g, "-");
|
|
2208
|
-
const basename =
|
|
2211
|
+
const basename = path5.basename(filepath2).replace(/-|\./g, "_");
|
|
2209
2212
|
const name = `Demo${basename[0].toUpperCase()}${basename.slice(1)}`;
|
|
2210
2213
|
const demo = { type: "normal", export: name, path: filepath2 };
|
|
2211
2214
|
const output = app.dir.temp(target2, `${prefix}-${name}.js`);
|
|
@@ -2225,7 +2228,7 @@ var normalContainerRender = {
|
|
|
2225
2228
|
const { url, title, desc, expanded = false } = meta;
|
|
2226
2229
|
const name = `DemoContainer${url}`;
|
|
2227
2230
|
const prefix = (env.filePathRelative || "").replace(/\.md$/, "").replace(/\//g, "-");
|
|
2228
|
-
const output = app.dir.temp(
|
|
2231
|
+
const output = app.dir.temp(path5.join(target2, `${prefix}-${name}.js`));
|
|
2229
2232
|
env.demoFiles ??= [];
|
|
2230
2233
|
if (!env.demoFiles.some((d) => d.path === output)) {
|
|
2231
2234
|
const demo = { type: "normal", export: name, gitignore: true, path: output };
|
|
@@ -2303,7 +2306,7 @@ function normalizeAlias(info) {
|
|
|
2303
2306
|
}
|
|
2304
2307
|
|
|
2305
2308
|
// src/node/demo/vue.ts
|
|
2306
|
-
import
|
|
2309
|
+
import path6 from "node:path";
|
|
2307
2310
|
function vueEmbed(app, md, env, { url, title, desc, codeSetting = "", expanded = false }) {
|
|
2308
2311
|
const filepath2 = findFile(app, env, url);
|
|
2309
2312
|
const code = readFileSync(filepath2);
|
|
@@ -2311,8 +2314,8 @@ function vueEmbed(app, md, env, { url, title, desc, codeSetting = "", expanded =
|
|
|
2311
2314
|
console.warn("[vuepress-plugin-md-power] Cannot read vue file:", filepath2);
|
|
2312
2315
|
return "";
|
|
2313
2316
|
}
|
|
2314
|
-
const basename =
|
|
2315
|
-
const ext =
|
|
2317
|
+
const basename = path6.basename(filepath2).replace(/-|\./g, "_");
|
|
2318
|
+
const ext = path6.extname(filepath2).slice(1);
|
|
2316
2319
|
const name = `Demo${basename[0].toUpperCase()}${basename.slice(1)}`;
|
|
2317
2320
|
const demo = { type: "vue", export: name, path: filepath2 };
|
|
2318
2321
|
env.demoFiles ??= [];
|
|
@@ -2336,7 +2339,7 @@ var vueContainerRender = {
|
|
|
2336
2339
|
const componentName2 = `DemoContainer${url}`;
|
|
2337
2340
|
const prefix = (env.filePathRelative || "").replace(/\.md$/, "").replace(/\//g, "-");
|
|
2338
2341
|
env.demoFiles ??= [];
|
|
2339
|
-
const output = app.dir.temp(
|
|
2342
|
+
const output = app.dir.temp(path6.join(target3, `${prefix}-${componentName2}`));
|
|
2340
2343
|
if (codeMap.vue || codeMap.js || codeMap.ts) {
|
|
2341
2344
|
let scriptOutput = output;
|
|
2342
2345
|
let content = "";
|
|
@@ -2393,7 +2396,7 @@ var STYLE_RE2 = /<style.*?>/;
|
|
|
2393
2396
|
function transformImports(code, filepath2) {
|
|
2394
2397
|
return code.replace(IMPORT_RE, (matched, url) => {
|
|
2395
2398
|
if (url.startsWith("./") || url.startsWith("../")) {
|
|
2396
|
-
return matched.replace(url, `${
|
|
2399
|
+
return matched.replace(url, `${path6.resolve(path6.dirname(filepath2), url)}`);
|
|
2397
2400
|
}
|
|
2398
2401
|
return matched;
|
|
2399
2402
|
});
|
|
@@ -2491,10 +2494,10 @@ function extendsPageWithDemo(page) {
|
|
|
2491
2494
|
const markdownEnv = page.markdownEnv;
|
|
2492
2495
|
const demoFiles = markdownEnv.demoFiles ?? [];
|
|
2493
2496
|
page.deps.push(
|
|
2494
|
-
...demoFiles.filter(({ type: type2 }) => type2 === "markdown").map(({ path:
|
|
2497
|
+
...demoFiles.filter(({ type: type2 }) => type2 === "markdown").map(({ path: path9 }) => path9)
|
|
2495
2498
|
);
|
|
2496
2499
|
(page.frontmatter.gitInclude ??= []).push(
|
|
2497
|
-
...demoFiles.filter(({ gitignore }) => !gitignore).map(({ path:
|
|
2500
|
+
...demoFiles.filter(({ gitignore }) => !gitignore).map(({ path: path9 }) => path9)
|
|
2498
2501
|
);
|
|
2499
2502
|
}
|
|
2500
2503
|
|
|
@@ -2761,7 +2764,7 @@ var replitPlugin = (md) => {
|
|
|
2761
2764
|
};
|
|
2762
2765
|
|
|
2763
2766
|
// src/node/embed/pdf.ts
|
|
2764
|
-
import { path as
|
|
2767
|
+
import { path as path7 } from "vuepress/utils";
|
|
2765
2768
|
var pdfPlugin = (md) => {
|
|
2766
2769
|
createEmbedRuleBlock(md, {
|
|
2767
2770
|
type: "pdf",
|
|
@@ -2777,7 +2780,7 @@ var pdfPlugin = (md) => {
|
|
|
2777
2780
|
width: attrs2.width ? parseRect(attrs2.width) : "100%",
|
|
2778
2781
|
height: attrs2.height ? parseRect(attrs2.height) : "",
|
|
2779
2782
|
ratio: attrs2.ratio ? parseRect(attrs2.ratio) : "",
|
|
2780
|
-
title:
|
|
2783
|
+
title: path7.basename(src || "")
|
|
2781
2784
|
};
|
|
2782
2785
|
},
|
|
2783
2786
|
content({ title, src, page, noToolbar, width, height, ratio, zoom }) {
|
|
@@ -3149,11 +3152,11 @@ function inlineSyntaxPlugin(md, options) {
|
|
|
3149
3152
|
|
|
3150
3153
|
// src/node/prepareConfigFile.ts
|
|
3151
3154
|
import { ensureEndingSlash } from "@vuepress/helper";
|
|
3152
|
-
import { getDirname, path as
|
|
3155
|
+
import { getDirname, path as path8 } from "vuepress/utils";
|
|
3153
3156
|
var { url: filepath } = import.meta;
|
|
3154
3157
|
var __dirname = getDirname(filepath);
|
|
3155
3158
|
var CLIENT_FOLDER = ensureEndingSlash(
|
|
3156
|
-
|
|
3159
|
+
path8.resolve(__dirname, "../client")
|
|
3157
3160
|
);
|
|
3158
3161
|
async function prepareConfigFile(app, options) {
|
|
3159
3162
|
const imports = /* @__PURE__ */ new Set();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuepress-plugin-md-power",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.129",
|
|
5
5
|
"description": "The Plugin for VuePress 2 - markdown power",
|
|
6
6
|
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,31 +61,31 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@mdit/plugin-attrs": "^0.
|
|
65
|
-
"@mdit/plugin-footnote": "^0.
|
|
66
|
-
"@mdit/plugin-mark": "^0.
|
|
67
|
-
"@mdit/plugin-sub": "^0.
|
|
68
|
-
"@mdit/plugin-sup": "^0.
|
|
69
|
-
"@mdit/plugin-tab": "^0.
|
|
70
|
-
"@mdit/plugin-tasklist": "^0.
|
|
71
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
72
|
-
"@vueuse/core": "^12.
|
|
64
|
+
"@mdit/plugin-attrs": "^0.16.2",
|
|
65
|
+
"@mdit/plugin-footnote": "^0.16.0",
|
|
66
|
+
"@mdit/plugin-mark": "^0.16.0",
|
|
67
|
+
"@mdit/plugin-sub": "^0.16.0",
|
|
68
|
+
"@mdit/plugin-sup": "^0.16.0",
|
|
69
|
+
"@mdit/plugin-tab": "^0.16.0",
|
|
70
|
+
"@mdit/plugin-tasklist": "^0.16.0",
|
|
71
|
+
"@vuepress/helper": "2.0.0-rc.73",
|
|
72
|
+
"@vueuse/core": "^12.4.0",
|
|
73
73
|
"chokidar": "3.6.0",
|
|
74
74
|
"image-size": "^1.2.0",
|
|
75
75
|
"local-pkg": "^1.0.0",
|
|
76
76
|
"lru-cache": "^11.0.2",
|
|
77
77
|
"markdown-it-container": "^4.0.0",
|
|
78
78
|
"nanoid": "^5.0.9",
|
|
79
|
-
"shiki": "^
|
|
80
|
-
"tm-grammars": "^1.22.
|
|
79
|
+
"shiki": "^2.0.3",
|
|
80
|
+
"tm-grammars": "^1.22.9",
|
|
81
81
|
"tm-themes": "^1.9.8",
|
|
82
82
|
"vue": "^3.5.13"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/markdown-it": "^14.1.2",
|
|
86
|
-
"artplayer": "^5.2.
|
|
86
|
+
"artplayer": "^5.2.2",
|
|
87
87
|
"dashjs": "^4.7.4",
|
|
88
|
-
"hls.js": "^1.5.
|
|
88
|
+
"hls.js": "^1.5.19",
|
|
89
89
|
"mpegts.js": "1.7.3"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": {
|