@slidev/cli 0.30.2 → 0.31.2
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/dist/{build-23SNLQAJ.js → build-DHS7EAI7.js} +11 -11
- package/dist/{build-YFDGZUAK.mjs → build-HKOWIJTJ.mjs} +3 -3
- package/dist/{chunk-MBZTOLHN.mjs → chunk-55JD2XFU.mjs} +14 -12
- package/dist/{chunk-XMETW2MS.mjs → chunk-D6ZT4BYV.mjs} +47 -2
- package/dist/{chunk-O57F34AM.mjs → chunk-MRYU4L7C.mjs} +2 -2
- package/dist/{chunk-RSHUQSN4.js → chunk-N6ENRMDM.js} +69 -67
- package/dist/{chunk-IXNT7VMK.js → chunk-OVW2G2MH.js} +47 -6
- package/dist/chunk-U4YYUHKV.mjs +12685 -0
- package/dist/{chunk-E4IOOAKN.js → chunk-UGIPPIZX.js} +4 -4
- package/dist/chunk-ZN6VJBWP.js +12693 -0
- package/dist/cli.js +25 -25
- package/dist/cli.mjs +6 -6
- package/dist/{export-RFCVIBYE.mjs → export-HA4VXV3M.mjs} +22 -14
- package/dist/{export-AKEY52VC.js → export-JHHUB6BA.js} +25 -17
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/package.json +19 -20
- package/dist/chunk-2LNCAUCD.js +0 -13308
- package/dist/chunk-OII7IQD2.mjs +0 -13308
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUGIPPIZXjs = require('./chunk-UGIPPIZX.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,19 +8,19 @@ var _chunkE4IOOAKNjs = require('./chunk-E4IOOAKN.js');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkZN6VJBWPjs = require('./chunk-ZN6VJBWP.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkN6ENRMDMjs = require('./chunk-N6ENRMDM.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
|
|
20
20
|
|
|
21
21
|
// node/cli.ts
|
|
22
|
-
|
|
23
|
-
var import_fast_deep_equal =
|
|
22
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
23
|
+
var import_fast_deep_equal = _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkN6ENRMDMjs.require_fast_deep_equal.call(void 0, ));
|
|
24
24
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
25
25
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
26
26
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
38
38
|
"routerMode",
|
|
39
39
|
"fonts"
|
|
40
40
|
];
|
|
41
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
41
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkZN6VJBWPjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
42
42
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
43
43
|
alias: "p",
|
|
44
44
|
type: "number",
|
|
@@ -82,9 +82,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
82
82
|
async function initServer() {
|
|
83
83
|
if (server)
|
|
84
84
|
await server.close();
|
|
85
|
-
const options = await
|
|
85
|
+
const options = await _chunkZN6VJBWPjs.resolveOptions.call(void 0, { entry, theme }, "dev");
|
|
86
86
|
port = userPort || await findFreePort(3030);
|
|
87
|
-
server = await
|
|
87
|
+
server = await _chunkUGIPPIZXjs.createServer.call(void 0, options, {
|
|
88
88
|
server: {
|
|
89
89
|
port,
|
|
90
90
|
strictPort: true,
|
|
@@ -95,7 +95,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
95
95
|
logLevel: log
|
|
96
96
|
}, {
|
|
97
97
|
onDataReload(newData, data) {
|
|
98
|
-
if (!theme &&
|
|
98
|
+
if (!theme && _chunkZN6VJBWPjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkZN6VJBWPjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
99
99
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
100
100
|
initServer();
|
|
101
101
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -171,8 +171,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
171
171
|
type: "boolean",
|
|
172
172
|
describe: "allow download as PDF"
|
|
173
173
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
174
|
-
const { build } = await Promise.resolve().then(() =>
|
|
175
|
-
const options = await
|
|
174
|
+
const { build } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "./build-DHS7EAI7.js")));
|
|
175
|
+
const options = await _chunkZN6VJBWPjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
176
176
|
if (download && !options.data.config.download)
|
|
177
177
|
options.data.config.download = download;
|
|
178
178
|
printInfo(options);
|
|
@@ -185,26 +185,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
188
|
-
const data = await
|
|
189
|
-
|
|
190
|
-
await
|
|
188
|
+
const data = await _chunkZN6VJBWPjs.fs_exports.load(entry);
|
|
189
|
+
_chunkZN6VJBWPjs.fs_exports.prettify(data);
|
|
190
|
+
await _chunkZN6VJBWPjs.fs_exports.save(data);
|
|
191
191
|
});
|
|
192
192
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
193
193
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
194
194
|
type: "string",
|
|
195
195
|
default: "theme"
|
|
196
196
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
197
|
-
const data = await
|
|
198
|
-
const theme =
|
|
197
|
+
const data = await _chunkZN6VJBWPjs.fs_exports.load(entry);
|
|
198
|
+
const theme = _chunkZN6VJBWPjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
199
199
|
if (theme === "none") {
|
|
200
200
|
console.error('Can not eject theme "none"');
|
|
201
201
|
process.exit(1);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
203
|
+
if (_chunkZN6VJBWPjs.isPath.call(void 0, theme)) {
|
|
204
204
|
console.error("Theme is already ejected");
|
|
205
205
|
process.exit(1);
|
|
206
206
|
}
|
|
207
|
-
const roots =
|
|
207
|
+
const roots = _chunkZN6VJBWPjs.getThemeRoots.call(void 0, theme, entry);
|
|
208
208
|
if (!roots.length) {
|
|
209
209
|
console.error(`Does not found theme "${theme}"`);
|
|
210
210
|
process.exit(1);
|
|
@@ -216,7 +216,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
216
216
|
const dirPath = `./${dir}`;
|
|
217
217
|
data.slides[0].frontmatter.theme = dirPath;
|
|
218
218
|
data.slides[0].raw = null;
|
|
219
|
-
await
|
|
219
|
+
await _chunkZN6VJBWPjs.fs_exports.save(data);
|
|
220
220
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
221
221
|
});
|
|
222
222
|
}, () => {
|
|
@@ -258,17 +258,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
258
258
|
"with-clicks": withClicks
|
|
259
259
|
}) => {
|
|
260
260
|
process.env.NODE_ENV = "production";
|
|
261
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
261
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "./export-JHHUB6BA.js")));
|
|
262
262
|
const port = await findFreePort(12445);
|
|
263
|
-
const options = await
|
|
263
|
+
const options = await _chunkZN6VJBWPjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
264
264
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
265
|
-
const server = await
|
|
265
|
+
const server = await _chunkUGIPPIZXjs.createServer.call(void 0, options, {
|
|
266
266
|
server: { port },
|
|
267
267
|
clearScreen: false
|
|
268
268
|
});
|
|
269
269
|
await server.listen(port);
|
|
270
270
|
printInfo(options);
|
|
271
|
-
|
|
271
|
+
_chunkZN6VJBWPjs.fs_exports.filterDisabled(options.data);
|
|
272
272
|
const width = options.data.config.canvasWidth;
|
|
273
273
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
274
274
|
output = await exportSlides({
|
|
@@ -306,7 +306,7 @@ function printInfo(options, port, remote) {
|
|
|
306
306
|
console.log();
|
|
307
307
|
console.log();
|
|
308
308
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
309
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
309
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkZN6VJBWPjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
310
310
|
console.log();
|
|
311
311
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
312
312
|
console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MRYU4L7C.mjs";
|
|
4
4
|
import {
|
|
5
5
|
fs_exports,
|
|
6
6
|
getThemeRoots,
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
resolveOptions,
|
|
9
9
|
resolveThemeName,
|
|
10
10
|
version
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-U4YYUHKV.mjs";
|
|
12
12
|
import {
|
|
13
13
|
require_fast_deep_equal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-55JD2XFU.mjs";
|
|
15
15
|
import {
|
|
16
16
|
__dirname,
|
|
17
17
|
__require,
|
|
18
18
|
__toESM,
|
|
19
19
|
init_esm_shims
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-D6ZT4BYV.mjs";
|
|
21
21
|
|
|
22
22
|
// node/cli.ts
|
|
23
23
|
init_esm_shims();
|
|
@@ -172,7 +172,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
172
172
|
type: "boolean",
|
|
173
173
|
describe: "allow download as PDF"
|
|
174
174
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
175
|
-
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-
|
|
175
|
+
const { build } = await Promise.resolve().then(() => __toESM(__require("./build-HKOWIJTJ.mjs")));
|
|
176
176
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
177
177
|
if (download && !options.data.config.download)
|
|
178
178
|
options.data.config.download = download;
|
|
@@ -259,7 +259,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
259
259
|
"with-clicks": withClicks
|
|
260
260
|
}) => {
|
|
261
261
|
process.env.NODE_ENV = "production";
|
|
262
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
262
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-HA4VXV3M.mjs")));
|
|
263
263
|
const port = await findFreePort(12445);
|
|
264
264
|
const options = await resolveOptions({ entry, theme }, "build");
|
|
265
265
|
output = output || options.data.config.exportFilename || `${path.basename(entry, ".md")}-export`;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
packageExists
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U4YYUHKV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__require,
|
|
6
6
|
__toESM,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-D6ZT4BYV.mjs";
|
|
9
9
|
|
|
10
10
|
// node/export.ts
|
|
11
11
|
init_esm_shims();
|
|
@@ -116,31 +116,39 @@ async function exportSlides({
|
|
|
116
116
|
}
|
|
117
117
|
async function genPagePng() {
|
|
118
118
|
await go("print");
|
|
119
|
+
await fs.emptyDir(output);
|
|
119
120
|
const slides2 = await page.locator(".slide-container");
|
|
120
121
|
const count = await slides2.count();
|
|
121
122
|
for (let i = 0; i < count; i++) {
|
|
122
123
|
progress.update(i + 1);
|
|
124
|
+
let id = await slides2.nth(i).getAttribute("id") || "";
|
|
125
|
+
id = withClicks ? id : id.split("-")[0];
|
|
123
126
|
const buffer = await slides2.nth(i).screenshot();
|
|
124
|
-
await fs.
|
|
125
|
-
await fs.writeFile(path.join(output, `${(i + 1).toString().padStart(2, "0")}.png`), buffer);
|
|
127
|
+
await fs.writeFile(path.join(output, `${id}.png`), buffer);
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
async function genPageMd(
|
|
129
|
-
|
|
130
|
-
const mds =
|
|
131
|
-
|
|
132
|
-
const
|
|
130
|
+
async function genPageMd(slides2) {
|
|
131
|
+
const files = await fs.readdir(output);
|
|
132
|
+
const mds = files.map((file, i, files2) => {
|
|
133
|
+
var _a, _b, _c;
|
|
134
|
+
const slideIndex = getSlideIndex(file);
|
|
135
|
+
const mdImg = `![${(_a = slides2[slideIndex]) == null ? void 0 : _a.title}](./${path.join(output, file)})
|
|
133
136
|
|
|
134
137
|
`;
|
|
135
|
-
|
|
138
|
+
if ((i + 1 === files2.length || getSlideIndex(files2[i + 1]) !== slideIndex) && ((_b = slides2[slideIndex]) == null ? void 0 : _b.note))
|
|
139
|
+
return `${mdImg}${(_c = slides2[slideIndex]) == null ? void 0 : _c.note}
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
141
|
+
`;
|
|
142
|
+
return mdImg;
|
|
143
|
+
});
|
|
140
144
|
if (!output.endsWith(".md"))
|
|
141
145
|
output = `${output}.md`;
|
|
142
146
|
await fs.writeFile(output, mds.join(""));
|
|
143
147
|
}
|
|
148
|
+
function getSlideIndex(file) {
|
|
149
|
+
const slideId = file.substring(0, file.indexOf(".")).split("-")[0];
|
|
150
|
+
return Number(slideId) - 1;
|
|
151
|
+
}
|
|
144
152
|
progress.start(pages.length);
|
|
145
153
|
if (format === "pdf") {
|
|
146
154
|
await genPagePdf();
|
|
@@ -148,7 +156,7 @@ async function exportSlides({
|
|
|
148
156
|
await genPagePng();
|
|
149
157
|
} else if (format === "md") {
|
|
150
158
|
await genPagePng();
|
|
151
|
-
await genPageMd(
|
|
159
|
+
await genPageMd(slides);
|
|
152
160
|
} else {
|
|
153
161
|
throw new Error(`Unsupported exporting format "${format}"`);
|
|
154
162
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZN6VJBWPjs = require('./chunk-ZN6VJBWP.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
|
|
9
9
|
|
|
10
10
|
// node/export.ts
|
|
11
|
-
|
|
11
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
13
13
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
14
14
|
var _kolorist = require('kolorist');
|
|
@@ -62,10 +62,10 @@ async function exportSlides({
|
|
|
62
62
|
height = 1080,
|
|
63
63
|
withClicks = false
|
|
64
64
|
}) {
|
|
65
|
-
if (!
|
|
65
|
+
if (!_chunkZN6VJBWPjs.packageExists.call(void 0, "playwright-chromium"))
|
|
66
66
|
throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
|
|
67
67
|
const pages = _core.parseRangeString.call(void 0, total, range);
|
|
68
|
-
const { chromium } = await Promise.resolve().then(() =>
|
|
68
|
+
const { chromium } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "playwright-chromium")));
|
|
69
69
|
const browser = await chromium.launch();
|
|
70
70
|
const context = await browser.newContext({
|
|
71
71
|
viewport: {
|
|
@@ -116,31 +116,39 @@ async function exportSlides({
|
|
|
116
116
|
}
|
|
117
117
|
async function genPagePng() {
|
|
118
118
|
await go("print");
|
|
119
|
+
await _fsextra2.default.emptyDir(output);
|
|
119
120
|
const slides2 = await page.locator(".slide-container");
|
|
120
121
|
const count = await slides2.count();
|
|
121
122
|
for (let i = 0; i < count; i++) {
|
|
122
123
|
progress.update(i + 1);
|
|
124
|
+
let id = await slides2.nth(i).getAttribute("id") || "";
|
|
125
|
+
id = withClicks ? id : id.split("-")[0];
|
|
123
126
|
const buffer = await slides2.nth(i).screenshot();
|
|
124
|
-
await _fsextra2.default.
|
|
125
|
-
await _fsextra2.default.writeFile(_path2.default.join(output, `${(i + 1).toString().padStart(2, "0")}.png`), buffer);
|
|
127
|
+
await _fsextra2.default.writeFile(_path2.default.join(output, `${id}.png`), buffer);
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
async function genPageMd(
|
|
129
|
-
|
|
130
|
-
const mds =
|
|
131
|
-
|
|
132
|
-
const
|
|
130
|
+
async function genPageMd(slides2) {
|
|
131
|
+
const files = await _fsextra2.default.readdir(output);
|
|
132
|
+
const mds = files.map((file, i, files2) => {
|
|
133
|
+
var _a, _b, _c;
|
|
134
|
+
const slideIndex = getSlideIndex(file);
|
|
135
|
+
const mdImg = `![${(_a = slides2[slideIndex]) == null ? void 0 : _a.title}](./${_path2.default.join(output, file)})
|
|
133
136
|
|
|
134
137
|
`;
|
|
135
|
-
|
|
138
|
+
if ((i + 1 === files2.length || getSlideIndex(files2[i + 1]) !== slideIndex) && ((_b = slides2[slideIndex]) == null ? void 0 : _b.note))
|
|
139
|
+
return `${mdImg}${(_c = slides2[slideIndex]) == null ? void 0 : _c.note}
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
141
|
+
`;
|
|
142
|
+
return mdImg;
|
|
143
|
+
});
|
|
140
144
|
if (!output.endsWith(".md"))
|
|
141
145
|
output = `${output}.md`;
|
|
142
146
|
await _fsextra2.default.writeFile(output, mds.join(""));
|
|
143
147
|
}
|
|
148
|
+
function getSlideIndex(file) {
|
|
149
|
+
const slideId = file.substring(0, file.indexOf(".")).split("-")[0];
|
|
150
|
+
return Number(slideId) - 1;
|
|
151
|
+
}
|
|
144
152
|
progress.start(pages.length);
|
|
145
153
|
if (format === "pdf") {
|
|
146
154
|
await genPagePdf();
|
|
@@ -148,7 +156,7 @@ async function exportSlides({
|
|
|
148
156
|
await genPagePng();
|
|
149
157
|
} else if (format === "md") {
|
|
150
158
|
await genPagePng();
|
|
151
|
-
await genPageMd(
|
|
159
|
+
await genPageMd(slides);
|
|
152
160
|
} else {
|
|
153
161
|
throw new Error(`Unsupported exporting format "${format}"`);
|
|
154
162
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUGIPPIZXjs = require('./chunk-UGIPPIZX.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,20 +9,20 @@ var _chunkE4IOOAKNjs = require('./chunk-E4IOOAKN.js');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkZN6VJBWPjs = require('./chunk-ZN6VJBWP.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkN6ENRMDMjs = require('./chunk-N6ENRMDM.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
|
-
|
|
22
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
23
23
|
|
|
24
24
|
// node/declare.ts
|
|
25
|
-
|
|
25
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -34,4 +34,4 @@ _chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
exports.ViteSlidevPlugin =
|
|
37
|
+
exports.ViteSlidevPlugin = _chunkN6ENRMDMjs.ViteSlidevPlugin; exports.createServer = _chunkUGIPPIZXjs.createServer; exports.createWindiCSSPlugin = _chunkN6ENRMDMjs.createWindiCSSPlugin; exports.getCLIRoot = _chunkZN6VJBWPjs.getCLIRoot; exports.getClientRoot = _chunkZN6VJBWPjs.getClientRoot; exports.getThemeRoots = _chunkZN6VJBWPjs.getThemeRoots; exports.getUserRoot = _chunkZN6VJBWPjs.getUserRoot; exports.isPath = _chunkZN6VJBWPjs.isPath; exports.parser = _chunkZN6VJBWPjs.fs_exports; exports.resolveOptions = _chunkZN6VJBWPjs.resolveOptions;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MRYU4L7C.mjs";
|
|
4
4
|
import {
|
|
5
5
|
fs_exports,
|
|
6
6
|
getCLIRoot,
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
getUserRoot,
|
|
10
10
|
isPath,
|
|
11
11
|
resolveOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-U4YYUHKV.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ViteSlidevPlugin,
|
|
15
15
|
createWindiCSSPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-55JD2XFU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-D6ZT4BYV.mjs";
|
|
20
20
|
|
|
21
21
|
// node/index.ts
|
|
22
22
|
init_esm_shims();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.2",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"homepage": "https://sli.dev",
|
|
6
6
|
"bugs": "https://github.com/slidevjs/slidev/issues",
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@antfu/utils": "^0.5.1",
|
|
43
|
-
"@iconify-json/carbon": "^1.1.
|
|
43
|
+
"@iconify-json/carbon": "^1.1.4",
|
|
44
44
|
"@iconify-json/ph": "^1.1.1",
|
|
45
|
-
"@slidev/client": "0.
|
|
46
|
-
"@slidev/parser": "0.
|
|
47
|
-
"@slidev/types": "0.
|
|
48
|
-
"@vitejs/plugin-vue": "^2.3.
|
|
49
|
-
"@vue/compiler-sfc": "^3.2.
|
|
50
|
-
"cli-progress": "^3.
|
|
51
|
-
"codemirror": "^5.65.
|
|
45
|
+
"@slidev/client": "0.31.2",
|
|
46
|
+
"@slidev/parser": "0.31.2",
|
|
47
|
+
"@slidev/types": "0.31.2",
|
|
48
|
+
"@vitejs/plugin-vue": "^2.3.2",
|
|
49
|
+
"@vue/compiler-sfc": "^3.2.33",
|
|
50
|
+
"cli-progress": "^3.11.0",
|
|
51
|
+
"codemirror": "^5.65.3",
|
|
52
52
|
"connect": "^3.7.0",
|
|
53
53
|
"debug": "^4.3.4",
|
|
54
54
|
"fast-glob": "^3.2.11",
|
|
55
|
-
"fs-extra": "^10.0
|
|
55
|
+
"fs-extra": "^10.1.0",
|
|
56
56
|
"global-dirs": "^3.0.0",
|
|
57
57
|
"import-from": "^4.0.0",
|
|
58
58
|
"is-installed-globally": "^0.4.0",
|
|
@@ -60,27 +60,27 @@
|
|
|
60
60
|
"js-base64": "^3.7.2",
|
|
61
61
|
"katex": "^0.15.3",
|
|
62
62
|
"kolorist": "^1.5.1",
|
|
63
|
-
"markdown-it": "^
|
|
63
|
+
"markdown-it": "^13.0.1",
|
|
64
64
|
"markdown-it-footnote": "^3.0.3",
|
|
65
65
|
"markdown-it-link-attributes": "^4.0.0",
|
|
66
66
|
"monaco-editor": "^0.33.0",
|
|
67
|
-
"nanoid": "^3.3.
|
|
67
|
+
"nanoid": "^3.3.4",
|
|
68
68
|
"open": "^8.4.0",
|
|
69
69
|
"plantuml-encoder": "^1.4.0",
|
|
70
|
-
"prismjs": "^1.
|
|
70
|
+
"prismjs": "^1.28.0",
|
|
71
71
|
"prompts": "^2.4.2",
|
|
72
72
|
"resolve": "^1.22.0",
|
|
73
73
|
"resolve-from": "^5.0.0",
|
|
74
74
|
"resolve-global": "^1.0.0",
|
|
75
75
|
"shiki": "^0.10.1",
|
|
76
|
-
"unplugin-icons": "^0.14.
|
|
77
|
-
"unplugin-vue-components": "^0.19.
|
|
78
|
-
"vite": "^2.9.
|
|
79
|
-
"vite-plugin-md": "^0.
|
|
76
|
+
"unplugin-icons": "^0.14.3",
|
|
77
|
+
"unplugin-vue-components": "^0.19.3",
|
|
78
|
+
"vite": "^2.9.8",
|
|
79
|
+
"vite-plugin-md": "^0.13.0",
|
|
80
80
|
"vite-plugin-remote-assets": "^0.2.2",
|
|
81
81
|
"vite-plugin-vue-server-ref": "^0.2.4",
|
|
82
82
|
"vite-plugin-windicss": "^1.8.4",
|
|
83
|
-
"vue": "^3.2.
|
|
83
|
+
"vue": "^3.2.33",
|
|
84
84
|
"windicss": "^3.5.1",
|
|
85
85
|
"yargs": "^17.4.1"
|
|
86
86
|
},
|
|
@@ -97,6 +97,5 @@
|
|
|
97
97
|
"build": "rimraf dist && tsup node/index.ts node/cli.ts --dts --format cjs,esm --splitting --external @slidev/client/package.json",
|
|
98
98
|
"dev": "nr build --watch",
|
|
99
99
|
"start": "esno node/cli.ts"
|
|
100
|
-
}
|
|
101
|
-
"readme": "<br>\n<p align=\"center\">\n<a href=\"https://sli.dev\" target=\"_blank\">\n<img src=\"https://sli.dev/logo-title.png\" alt=\"Slidev\" height=\"250\" width=\"250\"/>\n</a>\n</p>\n\n<p align=\"center\">\nPresentation <b>slide</b>s for <b>dev</b>elopers 🧑💻👩💻👨💻\n</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@slidev/cli\" target=\"__blank\"><img src=\"https://img.shields.io/npm/v/@slidev/cli?color=2B90B6&label=\" alt=\"NPM version\"></a>\n<a href=\"https://www.npmjs.com/package/@slidev/cli\" target=\"__blank\"><img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/@slidev/cli?color=349dbe&label=\"></a>\n<a href=\"https://sli.dev/\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=&message=docs%20%26%20demos&color=45b8cd\" alt=\"Docs & Demos\"></a>\n<a href=\"https://sli.dev/themes/gallery.html\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=&message=themes&color=4ec5d4\" alt=\"Themes\"></a>\n<br>\n<a href=\"https://github.com/slidevjs/slidev\" target=\"__blank\"><img alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/slidevjs/slidev?style=social\"></a>\n</p>\n\n<p align=\"center\">\n <a href=\"https://twitter.com/antfu7/status/1389604687502995457\">Video Preview</a> | <a href=\"https://sli.dev\">Documentation</a>\n</p>\n\n<div align=\"center\">\n<table>\n<tbody>\n<td align=\"center\">\n<img width=\"2000\" height=\"0\"><br>\nStatus: <b>Public Beta 🎉</b><br>\n<sub>Made possible by my <a href=\"https://github.com/sponsors/antfu\">Sponsor Program 💖</a></sub><br>\n<img width=\"2000\" height=\"0\">\n</td>\n</tbody>\n</table>\n</div>\n\n## Features\n\n- 📝 [**Markdown-based**](https://sli.dev/guide/syntax.html) - use your favorite editors and workflow\n- 🧑💻 [**Developer Friendly**](https://sli.dev/guide/syntax.html#code-blocks) - built-in syntax highlighting, live coding, etc.\n- 🎨 [**Themable**](https://sli.dev/themes/gallery.html) - theme can be shared and used with npm packages.\n- 🌈 [**Stylish**](https://sli.dev/guide/syntax.html#embedded-styles) - [Windi CSS](https://windicss.org/) on-demand utilities, easy-to-use embedded stylesheets.\n- 🤹 [**Interactive**](https://sli.dev/custom/directory-structure.html#components) - embedding Vue components seamlessly.\n- 🎙 [**Presenter Mode**](https://sli.dev/guide/presenter-mode.html) - use another window, or even your phone to control your slides.\n- 🧮 [**LaTeX**](https://sli.dev/guide/syntax.html#latex) - built-in LaTeX math equations support.\n- 📰 [**Diagrams**](https://sli.dev/guide/syntax.html#diagrams) - creates diagrams with textual descriptions\n- 🌟 [**Icons**](https://sli.dev/guide/syntax.html#icons) - access to icons from any iconset directly.\n- 💻 [**Editors**](https://sli.dev/guide/editors.html) - integrated editor, or [extension for VS Code](https://github.com/slidevjs/slidev-vscode)\n- 🎥 [**Recording**](https://sli.dev/guide/recording.html) - built-in recording and camera view.\n- 📤 [**Portable**](https://sli.dev/guide/exporting.html) - export into PDF, PNGs, or even a hostable SPA.\n- ⚡️ [**Fast**](https://vitejs.dev) - instant reloading powered by [Vite](https://vitejs.dev).\n- 🛠 [**Hackable**](https://sli.dev/custom/config-vite.html) - using Vite plugins, Vue components, or any npm packages.\n\n## Getting Started\n\n### Try it Online ⚡️\n\n[sli.dev/new](https://sli.dev/new)\n\n[](https://sli.dev/new)\n\n### Init Project Locally\n\nInstall [Node.js >=14](https://nodejs.org/) and run the following command:\n\n```bash\nnpm init slidev\n```\n\nDocumentations:\n**[English](https://sli.dev)** | [中文文档](https://cn.sli.dev) | [Français](https://fr.sli.dev) | [Español](https://es.sli.dev) | [Русский](https://ru.sli.dev) | [Português-BR](https://br.sli.dev)\n\nDiscord: [chat.sli.dev](https://chat.sli.dev)\n\nFor a full example, you can check the [demo](https://github.com/slidevjs/slidev/blob/main/demo) folder, which is also the source file for [my previous talk](https://antfu.me/posts/composable-vue-vueday-2021).\n\n## Tech Stack\n\n- [Vite](https://vitejs.dev) - An extremely fast frontend tooling\n- [Vue 3](https://v3.vuejs.org/) powered [Markdown](https://daringfireball.net/projects/markdown/syntax) - Focus on the content while having the power of HTML and Vue components whenever needed\n- [Windi CSS](https://github.com/windicss/windicss) - On-demand utility-first CSS framework, style your slides at ease\n- [Prism](https://github.com/PrismJS/prism), [Shiki](https://github.com/shikijs/shiki), [Monaco Editor](https://github.com/Microsoft/monaco-editor) - First-class code snippets support with live coding capability\n- [RecordRTC](https://recordrtc.org) - Built-in recording and camera view\n- [VueUse](https://vueuse.org) family - [`@vueuse/core`](https://github.com/vueuse/vueuse), [`@vueuse/head`](https://github.com/vueuse/head), [`@vueuse/motion`](https://github.com/vueuse/motion), etc.\n- [Iconify](https://iconify.design/) - Iconsets collection.\n- [Drauu](https://github.com/antfu/drauu) - Drawing and annotations support\n- [KaTeX](https://katex.org/) - LaTeX math rendering.\n- [Mermaid](https://mermaid-js.github.io/mermaid) - Textual Diagrams.\n\n## Sponsors\n\nThis project is made possible by all the sponsors supporting my work:\n\n<p align=\"center\">\n <a href=\"https://github.com/sponsors/antfu\">\n <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>\n </a>\n</p>\n\n## License\n\nMIT License © 2021 [Anthony Fu](https://github.com/antfu)\n"
|
|
100
|
+
}
|
|
102
101
|
}
|