vitepress 1.1.1 → 1.1.3

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-BOsNJwDZ.js';
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-DrVGLhCg.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'path';
4
4
  import 'url';
@@ -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-BOsNJwDZ.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-BOsNJwDZ.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DrVGLhCg.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-DrVGLhCg.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,16 @@ const linkPlugin = (md, externalAttrs, base) => {
37302
37356
  }
37303
37357
  };
37304
37358
 
37359
+ function restoreEntities(md) {
37360
+ md.core.ruler.disable("text_join");
37361
+ md.renderer.rules.text_special = (tokens, idx) => {
37362
+ if (tokens[idx].info === "entity") {
37363
+ return tokens[idx].markup;
37364
+ }
37365
+ return md.utils.escapeHtml(tokens[idx].content);
37366
+ };
37367
+ }
37368
+
37305
37369
  const rawPathRegexp = /^(.+?(?:(?:\.([a-z0-9]+))?))(?:(#[\w-]+))?(?: ?(?:{(\d+(?:[,-]\d+)*)? ?(\S+)?}))? ?(?:\[(.+)\])?$/;
37306
37370
  function rawPathToToken(rawPath) {
37307
37371
  const [
@@ -37429,60 +37493,6 @@ const snippetPlugin = (md, srcDir) => {
37429
37493
  md.block.ruler.before("fence", "snippet", parser);
37430
37494
  };
37431
37495
 
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
37496
  const createMarkdownRenderer = async (srcDir, options = {}, base = "/", logger = console) => {
37487
37497
  const theme = options.theme ?? { light: "github-light", dark: "github-dark" };
37488
37498
  const hasSingleTheme = typeof theme === "string" || "name" in theme;
@@ -37493,8 +37503,7 @@ const createMarkdownRenderer = async (srcDir, options = {}, base = "/", logger =
37493
37503
  ...options
37494
37504
  });
37495
37505
  md.linkify.set({ fuzzyLink: false });
37496
- md.disable("entity");
37497
- md.renderer.rules.text = (tokens, idx) => tokens[idx].content;
37506
+ md.use(restoreEntities);
37498
37507
  if (options.preConfig) {
37499
37508
  options.preConfig(md);
37500
37509
  }
@@ -46514,7 +46523,7 @@ async function generateSitemap(siteConfig) {
46514
46523
  }
46515
46524
 
46516
46525
  /**
46517
- * @vue/shared v3.4.22
46526
+ * @vue/shared v3.4.23
46518
46527
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
46519
46528
  * @license MIT
46520
46529
  **/
@@ -46612,7 +46621,7 @@ function escapeHtml(string) {
46612
46621
 
46613
46622
  var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
46614
46623
 
46615
- var version = "1.1.1";
46624
+ var version = "1.1.3";
46616
46625
 
46617
46626
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
46618
46627
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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.25",
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.8",
81
- "vue": "^3.4.22"
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.22",
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",