vitepress 1.1.1 → 1.1.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/node/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-
|
|
1
|
+
import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-DZ7Ijn1Q.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'url';
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizePath } from 'vite';
|
|
2
2
|
export { loadEnv } from 'vite';
|
|
3
|
-
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-
|
|
4
|
-
export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-
|
|
3
|
+
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DZ7Ijn1Q.js';
|
|
4
|
+
export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-DZ7Ijn1Q.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -37035,6 +37035,60 @@ function createCodeGroup(options) {
|
|
|
37035
37035
|
];
|
|
37036
37036
|
}
|
|
37037
37037
|
|
|
37038
|
+
const markerRE = /^\[\!(TIP|NOTE|INFO|IMPORTANT|WARNING|CAUTION|DANGER)\]([^\n\r]*)/i;
|
|
37039
|
+
const gitHubAlertsPlugin = (md, options) => {
|
|
37040
|
+
const titleMark = {
|
|
37041
|
+
tip: options?.tipLabel || "TIP",
|
|
37042
|
+
note: options?.noteLabel || "NOTE",
|
|
37043
|
+
info: options?.infoLabel || "INFO",
|
|
37044
|
+
important: options?.importantLabel || "IMPORTANT",
|
|
37045
|
+
warning: options?.warningLabel || "WARNING",
|
|
37046
|
+
caution: options?.cautionLabel || "CAUTION",
|
|
37047
|
+
danger: options?.dangerLabel || "DANGER"
|
|
37048
|
+
};
|
|
37049
|
+
md.core.ruler.after("block", "github-alerts", (state) => {
|
|
37050
|
+
const tokens = state.tokens;
|
|
37051
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
37052
|
+
if (tokens[i].type === "blockquote_open") {
|
|
37053
|
+
const startIndex = i;
|
|
37054
|
+
const open = tokens[startIndex];
|
|
37055
|
+
let endIndex = i + 1;
|
|
37056
|
+
while (endIndex < tokens.length && (tokens[endIndex].type !== "blockquote_close" || tokens[endIndex].level !== open.level))
|
|
37057
|
+
endIndex++;
|
|
37058
|
+
if (endIndex === tokens.length)
|
|
37059
|
+
continue;
|
|
37060
|
+
const close = tokens[endIndex];
|
|
37061
|
+
const firstContent = tokens.slice(startIndex, endIndex + 1).find((token) => token.type === "inline");
|
|
37062
|
+
if (!firstContent)
|
|
37063
|
+
continue;
|
|
37064
|
+
const match = firstContent.content.match(markerRE);
|
|
37065
|
+
if (!match)
|
|
37066
|
+
continue;
|
|
37067
|
+
const type = match[1].toLowerCase();
|
|
37068
|
+
const title = match[2].trim() || titleMark[type] || capitalize(type);
|
|
37069
|
+
firstContent.content = firstContent.content.slice(match[0].length).trimStart();
|
|
37070
|
+
open.type = "github_alert_open";
|
|
37071
|
+
open.tag = "div";
|
|
37072
|
+
open.meta = {
|
|
37073
|
+
title,
|
|
37074
|
+
type
|
|
37075
|
+
};
|
|
37076
|
+
close.type = "github_alert_close";
|
|
37077
|
+
close.tag = "div";
|
|
37078
|
+
}
|
|
37079
|
+
}
|
|
37080
|
+
});
|
|
37081
|
+
md.renderer.rules.github_alert_open = function(tokens, idx) {
|
|
37082
|
+
const { title, type } = tokens[idx].meta;
|
|
37083
|
+
const attrs = "";
|
|
37084
|
+
return `<div class="${type} custom-block github-alert"${attrs}><p class="custom-block-title">${title}</p>
|
|
37085
|
+
`;
|
|
37086
|
+
};
|
|
37087
|
+
};
|
|
37088
|
+
function capitalize(str) {
|
|
37089
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
37090
|
+
}
|
|
37091
|
+
|
|
37038
37092
|
const nanoid = customAlphabet("abcdefghijklmnopqrstuvwxyz", 10);
|
|
37039
37093
|
const attrsToLines = (attrs) => {
|
|
37040
37094
|
attrs = attrs.replace(/^(?:\[.*?\])?.*?([\d,-]+).*/, "$1").trim();
|
|
@@ -37302,6 +37356,23 @@ const linkPlugin = (md, externalAttrs, base) => {
|
|
|
37302
37356
|
}
|
|
37303
37357
|
};
|
|
37304
37358
|
|
|
37359
|
+
function restoreEntities(md) {
|
|
37360
|
+
md.core.ruler.before("text_join", "entity", (state) => {
|
|
37361
|
+
for (const token of state.tokens) {
|
|
37362
|
+
if (token.type !== "inline" || !token.children)
|
|
37363
|
+
continue;
|
|
37364
|
+
for (const child of token.children) {
|
|
37365
|
+
if (child.type === "text_special" && child.info === "entity") {
|
|
37366
|
+
child.type = "entity";
|
|
37367
|
+
}
|
|
37368
|
+
}
|
|
37369
|
+
}
|
|
37370
|
+
});
|
|
37371
|
+
md.renderer.rules.entity = (tokens, idx) => {
|
|
37372
|
+
return tokens[idx].markup;
|
|
37373
|
+
};
|
|
37374
|
+
}
|
|
37375
|
+
|
|
37305
37376
|
const rawPathRegexp = /^(.+?(?:(?:\.([a-z0-9]+))?))(?:(#[\w-]+))?(?: ?(?:{(\d+(?:[,-]\d+)*)? ?(\S+)?}))? ?(?:\[(.+)\])?$/;
|
|
37306
37377
|
function rawPathToToken(rawPath) {
|
|
37307
37378
|
const [
|
|
@@ -37429,60 +37500,6 @@ const snippetPlugin = (md, srcDir) => {
|
|
|
37429
37500
|
md.block.ruler.before("fence", "snippet", parser);
|
|
37430
37501
|
};
|
|
37431
37502
|
|
|
37432
|
-
const markerRE = /^\[\!(TIP|NOTE|INFO|IMPORTANT|WARNING|CAUTION|DANGER)\]([^\n\r]*)/i;
|
|
37433
|
-
const gitHubAlertsPlugin = (md, options) => {
|
|
37434
|
-
const titleMark = {
|
|
37435
|
-
tip: options?.tipLabel || "TIP",
|
|
37436
|
-
note: options?.noteLabel || "NOTE",
|
|
37437
|
-
info: options?.infoLabel || "INFO",
|
|
37438
|
-
important: options?.importantLabel || "IMPORTANT",
|
|
37439
|
-
warning: options?.warningLabel || "WARNING",
|
|
37440
|
-
caution: options?.cautionLabel || "CAUTION",
|
|
37441
|
-
danger: options?.dangerLabel || "DANGER"
|
|
37442
|
-
};
|
|
37443
|
-
md.core.ruler.after("block", "github-alerts", (state) => {
|
|
37444
|
-
const tokens = state.tokens;
|
|
37445
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
37446
|
-
if (tokens[i].type === "blockquote_open") {
|
|
37447
|
-
const startIndex = i;
|
|
37448
|
-
const open = tokens[startIndex];
|
|
37449
|
-
let endIndex = i + 1;
|
|
37450
|
-
while (endIndex < tokens.length && (tokens[endIndex].type !== "blockquote_close" || tokens[endIndex].level !== open.level))
|
|
37451
|
-
endIndex++;
|
|
37452
|
-
if (endIndex === tokens.length)
|
|
37453
|
-
continue;
|
|
37454
|
-
const close = tokens[endIndex];
|
|
37455
|
-
const firstContent = tokens.slice(startIndex, endIndex + 1).find((token) => token.type === "inline");
|
|
37456
|
-
if (!firstContent)
|
|
37457
|
-
continue;
|
|
37458
|
-
const match = firstContent.content.match(markerRE);
|
|
37459
|
-
if (!match)
|
|
37460
|
-
continue;
|
|
37461
|
-
const type = match[1].toLowerCase();
|
|
37462
|
-
const title = match[2].trim() || titleMark[type] || capitalize(type);
|
|
37463
|
-
firstContent.content = firstContent.content.slice(match[0].length).trimStart();
|
|
37464
|
-
open.type = "github_alert_open";
|
|
37465
|
-
open.tag = "div";
|
|
37466
|
-
open.meta = {
|
|
37467
|
-
title,
|
|
37468
|
-
type
|
|
37469
|
-
};
|
|
37470
|
-
close.type = "github_alert_close";
|
|
37471
|
-
close.tag = "div";
|
|
37472
|
-
}
|
|
37473
|
-
}
|
|
37474
|
-
});
|
|
37475
|
-
md.renderer.rules.github_alert_open = function(tokens, idx) {
|
|
37476
|
-
const { title, type } = tokens[idx].meta;
|
|
37477
|
-
const attrs = "";
|
|
37478
|
-
return `<div class="${type} custom-block github-alert"${attrs}><p class="custom-block-title">${title}</p>
|
|
37479
|
-
`;
|
|
37480
|
-
};
|
|
37481
|
-
};
|
|
37482
|
-
function capitalize(str) {
|
|
37483
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
37484
|
-
}
|
|
37485
|
-
|
|
37486
37503
|
const createMarkdownRenderer = async (srcDir, options = {}, base = "/", logger = console) => {
|
|
37487
37504
|
const theme = options.theme ?? { light: "github-light", dark: "github-dark" };
|
|
37488
37505
|
const hasSingleTheme = typeof theme === "string" || "name" in theme;
|
|
@@ -37493,8 +37510,7 @@ const createMarkdownRenderer = async (srcDir, options = {}, base = "/", logger =
|
|
|
37493
37510
|
...options
|
|
37494
37511
|
});
|
|
37495
37512
|
md.linkify.set({ fuzzyLink: false });
|
|
37496
|
-
md.
|
|
37497
|
-
md.renderer.rules.text = (tokens, idx) => tokens[idx].content;
|
|
37513
|
+
md.use(restoreEntities);
|
|
37498
37514
|
if (options.preConfig) {
|
|
37499
37515
|
options.preConfig(md);
|
|
37500
37516
|
}
|
|
@@ -46514,7 +46530,7 @@ async function generateSitemap(siteConfig) {
|
|
|
46514
46530
|
}
|
|
46515
46531
|
|
|
46516
46532
|
/**
|
|
46517
|
-
* @vue/shared v3.4.
|
|
46533
|
+
* @vue/shared v3.4.23
|
|
46518
46534
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
46519
46535
|
* @license MIT
|
|
46520
46536
|
**/
|
|
@@ -46612,7 +46628,7 @@ function escapeHtml(string) {
|
|
|
46612
46628
|
|
|
46613
46629
|
var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
|
|
46614
46630
|
|
|
46615
|
-
var version = "1.1.
|
|
46631
|
+
var version = "1.1.2";
|
|
46616
46632
|
|
|
46617
46633
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
46618
46634
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitepress",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Vite & Vue powered static site generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -70,15 +70,15 @@
|
|
|
70
70
|
"@shikijs/transformers": "^1.3.0",
|
|
71
71
|
"@types/markdown-it": "^14.0.1",
|
|
72
72
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
73
|
-
"@vue/devtools-api": "^7.0.
|
|
73
|
+
"@vue/devtools-api": "^7.0.27",
|
|
74
74
|
"@vueuse/core": "^10.9.0",
|
|
75
75
|
"@vueuse/integrations": "^10.9.0",
|
|
76
76
|
"focus-trap": "^7.5.4",
|
|
77
77
|
"mark.js": "8.11.1",
|
|
78
78
|
"minisearch": "^6.3.0",
|
|
79
79
|
"shiki": "^1.3.0",
|
|
80
|
-
"vite": "^5.2.
|
|
81
|
-
"vue": "^3.4.
|
|
80
|
+
"vite": "^5.2.9",
|
|
81
|
+
"vue": "^3.4.23"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@clack/prompts": "^0.7.0",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@types/node": "^20.12.7",
|
|
110
110
|
"@types/postcss-prefix-selector": "^1.16.3",
|
|
111
111
|
"@types/prompts": "^2.4.9",
|
|
112
|
-
"@vue/shared": "^3.4.
|
|
112
|
+
"@vue/shared": "^3.4.23",
|
|
113
113
|
"chokidar": "^3.6.0",
|
|
114
114
|
"conventional-changelog-cli": "^4.1.0",
|
|
115
115
|
"cross-spawn": "^7.0.3",
|
|
@@ -172,7 +172,6 @@
|
|
|
172
172
|
"optional": true
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
"packageManager": "pnpm@8.15.7",
|
|
176
175
|
"scripts": {
|
|
177
176
|
"dev": "rimraf dist && run-s dev:shared dev:start",
|
|
178
177
|
"dev:start": "run-p dev:client dev:node dev:watch",
|