@slidev/cli 0.49.16 → 0.49.18
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/README.md +15 -14
- package/bin/slidev.mjs +1 -1
- package/dist/{build-3WHK3B4C.mjs → build-WV74WRXR.js} +5 -3
- package/dist/{chunk-27Q2X57X.mjs → chunk-2BABGNMX.js} +1 -29
- package/dist/chunk-6DS3IPOB.js +31 -0
- package/dist/chunk-JSBRDJBE.js +30 -0
- package/dist/{chunk-75T3CMVM.mjs → chunk-LY5CYMWF.js} +1497 -1552
- package/dist/{chunk-Q2HOAG35.mjs → chunk-ZVBQP5II.js} +2 -2
- package/dist/{cli.mjs → cli.js} +30 -20
- package/dist/{export-ZRMOIVNM.mjs → export-TPYQNCSS.js} +2 -1
- package/dist/{index.d.mts → index.d.ts} +5 -5
- package/dist/{index.mjs → index.js} +5 -3
- package/dist/markdown-it-prism-GWSWY6QQ.js +108 -0
- package/package.json +26 -26
- package/template.md +2 -2
- /package/dist/{cli.d.mts → cli.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -36,20 +36,21 @@ Presentation <b>slide</b>s for <b>dev</b>elopers 🧑💻👩💻👨
|
|
|
36
36
|
|
|
37
37
|
## Features
|
|
38
38
|
|
|
39
|
-
- 📝 [**Markdown-based**](https://sli.dev/guide/syntax
|
|
40
|
-
- 🧑💻 [**Developer Friendly**](https://sli.dev/guide/syntax
|
|
41
|
-
- 🎨 [**Themable**](https://sli.dev/
|
|
42
|
-
- 🌈 [**Stylish**](https://sli.dev/guide/syntax
|
|
43
|
-
- 🤹 [**Interactive**](https://sli.dev/custom/directory-structure
|
|
44
|
-
- 🎙 [**Presenter Mode**](https://sli.dev/guide/presenter-mode
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
39
|
+
- 📝 [**Markdown-based**](https://sli.dev/guide/syntax) - foucus on content and use your favorite editor
|
|
40
|
+
- 🧑💻 [**Developer Friendly**](https://sli.dev/guide/syntax#code-blocks) - built-in code highlighting, live coding, etc.
|
|
41
|
+
- 🎨 [**Themable**](https://sli.dev/resources/theme-gallery) - theme can be shared and used with npm packages
|
|
42
|
+
- 🌈 [**Stylish**](https://sli.dev/guide/syntax#embedded-styles) - on-demand utilities via [UnoCSS](https://github.com/unocss/unocss).
|
|
43
|
+
- 🤹 [**Interactive**](https://sli.dev/custom/directory-structure#components) - embedding Vue components seamlessly
|
|
44
|
+
- 🎙 [**Presenter Mode**](https://sli.dev/guide/ui#presenter-mode) - use another window, or even your phone to control your slides
|
|
45
|
+
- 🎨 [**Drawing**](https://sli.dev/features/drawing) - draw and annotate on your slides
|
|
46
|
+
- 🧮 [**LaTeX**](https://sli.dev/features/latex) - built-in LaTeX math equations support
|
|
47
|
+
- 📰 [**Diagrams**](https://sli.dev/guide/syntax#diagrams) - creates diagrams using textual descriptions with [Mermaid.js](https://mermaid.js.org/)
|
|
48
|
+
- 🌟 [**Icons**](https://sli.dev/features/icons) - access to icons from any icon set directly
|
|
49
|
+
- 💻 [**Editor**](https://sli.dev/guide/index#editor) - integrated editor, or the [VSCode extension](https://sli.dev/features/vscode-extension)
|
|
50
|
+
- 🎥 [**Recording**](https://sli.dev/features/recording) - built-in recording and camera view
|
|
51
|
+
- 📤 [**Portable**](https://sli.dev/guide/exporting) - export into PDF, PNGs, or PPTX
|
|
52
|
+
- ⚡️ [**Fast**](https://vitejs.dev) - instant reloading powered by [Vite](https://vitejs.dev)
|
|
53
|
+
- 🛠 [**Hackable**](https://sli.dev/custom/) - using Vite plugins, Vue components, or any npm packages
|
|
53
54
|
|
|
54
55
|
## Getting Started
|
|
55
56
|
|
package/bin/slidev.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIndexHtml,
|
|
3
3
|
resolveViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-LY5CYMWF.js";
|
|
5
|
+
import "./chunk-6DS3IPOB.js";
|
|
6
|
+
import "./chunk-2BABGNMX.js";
|
|
7
|
+
import "./chunk-JSBRDJBE.js";
|
|
6
8
|
|
|
7
9
|
// node/commands/build.ts
|
|
8
10
|
import { resolve } from "node:path";
|
|
@@ -51,7 +53,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
51
53
|
await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
52
54
|
`, "utf-8");
|
|
53
55
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
54
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
56
|
+
const { exportSlides, getExportOptions } = await import("./export-TPYQNCSS.js");
|
|
55
57
|
const port = 12445;
|
|
56
58
|
const app = connect();
|
|
57
59
|
const server = http.createServer(app);
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
1
|
// node/resolver.ts
|
|
28
2
|
import { dirname, join, relative, resolve } from "node:path";
|
|
29
3
|
import * as fs from "node:fs";
|
|
@@ -94,7 +68,7 @@ async function resolveEntry(entryRaw) {
|
|
|
94
68
|
else
|
|
95
69
|
process.exit(0);
|
|
96
70
|
}
|
|
97
|
-
return entry;
|
|
71
|
+
return slash(entry);
|
|
98
72
|
}
|
|
99
73
|
function createResolver(type, officials) {
|
|
100
74
|
async function promptForInstallation(pkgName) {
|
|
@@ -206,8 +180,6 @@ async function getRoots(entry) {
|
|
|
206
180
|
}
|
|
207
181
|
|
|
208
182
|
export {
|
|
209
|
-
__commonJS,
|
|
210
|
-
__toESM,
|
|
211
183
|
isInstalledGlobally,
|
|
212
184
|
resolveImportUrl,
|
|
213
185
|
toAtFS,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// node/syntax/transform/utils.ts
|
|
2
|
+
function normalizeRangeStr(rangeStr = "") {
|
|
3
|
+
return !rangeStr.trim() ? [] : rangeStr.trim().split(/\|/g).map((i) => i.trim());
|
|
4
|
+
}
|
|
5
|
+
function getCodeBlocks(md) {
|
|
6
|
+
const codeblocks = Array.from(md.matchAll(/^```[\s\S]*?^```/gm)).map((m) => {
|
|
7
|
+
const start = m.index;
|
|
8
|
+
const end = m.index + m[0].length;
|
|
9
|
+
const startLine = md.slice(0, start).match(/\n/g)?.length || 0;
|
|
10
|
+
const endLine = md.slice(0, end).match(/\n/g)?.length || 0;
|
|
11
|
+
return [start, end, startLine, endLine];
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
codeblocks,
|
|
15
|
+
isInsideCodeblocks(idx) {
|
|
16
|
+
return codeblocks.some(([s, e]) => s <= idx && idx <= e);
|
|
17
|
+
},
|
|
18
|
+
isLineInsideCodeblocks(line) {
|
|
19
|
+
return codeblocks.some(([, , s, e]) => s <= line && line <= e);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function escapeVueInCode(md) {
|
|
24
|
+
return md.replace(/\{\{/g, "{{");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
normalizeRangeStr,
|
|
29
|
+
getCodeBlocks,
|
|
30
|
+
escapeVueInCode
|
|
31
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
__commonJS,
|
|
29
|
+
__toESM
|
|
30
|
+
};
|