@slidev/cli 52.12.0 → 52.14.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/dist/{build-DencOEqt.mjs → build-BjxavfkV.mjs} +1 -1
- package/dist/cli.mjs +49 -34
- package/dist/index.mjs +2 -2
- package/dist/{serve-BptRm0xv.mjs → serve-BLr_JRSb.mjs} +1 -1
- package/dist/{shared-mR4BGOPs.mjs → shared-DA_39LFQ.mjs} +178 -21
- package/package.json +22 -22
- package/skills/slidev/SKILL.md +2 -2
- package/skills/slidev/references/code-groups.md +2 -2
- package/skills/slidev/references/core-syntax.md +2 -2
- package/skills/slidev/references/syntax-mdc.md +5 -5
- package/template.md +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./resolver-B4CxEjJF.mjs";
|
|
2
|
-
import { t as resolveViteConfigs } from "./shared-
|
|
2
|
+
import { t as resolveViteConfigs } from "./shared-DA_39LFQ.mjs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { build as build$1 } from "vite";
|
|
5
5
|
import { existsSync } from "node:fs";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as resolveEntry, n as getRoots, r as isInstalledGlobally } from "./resolver-B4CxEjJF.mjs";
|
|
2
|
-
import { a as parser, c as resolveAddons, d as updateFrontmatterPatch, i as resolveOptions, l as version, o as getThemeMeta, s as resolveTheme, u as loadSetups } from "./shared-
|
|
3
|
-
import { t as createServer } from "./serve-
|
|
2
|
+
import { a as parser, c as resolveAddons, d as updateFrontmatterPatch, i as resolveOptions, l as version, o as getThemeMeta, s as resolveTheme, u as loadSetups } from "./shared-DA_39LFQ.mjs";
|
|
3
|
+
import { t as createServer } from "./serve-BLr_JRSb.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
@@ -288,7 +288,7 @@ cli.command("build [entry..]", "Build hostable SPA", (args) => exportOptions(com
|
|
|
288
288
|
describe: "enable the inspect plugin for debugging"
|
|
289
289
|
}).strict().help(), async (args) => {
|
|
290
290
|
const { entry, theme, base, download, out, inspect, "without-notes": withoutNotes } = args;
|
|
291
|
-
const { build } = await import("./build-
|
|
291
|
+
const { build } = await import("./build-BjxavfkV.mjs");
|
|
292
292
|
for (const entryFile of entry) {
|
|
293
293
|
const options = await resolveOptions({
|
|
294
294
|
entry: entryFile,
|
|
@@ -353,7 +353,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
353
353
|
cli.command("export [entry..]", "Export slides to PDF", (args) => exportOptions(commonOptions(args)).strict().help(), async (args) => {
|
|
354
354
|
const { entry, theme } = args;
|
|
355
355
|
const { exportSlides, getExportOptions } = await import("./export-C4evmDwN.mjs");
|
|
356
|
-
const
|
|
356
|
+
const candidatePort = await getPort(12445);
|
|
357
357
|
let warned = false;
|
|
358
358
|
for (const entryFile of entry) {
|
|
359
359
|
const options = await resolveOptions({
|
|
@@ -365,21 +365,26 @@ cli.command("export [entry..]", "Export slides to PDF", (args) => exportOptions(
|
|
|
365
365
|
console.log(cyanBright("[Slidev] Try the new browser exporter!"));
|
|
366
366
|
console.log(cyanBright("You can use the browser exporter instead by starting the dev server as normal and visit"), `${blue("localhost:")}${dim("<port>")}${blue("/export")}\n`);
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
port
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
368
|
+
let server;
|
|
369
|
+
try {
|
|
370
|
+
server = await createServer(options, {
|
|
371
|
+
server: { port: candidatePort },
|
|
372
|
+
clearScreen: false
|
|
373
|
+
});
|
|
374
|
+
await server.listen(candidatePort);
|
|
375
|
+
const port = getViteServerPort(server);
|
|
376
|
+
printInfo(options);
|
|
377
|
+
const result = await exportSlides({
|
|
378
|
+
port,
|
|
379
|
+
...getExportOptions({
|
|
380
|
+
...args,
|
|
381
|
+
entry: entryFile
|
|
382
|
+
}, options)
|
|
383
|
+
});
|
|
384
|
+
console.log(`${green(" ✓ ")}${dim("exported to ")}${result}\n`);
|
|
385
|
+
} finally {
|
|
386
|
+
await server?.close();
|
|
387
|
+
}
|
|
383
388
|
}
|
|
384
389
|
process.exit(0);
|
|
385
390
|
});
|
|
@@ -400,27 +405,37 @@ cli.command("export-notes [entry..]", "Export slide notes to PDF", (args) => arg
|
|
|
400
405
|
describe: "wait for the specified ms before exporting"
|
|
401
406
|
}).strict().help(), async ({ entry, output, timeout, wait }) => {
|
|
402
407
|
const { exportNotes } = await import("./export-C4evmDwN.mjs");
|
|
403
|
-
const
|
|
408
|
+
const candidatePort = await getPort(12445);
|
|
404
409
|
for (const entryFile of entry) {
|
|
405
410
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
port
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
411
|
+
let server;
|
|
412
|
+
try {
|
|
413
|
+
server = await createServer(options, {
|
|
414
|
+
server: { port: candidatePort },
|
|
415
|
+
clearScreen: false
|
|
416
|
+
});
|
|
417
|
+
await server.listen(candidatePort);
|
|
418
|
+
const port = getViteServerPort(server);
|
|
419
|
+
printInfo(options);
|
|
420
|
+
const result = await exportNotes({
|
|
421
|
+
port,
|
|
422
|
+
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${path.basename(entryFile, ".md")}-export-notes`),
|
|
423
|
+
timeout,
|
|
424
|
+
wait
|
|
425
|
+
});
|
|
426
|
+
console.log(`${green(" ✓ ")}${dim("exported to ")}${result}\n`);
|
|
427
|
+
} finally {
|
|
428
|
+
await server?.close();
|
|
429
|
+
}
|
|
420
430
|
}
|
|
421
431
|
process.exit(0);
|
|
422
432
|
});
|
|
423
433
|
cli.help().parse();
|
|
434
|
+
function getViteServerPort(server) {
|
|
435
|
+
const address = server.httpServer?.address();
|
|
436
|
+
if (address && typeof address === "object") return address.port;
|
|
437
|
+
throw new Error("Failed to get Vite server port");
|
|
438
|
+
}
|
|
424
439
|
function commonOptions(args) {
|
|
425
440
|
return args.positional("entry", {
|
|
426
441
|
default: "slides.md",
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./resolver-B4CxEjJF.mjs";
|
|
2
|
-
import { a as parser, i as resolveOptions, n as ViteSlidevPlugin, r as createDataUtils } from "./shared-
|
|
3
|
-
import { t as createServer } from "./serve-
|
|
2
|
+
import { a as parser, i as resolveOptions, n as ViteSlidevPlugin, r as createDataUtils } from "./shared-DA_39LFQ.mjs";
|
|
3
|
+
import { t as createServer } from "./serve-BLr_JRSb.mjs";
|
|
4
4
|
|
|
5
5
|
export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
|
|
@@ -2,7 +2,7 @@ import { a as resolveImportPath, c as toAtFS, i as resolveEntry, n as getRoots,
|
|
|
2
2
|
import { builtinModules } from "node:module";
|
|
3
3
|
import path, { basename, dirname, join, relative, resolve } from "node:path";
|
|
4
4
|
import { loadConfigFromFile, mergeConfig } from "vite";
|
|
5
|
-
import
|
|
5
|
+
import MarkdownExit from "markdown-exit";
|
|
6
6
|
import fs, { existsSync } from "node:fs";
|
|
7
7
|
import fs$1, { readFile } from "node:fs/promises";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -21,17 +21,15 @@ import fg from "fast-glob";
|
|
|
21
21
|
import { createDebug } from "obug";
|
|
22
22
|
import pm from "picomatch";
|
|
23
23
|
import { satisfies } from "semver";
|
|
24
|
-
import { escapeHtml } from "markdown-it/lib/common/utils.mjs";
|
|
25
24
|
import { createHead, extractUnheadInputFromHtml, transformHtmlTemplate } from "unhead/server";
|
|
26
|
-
import {
|
|
25
|
+
import { createBundledHighlighter, createSingletonShorthands } from "shiki/core";
|
|
27
26
|
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
28
27
|
import { bundledLanguages, bundledThemes } from "shiki";
|
|
29
28
|
import katex from "katex";
|
|
30
29
|
import MagicString from "magic-string-stack";
|
|
31
30
|
import Markdown from "unplugin-vue-markdown/vite";
|
|
32
|
-
import
|
|
31
|
+
import MarkdownItComark from "@comark/markdown-it";
|
|
33
32
|
import MarkdownItFootnote from "markdown-it-footnote";
|
|
34
|
-
import MarkdownItMdc from "markdown-it-mdc";
|
|
35
33
|
import { fromAsyncCodeToHtml } from "@shikijs/markdown-it/async";
|
|
36
34
|
import { SourceMapConsumer } from "source-map-js";
|
|
37
35
|
import lz from "lz-string";
|
|
@@ -505,7 +503,7 @@ function createLayoutWrapperPlugin({ data, utils }) {
|
|
|
505
503
|
|
|
506
504
|
//#endregion
|
|
507
505
|
//#region package.json
|
|
508
|
-
var version = "52.
|
|
506
|
+
var version = "52.14.0";
|
|
509
507
|
|
|
510
508
|
//#endregion
|
|
511
509
|
//#region node/integrations/addons.ts
|
|
@@ -547,6 +545,9 @@ async function getThemeMeta(name, root) {
|
|
|
547
545
|
|
|
548
546
|
//#endregion
|
|
549
547
|
//#region node/setups/indexHtml.ts
|
|
548
|
+
function escapeHtml(str) {
|
|
549
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
550
|
+
}
|
|
550
551
|
function toAttrValue(unsafe) {
|
|
551
552
|
return JSON.stringify(escapeHtml(String(unsafe)));
|
|
552
553
|
}
|
|
@@ -784,7 +785,7 @@ async function setupShiki(roots) {
|
|
|
784
785
|
console.warn("[slidev] `loadTheme` in `setup/shiki.ts` is deprecated. Pass directly the theme name it's supported by Shiki. For custom themes, load it manually via `JSON.parse(fs.readFileSync(path, 'utf-8'))` and pass the raw JSON object instead.");
|
|
785
786
|
return JSON.parse(await fs$1.readFile(path$1, "utf-8"));
|
|
786
787
|
} }]));
|
|
787
|
-
const createHighlighter =
|
|
788
|
+
const createHighlighter = createBundledHighlighter({
|
|
788
789
|
engine: createJavaScriptRegexEngine,
|
|
789
790
|
langs: languageInput,
|
|
790
791
|
themes: themeInput
|
|
@@ -1384,7 +1385,7 @@ const templates = [
|
|
|
1384
1385
|
//#region node/vite/loaders.ts
|
|
1385
1386
|
function createSlidesLoader(options, serverOptions) {
|
|
1386
1387
|
const { data, mode, utils, withoutNotes } = options;
|
|
1387
|
-
const notesMd =
|
|
1388
|
+
const notesMd = MarkdownExit({ html: true });
|
|
1388
1389
|
notesMd.use(MarkdownItLink);
|
|
1389
1390
|
if (data.features.katex) notesMd.use(MarkdownItKatex, utils.katexOptions);
|
|
1390
1391
|
const hmrSlidesIndexes = /* @__PURE__ */ new Set();
|
|
@@ -1641,7 +1642,7 @@ function createSlidesLoader(options, serverOptions) {
|
|
|
1641
1642
|
}
|
|
1642
1643
|
|
|
1643
1644
|
//#endregion
|
|
1644
|
-
//#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=
|
|
1645
|
+
//#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_0dce998d26f79c06311f476731d22630/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/image-size/specialCharacters.js
|
|
1645
1646
|
var SpecialCharacters;
|
|
1646
1647
|
(function(SpecialCharacters$1) {
|
|
1647
1648
|
SpecialCharacters$1[SpecialCharacters$1["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
|
|
@@ -1658,7 +1659,163 @@ var SpecialCharacters;
|
|
|
1658
1659
|
})(SpecialCharacters || (SpecialCharacters = {}));
|
|
1659
1660
|
|
|
1660
1661
|
//#endregion
|
|
1661
|
-
//#region ../../node_modules/.pnpm
|
|
1662
|
+
//#region ../../node_modules/.pnpm/markdown-it@14.1.1/node_modules/markdown-it/lib/token.mjs
|
|
1663
|
+
/**
|
|
1664
|
+
* class Token
|
|
1665
|
+
**/
|
|
1666
|
+
/**
|
|
1667
|
+
* new Token(type, tag, nesting)
|
|
1668
|
+
*
|
|
1669
|
+
* Create new token and fill passed properties.
|
|
1670
|
+
**/
|
|
1671
|
+
function Token(type, tag, nesting) {
|
|
1672
|
+
/**
|
|
1673
|
+
* Token#type -> String
|
|
1674
|
+
*
|
|
1675
|
+
* Type of the token (string, e.g. "paragraph_open")
|
|
1676
|
+
**/
|
|
1677
|
+
this.type = type;
|
|
1678
|
+
/**
|
|
1679
|
+
* Token#tag -> String
|
|
1680
|
+
*
|
|
1681
|
+
* html tag name, e.g. "p"
|
|
1682
|
+
**/
|
|
1683
|
+
this.tag = tag;
|
|
1684
|
+
/**
|
|
1685
|
+
* Token#attrs -> Array
|
|
1686
|
+
*
|
|
1687
|
+
* Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
|
|
1688
|
+
**/
|
|
1689
|
+
this.attrs = null;
|
|
1690
|
+
/**
|
|
1691
|
+
* Token#map -> Array
|
|
1692
|
+
*
|
|
1693
|
+
* Source map info. Format: `[ line_begin, line_end ]`
|
|
1694
|
+
**/
|
|
1695
|
+
this.map = null;
|
|
1696
|
+
/**
|
|
1697
|
+
* Token#nesting -> Number
|
|
1698
|
+
*
|
|
1699
|
+
* Level change (number in {-1, 0, 1} set), where:
|
|
1700
|
+
*
|
|
1701
|
+
* - `1` means the tag is opening
|
|
1702
|
+
* - `0` means the tag is self-closing
|
|
1703
|
+
* - `-1` means the tag is closing
|
|
1704
|
+
**/
|
|
1705
|
+
this.nesting = nesting;
|
|
1706
|
+
/**
|
|
1707
|
+
* Token#level -> Number
|
|
1708
|
+
*
|
|
1709
|
+
* nesting level, the same as `state.level`
|
|
1710
|
+
**/
|
|
1711
|
+
this.level = 0;
|
|
1712
|
+
/**
|
|
1713
|
+
* Token#children -> Array
|
|
1714
|
+
*
|
|
1715
|
+
* An array of child nodes (inline and img tokens)
|
|
1716
|
+
**/
|
|
1717
|
+
this.children = null;
|
|
1718
|
+
/**
|
|
1719
|
+
* Token#content -> String
|
|
1720
|
+
*
|
|
1721
|
+
* In a case of self-closing tag (code, html, fence, etc.),
|
|
1722
|
+
* it has contents of this tag.
|
|
1723
|
+
**/
|
|
1724
|
+
this.content = "";
|
|
1725
|
+
/**
|
|
1726
|
+
* Token#markup -> String
|
|
1727
|
+
*
|
|
1728
|
+
* '*' or '_' for emphasis, fence string for fence, etc.
|
|
1729
|
+
**/
|
|
1730
|
+
this.markup = "";
|
|
1731
|
+
/**
|
|
1732
|
+
* Token#info -> String
|
|
1733
|
+
*
|
|
1734
|
+
* Additional information:
|
|
1735
|
+
*
|
|
1736
|
+
* - Info string for "fence" tokens
|
|
1737
|
+
* - The value "auto" for autolink "link_open" and "link_close" tokens
|
|
1738
|
+
* - The string value of the item marker for ordered-list "list_item_open" tokens
|
|
1739
|
+
**/
|
|
1740
|
+
this.info = "";
|
|
1741
|
+
/**
|
|
1742
|
+
* Token#meta -> Object
|
|
1743
|
+
*
|
|
1744
|
+
* A place for plugins to store an arbitrary data
|
|
1745
|
+
**/
|
|
1746
|
+
this.meta = null;
|
|
1747
|
+
/**
|
|
1748
|
+
* Token#block -> Boolean
|
|
1749
|
+
*
|
|
1750
|
+
* True for block-level tokens, false for inline tokens.
|
|
1751
|
+
* Used in renderer to calculate line breaks
|
|
1752
|
+
**/
|
|
1753
|
+
this.block = false;
|
|
1754
|
+
/**
|
|
1755
|
+
* Token#hidden -> Boolean
|
|
1756
|
+
*
|
|
1757
|
+
* If it's true, ignore this element when rendering. Used for tight lists
|
|
1758
|
+
* to hide paragraphs.
|
|
1759
|
+
**/
|
|
1760
|
+
this.hidden = false;
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Token.attrIndex(name) -> Number
|
|
1764
|
+
*
|
|
1765
|
+
* Search attribute index by name.
|
|
1766
|
+
**/
|
|
1767
|
+
Token.prototype.attrIndex = function attrIndex(name) {
|
|
1768
|
+
if (!this.attrs) return -1;
|
|
1769
|
+
const attrs = this.attrs;
|
|
1770
|
+
for (let i = 0, len = attrs.length; i < len; i++) if (attrs[i][0] === name) return i;
|
|
1771
|
+
return -1;
|
|
1772
|
+
};
|
|
1773
|
+
/**
|
|
1774
|
+
* Token.attrPush(attrData)
|
|
1775
|
+
*
|
|
1776
|
+
* Add `[ name, value ]` attribute to list. Init attrs if necessary
|
|
1777
|
+
**/
|
|
1778
|
+
Token.prototype.attrPush = function attrPush(attrData) {
|
|
1779
|
+
if (this.attrs) this.attrs.push(attrData);
|
|
1780
|
+
else this.attrs = [attrData];
|
|
1781
|
+
};
|
|
1782
|
+
/**
|
|
1783
|
+
* Token.attrSet(name, value)
|
|
1784
|
+
*
|
|
1785
|
+
* Set `name` attribute to `value`. Override old value if exists.
|
|
1786
|
+
**/
|
|
1787
|
+
Token.prototype.attrSet = function attrSet(name, value) {
|
|
1788
|
+
const idx = this.attrIndex(name);
|
|
1789
|
+
const attrData = [name, value];
|
|
1790
|
+
if (idx < 0) this.attrPush(attrData);
|
|
1791
|
+
else this.attrs[idx] = attrData;
|
|
1792
|
+
};
|
|
1793
|
+
/**
|
|
1794
|
+
* Token.attrGet(name)
|
|
1795
|
+
*
|
|
1796
|
+
* Get the value of attribute `name`, or null if it does not exist.
|
|
1797
|
+
**/
|
|
1798
|
+
Token.prototype.attrGet = function attrGet(name) {
|
|
1799
|
+
const idx = this.attrIndex(name);
|
|
1800
|
+
let value = null;
|
|
1801
|
+
if (idx >= 0) value = this.attrs[idx][1];
|
|
1802
|
+
return value;
|
|
1803
|
+
};
|
|
1804
|
+
/**
|
|
1805
|
+
* Token.attrJoin(name, value)
|
|
1806
|
+
*
|
|
1807
|
+
* Join value to existing attribute via space. Or create new attribute if not
|
|
1808
|
+
* exists. Useful to operate with token classes.
|
|
1809
|
+
**/
|
|
1810
|
+
Token.prototype.attrJoin = function attrJoin(name, value) {
|
|
1811
|
+
const idx = this.attrIndex(name);
|
|
1812
|
+
if (idx < 0) this.attrPush([name, value]);
|
|
1813
|
+
else this.attrs[idx][1] = this.attrs[idx][1] + " " + value;
|
|
1814
|
+
};
|
|
1815
|
+
var token_default = Token;
|
|
1816
|
+
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_0dce998d26f79c06311f476731d22630/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/task-lists/index.js
|
|
1662
1819
|
const checkboxRegex = /^ *\[([\sx])] /i;
|
|
1663
1820
|
function taskLists(md, options = {
|
|
1664
1821
|
enabled: false,
|
|
@@ -1716,7 +1873,7 @@ function generateIdForToken(token) {
|
|
|
1716
1873
|
else return `task-item-${Math.ceil(Math.random() * (1e4 * 1e3) - 1e3)}`;
|
|
1717
1874
|
}
|
|
1718
1875
|
function createCheckboxToken(token, enabled, id) {
|
|
1719
|
-
const checkbox = new
|
|
1876
|
+
const checkbox = new token_default("taskListItemCheckbox", "", 0);
|
|
1720
1877
|
if (!enabled) checkbox.attrSet("disabled", "true");
|
|
1721
1878
|
if (token.map) checkbox.attrSet("line", token.map[0].toString());
|
|
1722
1879
|
checkbox.attrSet("id", id);
|
|
@@ -1724,12 +1881,12 @@ function createCheckboxToken(token, enabled, id) {
|
|
|
1724
1881
|
return checkbox;
|
|
1725
1882
|
}
|
|
1726
1883
|
function createLabelBeginToken(id) {
|
|
1727
|
-
const labelBeginToken = new
|
|
1884
|
+
const labelBeginToken = new token_default("taskListItemLabel_open", "", 1);
|
|
1728
1885
|
labelBeginToken.attrSet("id", id);
|
|
1729
1886
|
return labelBeginToken;
|
|
1730
1887
|
}
|
|
1731
1888
|
function createLabelEndToken() {
|
|
1732
|
-
return new
|
|
1889
|
+
return new token_default("taskListItemLabel_close", "", -1);
|
|
1733
1890
|
}
|
|
1734
1891
|
function isInline(token) {
|
|
1735
1892
|
return token.type === "inline";
|
|
@@ -1748,8 +1905,8 @@ function startsWithTodoMarkdown(token) {
|
|
|
1748
1905
|
//#region node/syntax/markdown-it/markdown-it-escape-code.ts
|
|
1749
1906
|
function MarkdownItEscapeInlineCode(md) {
|
|
1750
1907
|
const codeInline = md.renderer.rules.code_inline;
|
|
1751
|
-
md.renderer.rules.code_inline = (tokens, idx, options, env, self) => {
|
|
1752
|
-
return codeInline(tokens, idx, options, env, self).replace(/^<code/, "<code v-pre");
|
|
1908
|
+
md.renderer.rules.code_inline = async (tokens, idx, options, env, self) => {
|
|
1909
|
+
return (await codeInline(tokens, idx, options, env, self)).replace(/^<code/, "<code v-pre");
|
|
1753
1910
|
};
|
|
1754
1911
|
}
|
|
1755
1912
|
|
|
@@ -1866,7 +2023,7 @@ async function useMarkdownItPlugins(md, options, markdownTransformMap) {
|
|
|
1866
2023
|
});
|
|
1867
2024
|
if (features.katex) md.use(MarkdownItKatex, katexOptions);
|
|
1868
2025
|
md.use(MarkdownItVDrag, markdownTransformMap);
|
|
1869
|
-
if (config.mdc) md.use(
|
|
2026
|
+
if (config.comark || config.mdc) md.use(MarkdownItComark);
|
|
1870
2027
|
}
|
|
1871
2028
|
|
|
1872
2029
|
//#endregion
|
|
@@ -2239,17 +2396,17 @@ async function createMarkdownPlugin(options, { markdown: mdOptions }) {
|
|
|
2239
2396
|
headEnabled: false,
|
|
2240
2397
|
frontmatter: false,
|
|
2241
2398
|
escapeCodeTagInterpolation: false,
|
|
2242
|
-
|
|
2399
|
+
markdownOptions: {
|
|
2243
2400
|
quotes: "\"\"''",
|
|
2244
2401
|
html: true,
|
|
2245
2402
|
xhtmlOut: true,
|
|
2246
2403
|
linkify: true,
|
|
2247
|
-
...mdOptions?.
|
|
2404
|
+
...mdOptions?.markdownOptions
|
|
2248
2405
|
},
|
|
2249
2406
|
...mdOptions,
|
|
2250
|
-
async
|
|
2407
|
+
async markdownSetup(md) {
|
|
2251
2408
|
await useMarkdownItPlugins(md, options, markdownTransformMap);
|
|
2252
|
-
await mdOptions?.
|
|
2409
|
+
await mdOptions?.markdownSetup?.(md);
|
|
2253
2410
|
},
|
|
2254
2411
|
transforms: {
|
|
2255
2412
|
...mdOptions?.transforms,
|
|
@@ -2589,7 +2746,7 @@ function ViteSlidevPlugin(options, pluginOptions = {}, serverOptions = {}) {
|
|
|
2589
2746
|
|
|
2590
2747
|
//#endregion
|
|
2591
2748
|
//#region node/commands/shared.ts
|
|
2592
|
-
const sharedMd =
|
|
2749
|
+
const sharedMd = MarkdownExit({ html: true });
|
|
2593
2750
|
sharedMd.use(MarkdownItLink);
|
|
2594
2751
|
function getSlideTitle(data) {
|
|
2595
2752
|
const title = stringifyMarkdownTokens(sharedMd.parseInline(data.config.title, {}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "52.
|
|
4
|
+
"version": "52.14.0",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -45,17 +45,18 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@antfu/ni": "^28.2.0",
|
|
47
47
|
"@antfu/utils": "^9.3.0",
|
|
48
|
+
"@comark/markdown-it": "^0.3.0",
|
|
48
49
|
"@iconify-json/carbon": "^1.2.18",
|
|
49
50
|
"@iconify-json/ph": "^1.2.2",
|
|
50
51
|
"@iconify-json/svg-spinners": "^1.2.4",
|
|
51
52
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
52
|
-
"@shikijs/markdown-it": "^
|
|
53
|
-
"@shikijs/twoslash": "^
|
|
54
|
-
"@shikijs/vitepress-twoslash": "^
|
|
55
|
-
"@unocss/extractor-mdc": "^66.6.
|
|
56
|
-
"@unocss/reset": "^66.6.
|
|
57
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
58
|
-
"@vitejs/plugin-vue-jsx": "^5.1.
|
|
53
|
+
"@shikijs/markdown-it": "^4.0.0",
|
|
54
|
+
"@shikijs/twoslash": "^4.0.0",
|
|
55
|
+
"@shikijs/vitepress-twoslash": "^4.0.0",
|
|
56
|
+
"@unocss/extractor-mdc": "^66.6.2",
|
|
57
|
+
"@unocss/reset": "^66.6.2",
|
|
58
|
+
"@vitejs/plugin-vue": "^6.0.4",
|
|
59
|
+
"@vitejs/plugin-vue-jsx": "^5.1.4",
|
|
59
60
|
"ansis": "^4.2.0",
|
|
60
61
|
"chokidar": "^5.0.0",
|
|
61
62
|
"cli-progress": "^3.12.0",
|
|
@@ -63,18 +64,17 @@
|
|
|
63
64
|
"fast-deep-equal": "^3.1.3",
|
|
64
65
|
"fast-glob": "^3.3.3",
|
|
65
66
|
"get-port-please": "^3.2.0",
|
|
66
|
-
"global-directory": "^
|
|
67
|
+
"global-directory": "^5.0.0",
|
|
67
68
|
"htmlparser2": "^10.1.0",
|
|
68
69
|
"is-installed-globally": "^1.0.0",
|
|
69
70
|
"jiti": "^2.6.1",
|
|
70
|
-
"katex": "^0.16.
|
|
71
|
+
"katex": "^0.16.33",
|
|
71
72
|
"local-pkg": "^1.1.2",
|
|
72
73
|
"lz-string": "^1.5.0",
|
|
73
74
|
"magic-string": "^0.30.21",
|
|
74
75
|
"magic-string-stack": "^1.1.0",
|
|
75
|
-
"markdown-
|
|
76
|
+
"markdown-exit": "^1.0.0-beta.8",
|
|
76
77
|
"markdown-it-footnote": "^4.0.0",
|
|
77
|
-
"markdown-it-mdc": "^0.2.8",
|
|
78
78
|
"mlly": "^1.8.0",
|
|
79
79
|
"monaco-editor": "^0.55.1",
|
|
80
80
|
"obug": "^2.1.1",
|
|
@@ -88,17 +88,17 @@
|
|
|
88
88
|
"public-ip": "^8.0.0",
|
|
89
89
|
"resolve-from": "^5.0.0",
|
|
90
90
|
"resolve-global": "^2.0.0",
|
|
91
|
-
"semver": "^7.7.
|
|
92
|
-
"shiki": "^
|
|
91
|
+
"semver": "^7.7.4",
|
|
92
|
+
"shiki": "^4.0.0",
|
|
93
93
|
"shiki-magic-move": "^1.2.1",
|
|
94
94
|
"sirv": "^3.0.2",
|
|
95
95
|
"source-map-js": "^1.2.1",
|
|
96
96
|
"typescript": "^5.9.3",
|
|
97
|
-
"unhead": "^2.1.
|
|
98
|
-
"unocss": "^66.6.
|
|
97
|
+
"unhead": "^2.1.9",
|
|
98
|
+
"unocss": "^66.6.2",
|
|
99
99
|
"unplugin-icons": "^23.0.1",
|
|
100
100
|
"unplugin-vue-components": "^31.0.0",
|
|
101
|
-
"unplugin-vue-markdown": "^
|
|
101
|
+
"unplugin-vue-markdown": "^30.0.0",
|
|
102
102
|
"untun": "^0.1.3",
|
|
103
103
|
"uqr": "^0.1.2",
|
|
104
104
|
"vite": "^7.3.1",
|
|
@@ -106,13 +106,13 @@
|
|
|
106
106
|
"vite-plugin-remote-assets": "^2.1.0",
|
|
107
107
|
"vite-plugin-static-copy": "^3.2.0",
|
|
108
108
|
"vite-plugin-vue-server-ref": "^1.0.0",
|
|
109
|
-
"vitefu": "^1.1.
|
|
110
|
-
"vue": "^3.5.
|
|
109
|
+
"vitefu": "^1.1.2",
|
|
110
|
+
"vue": "^3.5.29",
|
|
111
111
|
"yaml": "^2.8.2",
|
|
112
112
|
"yargs": "^18.0.0",
|
|
113
|
-
"@slidev/client": "52.
|
|
114
|
-
"@slidev/parser": "52.
|
|
115
|
-
"@slidev/types": "52.
|
|
113
|
+
"@slidev/client": "52.14.0",
|
|
114
|
+
"@slidev/parser": "52.14.0",
|
|
115
|
+
"@slidev/types": "52.14.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|
package/skills/slidev/SKILL.md
CHANGED
|
@@ -76,7 +76,7 @@ Presenter notes go here
|
|
|
76
76
|
| Click-based highlighting | `` ```ts {1\|2-3\|all} `` | [code-line-highlighting](references/code-line-highlighting.md) |
|
|
77
77
|
| Line numbers | `lineNumbers: true` or `{lines:true}` | [code-line-numbers](references/code-line-numbers.md) |
|
|
78
78
|
| Scrollable code | `{maxHeight:'100px'}` | [code-max-height](references/code-max-height.md) |
|
|
79
|
-
| Code tabs | `::code-group` (requires `
|
|
79
|
+
| Code tabs | `::code-group` (requires `comark: true`) | [code-groups](references/code-groups.md) |
|
|
80
80
|
| Monaco editor | `` ```ts {monaco} `` | [editor-monaco](references/editor-monaco.md) |
|
|
81
81
|
| Run code | `` ```ts {monaco-run} `` | [editor-monaco-run](references/editor-monaco-run.md) |
|
|
82
82
|
| Edit files | `<<< ./file.ts {monaco-write}` | [editor-monaco-write](references/editor-monaco-write.md) |
|
|
@@ -119,7 +119,7 @@ Presenter notes go here
|
|
|
119
119
|
|
|
120
120
|
| Feature | Usage | Reference |
|
|
121
121
|
|---------|-------|-----------|
|
|
122
|
-
|
|
|
122
|
+
| Comark syntax | `comark: true` + `{style="color:red"}` | [syntax-comark](references/syntax-comark.md) |
|
|
123
123
|
| Block frontmatter | `` ```yaml `` instead of `---` | [syntax-block-frontmatter](references/syntax-block-frontmatter.md) |
|
|
124
124
|
| Import slides | `src: ./other.md` | [syntax-importing-slides](references/syntax-importing-slides.md) |
|
|
125
125
|
| Merge frontmatter | Main entry wins | [syntax-frontmatter-merging](references/syntax-frontmatter-merging.md) |
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: comark
|
|
3
|
+
description: Comark Syntax support
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Comark Syntax
|
|
7
7
|
|
|
8
8
|
Enhanced Markdown with component and style syntax.
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ Enhanced Markdown with component and style syntax.
|
|
|
11
11
|
|
|
12
12
|
```md
|
|
13
13
|
---
|
|
14
|
-
|
|
14
|
+
comark: true
|
|
15
15
|
---
|
|
16
16
|
```
|
|
17
17
|
|
|
@@ -48,4 +48,4 @@ The **default** slot content
|
|
|
48
48
|
- Add attributes to images
|
|
49
49
|
- Create complex component layouts
|
|
50
50
|
|
|
51
|
-
Based on
|
|
51
|
+
Based on Comark Syntax.
|