@void/md 0.7.6 → 0.7.7
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.
|
@@ -56,10 +56,10 @@ function gitHubAlertsPlugin(md, options) {
|
|
|
56
56
|
};
|
|
57
57
|
const rule = (state) => {
|
|
58
58
|
const tokens = state.tokens;
|
|
59
|
-
for (let
|
|
60
|
-
const startIndex =
|
|
59
|
+
for (let tokenIndex = 0; tokenIndex < tokens.length; tokenIndex++) if (tokens[tokenIndex].type === "blockquote_open") {
|
|
60
|
+
const startIndex = tokenIndex;
|
|
61
61
|
const open = tokens[startIndex];
|
|
62
|
-
let endIndex =
|
|
62
|
+
let endIndex = tokenIndex + 1;
|
|
63
63
|
while (endIndex < tokens.length && (tokens[endIndex].type !== "blockquote_close" || tokens[endIndex].level !== open.level)) endIndex++;
|
|
64
64
|
if (endIndex === tokens.length) continue;
|
|
65
65
|
const close = tokens[endIndex];
|
|
@@ -124,7 +124,7 @@ function lineNumberPlugin(md, enable = false) {
|
|
|
124
124
|
const matchStart = info.match(/=(\d+)/);
|
|
125
125
|
if (matchStart?.[1]) startLineNumber = parseInt(matchStart[1]);
|
|
126
126
|
const lines = rawCode.slice(rawCode.indexOf("<code>"), rawCode.indexOf("</code>")).split("\n");
|
|
127
|
-
const lineNumbersWrapper = `<div class="line-numbers-wrapper" aria-hidden="true">${[...Array(lines.length)].map((_,
|
|
127
|
+
const lineNumbersWrapper = `<div class="line-numbers-wrapper" aria-hidden="true">${[...Array(lines.length)].map((_, lineOffset) => `<span class="line-number">${lineOffset + startLineNumber}</span><br>`).join("")}</div>`;
|
|
128
128
|
return rawCode.replace(/<\/div>$/, `${lineNumbersWrapper}</div>`).replace(/"(language-[^"]*?)"/, "\"$1 line-numbers-mode\"");
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -224,13 +224,13 @@ function tocPlugin(md, options) {
|
|
|
224
224
|
};
|
|
225
225
|
md.renderer.rules.toc_body = (tokens) => {
|
|
226
226
|
const headers = [];
|
|
227
|
-
for (let
|
|
228
|
-
const token = tokens[
|
|
227
|
+
for (let tokenIndex = 0; tokenIndex < tokens.length; tokenIndex++) {
|
|
228
|
+
const token = tokens[tokenIndex];
|
|
229
229
|
if (token.type === "heading_open") {
|
|
230
230
|
const depth = Number(token.tag.slice(1));
|
|
231
231
|
if (level.includes(depth)) {
|
|
232
232
|
const slug = token.attrGet?.("id") ?? "";
|
|
233
|
-
const text = (tokens[
|
|
233
|
+
const text = (tokens[tokenIndex + 1]?.children?.filter((child) => child.type === "text" || child.type === "code_inline").map((child) => child.content).join("") ?? "").trim();
|
|
234
234
|
headers.push({
|
|
235
235
|
depth,
|
|
236
236
|
slug,
|
|
@@ -254,7 +254,7 @@ async function getCompiler(options) {
|
|
|
254
254
|
return compilerPromise;
|
|
255
255
|
}
|
|
256
256
|
async function createCompiler(options) {
|
|
257
|
-
const
|
|
257
|
+
const markdown = new MarkdownExit({
|
|
258
258
|
html: true,
|
|
259
259
|
linkify: true
|
|
260
260
|
});
|
|
@@ -274,8 +274,8 @@ async function createCompiler(options) {
|
|
|
274
274
|
transformerNotationFocus(),
|
|
275
275
|
transformerNotationErrorLevel()
|
|
276
276
|
];
|
|
277
|
-
|
|
278
|
-
const token = tokens[
|
|
277
|
+
markdown.renderer.rules.fence = async (tokens, tokenIndex) => {
|
|
278
|
+
const token = tokens[tokenIndex];
|
|
279
279
|
const code = token.content;
|
|
280
280
|
let lang = token.info ? token.info.split(/\s+/g)[0] : "text";
|
|
281
281
|
if (!isSpecialLang(lang) && !highlighter.getLoadedLanguages().includes(lang)) if (lang in bundledLanguages) await highlighter.loadLanguage(lang);
|
|
@@ -288,26 +288,26 @@ async function createCompiler(options) {
|
|
|
288
288
|
meta: { __raw: token.info }
|
|
289
289
|
});
|
|
290
290
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
return
|
|
291
|
+
markdown.use(preWrapperPlugin);
|
|
292
|
+
markdown.use(containerPlugin);
|
|
293
|
+
markdown.use(imagePlugin, { lazyLoading: true });
|
|
294
|
+
markdown.use(linkPlugin);
|
|
295
|
+
markdown.use(lineNumberPlugin, false);
|
|
296
|
+
markdown.use(gitHubAlertsPlugin);
|
|
297
|
+
markdown.use(attrs);
|
|
298
|
+
markdown.use(full);
|
|
299
|
+
markdown.use(anchor, { permalink: anchor.permalink.ariaHidden({ placement: "before" }) });
|
|
300
|
+
markdown.use(tocPlugin);
|
|
301
|
+
return markdown;
|
|
302
302
|
}
|
|
303
303
|
function extractHeadings(tokens) {
|
|
304
304
|
const headings = [];
|
|
305
|
-
for (let
|
|
306
|
-
const token = tokens[
|
|
305
|
+
for (let tokenIndex = 0; tokenIndex < tokens.length; tokenIndex++) {
|
|
306
|
+
const token = tokens[tokenIndex];
|
|
307
307
|
if (token.type === "heading_open") {
|
|
308
308
|
const depth = Number(token.tag.slice(1));
|
|
309
309
|
const slug = token.attrGet?.("id") ?? "";
|
|
310
|
-
const text = (tokens[
|
|
310
|
+
const text = (tokens[tokenIndex + 1]?.children?.filter((child) => child.type === "text" || child.type === "code_inline").map((child) => child.content).join("") ?? "").trim();
|
|
311
311
|
headings.push({
|
|
312
312
|
depth,
|
|
313
313
|
slug,
|
|
@@ -326,7 +326,7 @@ async function compile(source, options) {
|
|
|
326
326
|
html: await compiler.renderAsync(content, env),
|
|
327
327
|
frontmatter,
|
|
328
328
|
headings,
|
|
329
|
-
title: frontmatter.title ?? headings.find((
|
|
329
|
+
title: frontmatter.title ?? headings.find((heading) => heading.depth === 1)?.text ?? ""
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FrontmatterContext, setFrontmatter, useFrontmatter } from "./runtime/index.mjs";
|
|
2
|
-
import { n as MdPage } from "./plugin-
|
|
2
|
+
import { n as MdPage } from "./plugin-DXBtOQJb.mjs";
|
|
3
3
|
export { FrontmatterContext, type MdPage, setFrontmatter, useFrontmatter };
|
|
@@ -1,56 +1,55 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
2
|
|
|
3
3
|
//#region src/compile.d.ts
|
|
4
|
-
|
|
4
|
+
type Heading = Readonly<{
|
|
5
5
|
depth: number;
|
|
6
6
|
slug: string;
|
|
7
7
|
text: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
}>;
|
|
9
|
+
type CompileResult = Readonly<{
|
|
10
10
|
html: string;
|
|
11
11
|
frontmatter: Record<string, unknown>;
|
|
12
|
-
headings:
|
|
12
|
+
headings: ReadonlyArray<Heading>;
|
|
13
13
|
title: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
}>;
|
|
15
|
+
type CompileOptions = Readonly<{
|
|
16
16
|
shiki?: {
|
|
17
17
|
themes?: {
|
|
18
18
|
light: string;
|
|
19
19
|
dark: string;
|
|
20
20
|
};
|
|
21
|
-
langs?:
|
|
21
|
+
langs?: ReadonlyArray<string>;
|
|
22
22
|
};
|
|
23
|
-
}
|
|
23
|
+
}>;
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/extract-script.d.ts
|
|
26
|
-
|
|
26
|
+
type IslandImport = {
|
|
27
27
|
name: string;
|
|
28
28
|
specifier: string;
|
|
29
|
-
strategy: string;
|
|
30
|
-
/** Root-relative island ID (set during transform when file context is available). */
|
|
29
|
+
strategy: string; /** Root-relative island ID (set during transform when file context is available). */
|
|
31
30
|
islandId?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
31
|
+
};
|
|
32
|
+
type ScriptExtraction = Readonly<{
|
|
34
33
|
script: string | null;
|
|
35
34
|
body: string;
|
|
36
35
|
islandImports: Array<IslandImport>;
|
|
37
36
|
clientCode: string | null;
|
|
38
|
-
}
|
|
37
|
+
}>;
|
|
39
38
|
//#endregion
|
|
40
39
|
//#region src/plugin.d.ts
|
|
41
|
-
|
|
40
|
+
type MdPage = Readonly<{
|
|
42
41
|
path: string;
|
|
43
42
|
title: string;
|
|
44
43
|
frontmatter: Record<string, unknown>;
|
|
45
|
-
headings:
|
|
44
|
+
headings: ReadonlyArray<{
|
|
46
45
|
depth: number;
|
|
47
46
|
slug: string;
|
|
48
47
|
text: string;
|
|
49
48
|
}>;
|
|
50
|
-
}
|
|
51
|
-
|
|
49
|
+
}>;
|
|
50
|
+
type MarkdownOptions = Readonly<{
|
|
52
51
|
shiki?: CompileOptions["shiki"];
|
|
53
|
-
}
|
|
54
|
-
declare function voidMarkdown(options?: MarkdownOptions):
|
|
52
|
+
}>;
|
|
53
|
+
declare function voidMarkdown(options?: MarkdownOptions): ReadonlyArray<Plugin>;
|
|
55
54
|
//#endregion
|
|
56
55
|
export { ScriptExtraction as a, IslandImport as i, MdPage as n, CompileOptions as o, voidMarkdown as r, CompileResult as s, MarkdownOptions as t };
|
package/dist/plugin.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ScriptExtraction, i as IslandImport, n as MdPage, o as CompileOptions, r as voidMarkdown, s as CompileResult, t as MarkdownOptions } from "./plugin-
|
|
1
|
+
import { a as ScriptExtraction, i as IslandImport, n as MdPage, o as CompileOptions, r as voidMarkdown, s as CompileResult, t as MarkdownOptions } from "./plugin-DXBtOQJb.mjs";
|
|
2
2
|
export { CompileOptions, CompileResult, IslandImport, MarkdownOptions, MdPage, ScriptExtraction, voidMarkdown };
|
package/dist/plugin.mjs
CHANGED
|
@@ -17,14 +17,14 @@ function generateMdTypes() {
|
|
|
17
17
|
return [
|
|
18
18
|
"// Auto-generated by @void/md — do not edit",
|
|
19
19
|
"",
|
|
20
|
-
"export
|
|
20
|
+
"export type VoidMdPage = Readonly<{",
|
|
21
21
|
" path: string;",
|
|
22
22
|
" title: string;",
|
|
23
23
|
" frontmatter: Record<string, unknown>;",
|
|
24
|
-
" headings:
|
|
25
|
-
"}",
|
|
24
|
+
" headings: ReadonlyArray<{ depth: number; slug: string; text: string }>;",
|
|
25
|
+
"}>;",
|
|
26
26
|
"",
|
|
27
|
-
"declare const pages:
|
|
27
|
+
"declare const pages: ReadonlyArray<VoidMdPage>;",
|
|
28
28
|
"export default pages;",
|
|
29
29
|
""
|
|
30
30
|
].join("\n");
|
|
@@ -114,21 +114,21 @@ function emitReactComponentWithIslands(result, islandImports) {
|
|
|
114
114
|
const chunks = buildRenderChunks(result.html, islandImports);
|
|
115
115
|
let code = `import React from "react";\n`;
|
|
116
116
|
code += `import { FrontmatterContext } from "@void/md";\n`;
|
|
117
|
-
for (let
|
|
118
|
-
const
|
|
119
|
-
code += `import _raw_island_${
|
|
117
|
+
for (let islandIndex = 0; islandIndex < islandImports.length; islandIndex++) {
|
|
118
|
+
const islandImport = islandImports[islandIndex];
|
|
119
|
+
code += `import _raw_island_${islandIndex} from ${JSON.stringify(islandImport.specifier)};\n`;
|
|
120
120
|
}
|
|
121
|
-
for (let
|
|
122
|
-
const
|
|
123
|
-
code += `function ${
|
|
121
|
+
for (let islandIndex = 0; islandIndex < islandImports.length; islandIndex++) {
|
|
122
|
+
const islandImport = islandImports[islandIndex];
|
|
123
|
+
code += `function ${islandImport.name}(props) {
|
|
124
124
|
return React.createElement(
|
|
125
125
|
"div",
|
|
126
126
|
{
|
|
127
|
-
"data-island": ${JSON.stringify(toIslandId(
|
|
127
|
+
"data-island": ${JSON.stringify(toIslandId(islandImport))},
|
|
128
128
|
"data-props": JSON.stringify(props),
|
|
129
|
-
"data-hydrate": ${JSON.stringify(
|
|
129
|
+
"data-hydrate": ${JSON.stringify(islandImport.strategy)}
|
|
130
130
|
},
|
|
131
|
-
React.createElement(_raw_island_${
|
|
131
|
+
React.createElement(_raw_island_${islandIndex}, props)
|
|
132
132
|
);
|
|
133
133
|
}\n`;
|
|
134
134
|
}
|
|
@@ -186,11 +186,11 @@ function emitSolidComponentWithIslands(result, islandImports) {
|
|
|
186
186
|
const chunks = buildRenderChunks(result.html, islandImports);
|
|
187
187
|
const importAliasByName = /* @__PURE__ */ new Map();
|
|
188
188
|
let code = `import { FrontmatterContext } from "@void/md";\n`;
|
|
189
|
-
for (let
|
|
190
|
-
const
|
|
191
|
-
const alias = `RawIsland${
|
|
192
|
-
importAliasByName.set(
|
|
193
|
-
code += `import ${alias} from ${JSON.stringify(
|
|
189
|
+
for (let islandIndex = 0; islandIndex < islandImports.length; islandIndex++) {
|
|
190
|
+
const islandImport = islandImports[islandIndex];
|
|
191
|
+
const alias = `RawIsland${islandIndex}`;
|
|
192
|
+
importAliasByName.set(islandImport.name, alias);
|
|
193
|
+
code += `import ${alias} from ${JSON.stringify(islandImport.specifier)};\n`;
|
|
194
194
|
}
|
|
195
195
|
code += `
|
|
196
196
|
const __frontmatter = ${JSON.stringify(result.frontmatter)};
|
|
@@ -263,11 +263,11 @@ export const headings = ${toSvelteLiteral(result.headings)};
|
|
|
263
263
|
<script>
|
|
264
264
|
import { setFrontmatter } from "@void/md";
|
|
265
265
|
`;
|
|
266
|
-
for (let
|
|
267
|
-
const
|
|
268
|
-
const alias = `RawIsland${
|
|
269
|
-
importAliasByName.set(
|
|
270
|
-
source += `import ${alias} from ${JSON.stringify(
|
|
266
|
+
for (let islandIndex = 0; islandIndex < islandImports.length; islandIndex++) {
|
|
267
|
+
const islandImport = islandImports[islandIndex];
|
|
268
|
+
const alias = `RawIsland${islandIndex}`;
|
|
269
|
+
importAliasByName.set(islandImport.name, alias);
|
|
270
|
+
source += `import ${alias} from ${JSON.stringify(islandImport.specifier)};
|
|
271
271
|
`;
|
|
272
272
|
}
|
|
273
273
|
source += `
|
|
@@ -318,44 +318,44 @@ export default defineComponent({
|
|
|
318
318
|
const ISLAND_TAG_RE = /<([A-Z]\w*)\s*((?:[^>/"']|"[^"]*"|'[^']*')*)\/\s*>|<([A-Z]\w*)\s*((?:[^>/"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<\/\3\s*>/g;
|
|
319
319
|
function findIslandTags(html, names) {
|
|
320
320
|
const matches = [];
|
|
321
|
-
let
|
|
321
|
+
let tagMatch;
|
|
322
322
|
ISLAND_TAG_RE.lastIndex = 0;
|
|
323
|
-
while ((
|
|
324
|
-
const name =
|
|
323
|
+
while ((tagMatch = ISLAND_TAG_RE.exec(html)) !== null) {
|
|
324
|
+
const name = tagMatch[1] ?? tagMatch[3];
|
|
325
325
|
if (names.has(name)) matches.push({
|
|
326
326
|
name,
|
|
327
|
-
start:
|
|
328
|
-
end:
|
|
329
|
-
attrs: (
|
|
330
|
-
children:
|
|
327
|
+
start: tagMatch.index,
|
|
328
|
+
end: tagMatch.index + tagMatch[0].length,
|
|
329
|
+
attrs: (tagMatch[2] ?? tagMatch[4] ?? "").trim(),
|
|
330
|
+
children: tagMatch[5] ?? ""
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
333
|
return matches;
|
|
334
334
|
}
|
|
335
335
|
function parseAttrs(attrStr) {
|
|
336
336
|
const result = {};
|
|
337
|
-
const
|
|
338
|
-
let
|
|
339
|
-
while ((
|
|
337
|
+
const attrRe = /(\w[\w-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|(\S+)))?/g;
|
|
338
|
+
let attrMatch;
|
|
339
|
+
while ((attrMatch = attrRe.exec(attrStr)) !== null) result[attrMatch[1]] = attrMatch[2] ?? attrMatch[3] ?? attrMatch[4] ?? "";
|
|
340
340
|
return result;
|
|
341
341
|
}
|
|
342
342
|
function emitVueComponentWithIslands(result, islandImports) {
|
|
343
|
-
const nameSet = new Set(islandImports.map((
|
|
343
|
+
const nameSet = new Set(islandImports.map((islandImport) => islandImport.name));
|
|
344
344
|
const islandTags = findIslandTags(result.html, nameSet);
|
|
345
345
|
let code = `import { defineComponent, h, createStaticVNode, provide } from "vue";\n`;
|
|
346
|
-
for (let
|
|
347
|
-
const
|
|
348
|
-
code += `import _raw_island_${
|
|
346
|
+
for (let islandIndex = 0; islandIndex < islandImports.length; islandIndex++) {
|
|
347
|
+
const islandImport = islandImports[islandIndex];
|
|
348
|
+
code += `import _raw_island_${islandIndex} from ${JSON.stringify(islandImport.specifier)};\n`;
|
|
349
349
|
}
|
|
350
|
-
for (let
|
|
351
|
-
const
|
|
352
|
-
code += `const ${
|
|
350
|
+
for (let islandIndex = 0; islandIndex < islandImports.length; islandIndex++) {
|
|
351
|
+
const islandImport = islandImports[islandIndex];
|
|
352
|
+
code += `const ${islandImport.name} = { inheritAttrs: false, render() {
|
|
353
353
|
const props = this.$attrs;
|
|
354
354
|
return h("div", {
|
|
355
|
-
"data-island": ${JSON.stringify(toIslandId(
|
|
355
|
+
"data-island": ${JSON.stringify(toIslandId(islandImport))},
|
|
356
356
|
"data-props": JSON.stringify(props),
|
|
357
|
-
"data-hydrate": ${JSON.stringify(
|
|
358
|
-
}, h(_raw_island_${
|
|
357
|
+
"data-hydrate": ${JSON.stringify(islandImport.strategy)}
|
|
358
|
+
}, h(_raw_island_${islandIndex}, props));
|
|
359
359
|
}};\n`;
|
|
360
360
|
}
|
|
361
361
|
const vnodes = [];
|
|
@@ -408,11 +408,11 @@ function extractScript(source) {
|
|
|
408
408
|
const script = match[1].trim();
|
|
409
409
|
const body = source.slice(match[0].length);
|
|
410
410
|
const islandImports = [];
|
|
411
|
-
let
|
|
412
|
-
while ((
|
|
413
|
-
name:
|
|
414
|
-
specifier:
|
|
415
|
-
strategy:
|
|
411
|
+
let importMatch;
|
|
412
|
+
while ((importMatch = ISLAND_IMPORT_RE.exec(script)) !== null) islandImports.push({
|
|
413
|
+
name: importMatch[1],
|
|
414
|
+
specifier: importMatch[2].slice(1, -1),
|
|
415
|
+
strategy: importMatch[3].slice(1, -1)
|
|
416
416
|
});
|
|
417
417
|
return {
|
|
418
418
|
script,
|
|
@@ -426,22 +426,22 @@ function extractScript(source) {
|
|
|
426
426
|
let metadataCompiler = null;
|
|
427
427
|
function getMetadataCompiler() {
|
|
428
428
|
if (metadataCompiler) return metadataCompiler;
|
|
429
|
-
const
|
|
429
|
+
const markdown = new MarkdownExit({
|
|
430
430
|
html: true,
|
|
431
431
|
linkify: true
|
|
432
432
|
});
|
|
433
|
-
|
|
434
|
-
metadataCompiler =
|
|
435
|
-
return
|
|
433
|
+
markdown.use(anchor, { permalink: anchor.permalink.ariaHidden({ placement: "before" }) });
|
|
434
|
+
metadataCompiler = markdown;
|
|
435
|
+
return markdown;
|
|
436
436
|
}
|
|
437
437
|
function extractHeadings(tokens) {
|
|
438
438
|
const headings = [];
|
|
439
|
-
for (let
|
|
440
|
-
const token = tokens[
|
|
439
|
+
for (let tokenIndex = 0; tokenIndex < tokens.length; tokenIndex++) {
|
|
440
|
+
const token = tokens[tokenIndex];
|
|
441
441
|
if (token.type === "heading_open") {
|
|
442
442
|
const depth = Number(token.tag.slice(1));
|
|
443
443
|
const slug = token.attrGet?.("id") ?? "";
|
|
444
|
-
const text = (tokens[
|
|
444
|
+
const text = (tokens[tokenIndex + 1]?.children?.filter((child) => child.type === "text" || child.type === "code_inline").map((child) => child.content).join("") ?? "").trim();
|
|
445
445
|
headings.push({
|
|
446
446
|
depth,
|
|
447
447
|
slug,
|
|
@@ -457,7 +457,7 @@ function extractMetadata(source) {
|
|
|
457
457
|
return {
|
|
458
458
|
frontmatter,
|
|
459
459
|
headings,
|
|
460
|
-
title: frontmatter.title ?? headings.find((
|
|
460
|
+
title: frontmatter.title ?? headings.find((heading) => heading.depth === 1)?.text ?? ""
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
463
|
//#endregion
|
|
@@ -517,7 +517,7 @@ function voidMarkdown(options) {
|
|
|
517
517
|
frontmatter: result.frontmatter,
|
|
518
518
|
headings: result.headings
|
|
519
519
|
};
|
|
520
|
-
}))).sort((
|
|
520
|
+
}))).sort((leftPage, rightPage) => leftPage.path.localeCompare(rightPage.path));
|
|
521
521
|
}
|
|
522
522
|
function writeMdTypes() {
|
|
523
523
|
const outDir = join(root, ".void");
|
|
@@ -646,7 +646,7 @@ export function useFrontmatter() { return useContext(FrontmatterContext) ?? {};
|
|
|
646
646
|
const absPath = resolve(dirname(_id), imp.specifier);
|
|
647
647
|
imp.islandId = normalizePath(relative(root, absPath)).replace(/\.[^.]+$/, "");
|
|
648
648
|
}
|
|
649
|
-
const { compile } = await import("./compile-
|
|
649
|
+
const { compile } = await import("./compile-zfpn0RR9.mjs");
|
|
650
650
|
const result = await compile(body, { shiki: options?.shiki });
|
|
651
651
|
if (adapter === "vue") {
|
|
652
652
|
if (islandImports.length > 0) return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/md",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
|
|
52
52
|
"vite-plus": "^0.1.20",
|
|
53
53
|
"vue": "^3.5.34",
|
|
54
|
-
"void": "0.7.
|
|
54
|
+
"void": "0.7.7"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
|
|
58
|
-
"void": "0.7.
|
|
58
|
+
"void": "0.7.7"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "vp pack",
|
package/pages.d.ts
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export type VoidMdPage = Readonly<{
|
|
8
8
|
path: string;
|
|
9
9
|
title: string;
|
|
10
10
|
frontmatter: Record<string, unknown>;
|
|
11
|
-
headings:
|
|
12
|
-
}
|
|
11
|
+
headings: ReadonlyArray<{ depth: number; slug: string; text: string }>;
|
|
12
|
+
}>;
|
|
13
13
|
|
|
14
|
-
declare const pages:
|
|
14
|
+
declare const pages: ReadonlyArray<VoidMdPage>;
|
|
15
15
|
export default pages;
|