From 5fd5703bdcc8addd018c3f8f5f2f17ba7493f71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 6 Nov 2024 20:02:59 +0100 Subject: [PATCH] note loaders (#1776) Add source of pages, exported files, and modules, to the build manifest. --------- Co-authored-by: Mike Bostock --- src/build.ts | 39 ++++++++++--- src/loader.ts | 14 +---- src/markdown.ts | 5 +- src/observableApiClient.ts | 10 +--- src/preview.ts | 5 +- test/build-test.ts | 57 ++++++++++++++++--- test/deploy-test.ts | 11 +++- test/output/block-expression.md.json | 3 +- test/output/comment.md.json | 3 +- test/output/dollar-expression.md.json | 3 +- test/output/dot-graphviz.md.json | 3 +- test/output/double-quote-expression.md.json | 3 +- test/output/embedded-expression.md.json | 3 +- test/output/escaped-expression.md.json | 3 +- test/output/fenced-code-options.md.json | 3 +- test/output/fenced-code.md.json | 3 +- test/output/fetch-parent-dir.md.json | 3 +- test/output/heading-expression.md.json | 3 +- test/output/hello-world.md.json | 3 +- test/output/indented-inline.md.json | 3 +- test/output/inline-expression.md.json | 3 +- .../output/inline-following-backticks.md.json | 3 +- test/output/inline-within-lists.md.json | 3 +- test/output/jsx.md.json | 3 +- test/output/linkify.md.json | 3 +- test/output/local-fetch.md.json | 3 +- test/output/malformed-block.md.json | 3 +- test/output/markdown-in-html.md.json | 3 +- test/output/mermaid.md.json | 3 +- test/output/script-expression.md.json | 3 +- test/output/setext.md.json | 3 +- test/output/single-quote-expression.md.json | 3 +- test/output/svg-placeholder.md.json | 3 +- test/output/template-expression.md.json | 3 +- test/output/tex-block.md.json | 3 +- test/output/tex-expression.md.json | 3 +- test/output/triple-backtick-inline.md.json | 3 +- test/output/wellformed-block.md.json | 3 +- test/output/yaml-frontmatter.md.json | 3 +- 39 files changed, 164 insertions(+), 73 deletions(-) diff --git a/src/build.ts b/src/build.ts index 0f06635a4..945901042 100644 --- a/src/build.ts +++ b/src/build.ts @@ -4,7 +4,7 @@ import {copyFile, readFile, rm, stat, writeFile} from "node:fs/promises"; import {basename, dirname, extname, join} from "node:path/posix"; import type {Config} from "./config.js"; import {getDuckDBManifest} from "./duckdb.js"; -import {CliError} from "./error.js"; +import {CliError, enoent} from "./error.js"; import {getClientPath, prepareOutput} from "./files.js"; import {findModule, getModuleHash, readJavaScript} from "./javascript/module.js"; import {transpileModule} from "./javascript/transpile.js"; @@ -54,7 +54,7 @@ export async function build( {config}: BuildOptions, effects: BuildEffects = new FileBuildEffects(config.output, join(config.root, ".observablehq", "cache")) ): Promise { - const {root, loaders, duckdb} = config; + const {root, loaders, title, duckdb} = config; Telemetry.record({event: "build", step: "start"}); // Prepare for build (such as by emptying the existing output root). @@ -75,6 +75,25 @@ export async function build( let assetCount = 0; let pageCount = 0; const pagePaths = new Set(); + + const buildManifest: BuildManifest = { + ...(title && {title}), + config: {root}, + pages: [], + modules: [], + files: [] + }; + + // file is the serving path relative to the base (e.g., /foo) + // path is the source file relative to the source root (e.g., /foo.md) + const addToManifest = (type: string, file: string, {title, path}: {title?: string | null; path: string}) => { + buildManifest[type].push({ + path: config.normalizePath(file), + source: join("/", path), // TODO have route return path with leading slash? + ...(title != null && {title}) + }); + }; + for await (const path of config.paths()) { effects.output.write(`${faint("load")} ${path} `); const start = performance.now(); @@ -91,6 +110,7 @@ export async function build( effects.output.write(`${faint("in")} ${(elapsed >= 100 ? yellow : faint)(`${elapsed}ms`)}\n`); outputs.set(path, {type: "module", resolvers}); ++assetCount; + addToManifest("modules", path, module); continue; } } @@ -99,6 +119,7 @@ export async function build( effects.output.write(`${faint("copy")} ${join(root, path)} ${faint("→")} `); const sourcePath = join(root, await file.load({useStale: true}, effects)); await effects.copyFile(sourcePath, path); + addToManifest("files", path, file); ++assetCount; continue; } @@ -209,7 +230,10 @@ export async function build( // Copy over referenced files, accumulating hashed aliases. for (const file of files) { effects.output.write(`${faint("copy")} ${join(root, file)} ${faint("→")} `); - const sourcePath = join(root, await loaders.loadFile(join("/", file), {useStale: true}, effects)); + const path = join("/", file); + const loader = loaders.find(path); + if (!loader) throw enoent(path); + const sourcePath = join(root, await loader.load({useStale: true}, effects)); const contents = await readFile(sourcePath); const hash = createHash("sha256").update(contents).digest("hex").slice(0, 8); const alias = applyHash(join("/_file", file), hash); @@ -338,15 +362,13 @@ export async function build( } // Render pages! - const buildManifest: BuildManifest = {pages: []}; - if (config.title) buildManifest.title = config.title; for (const [path, output] of outputs) { effects.output.write(`${faint("render")} ${path} ${faint("→")} `); if (output.type === "page") { const {page, resolvers} = output; const html = await renderPage(page, {...config, path, resolvers}); await effects.writeFile(`${path}.html`, html); - buildManifest.pages.push({path: config.normalizePath(path), title: page.title}); + addToManifest("pages", path, page); } else { const {resolvers} = output; const source = await renderModule(root, path, resolvers); @@ -507,5 +529,8 @@ export class FileBuildEffects implements BuildEffects { export interface BuildManifest { title?: string; - pages: {path: string; title: string | null}[]; + config: {root: string}; + pages: {path: string; title?: string | null; source?: string}[]; + modules: {path: string; source?: string}[]; + files: {path: string; source?: string}[]; } diff --git a/src/loader.ts b/src/loader.ts index 643c58af0..324f1a8e1 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -73,16 +73,6 @@ export class LoaderResolver { ); } - /** - * Loads the file at the specified path, returning a promise to the path to - * the (possibly generated) file relative to the source root. - */ - async loadFile(path: string, options?: LoadOptions, effects?: LoadEffects): Promise { - const loader = this.find(path); - if (!loader) throw enoent(path); - return await loader.load(options, effects); - } - /** * Loads the page at the specified path, returning a promise to the parsed * page object. @@ -90,8 +80,8 @@ export class LoaderResolver { async loadPage(path: string, options: LoadOptions & ParseOptions, effects?: LoadEffects): Promise { const loader = this.findPage(path); if (!loader) throw enoent(path); - const source = await readFile(join(this.root, await loader.load(options, effects)), "utf8"); - return parseMarkdown(source, {params: loader.params, ...options}); + const input = await readFile(join(this.root, await loader.load(options, effects)), "utf8"); + return parseMarkdown(input, {source: loader.path, params: loader.params, ...options}); } /** diff --git a/src/markdown.ts b/src/markdown.ts index c736884b8..cb43b5726 100644 --- a/src/markdown.ts +++ b/src/markdown.ts @@ -40,6 +40,7 @@ export interface MarkdownPage { data: FrontMatter; style: string | null; code: MarkdownCode[]; + path: string; params?: Params; } @@ -216,6 +217,7 @@ export interface ParseOptions { head?: Config["head"]; header?: Config["header"]; footer?: Config["footer"]; + source?: string; params?: Params; } @@ -242,7 +244,7 @@ export function createMarkdownIt({ } export function parseMarkdown(input: string, options: ParseOptions): MarkdownPage { - const {md, path, params} = options; + const {md, path, source = path, params} = options; const {content, data} = readFrontMatter(input); const code: MarkdownCode[] = []; const context: ParseContext = {code, startLine: 0, currentLine: 0, path, params}; @@ -258,6 +260,7 @@ export function parseMarkdown(input: string, options: ParseOptions): MarkdownPag title, style: getStyle(data, options), code, + path: source, params }; } diff --git a/src/observableApiClient.ts b/src/observableApiClient.ts index fe8b2b38a..ccd6eddc5 100644 --- a/src/observableApiClient.ts +++ b/src/observableApiClient.ts @@ -1,4 +1,5 @@ import fs from "node:fs/promises"; +import type {BuildManifest} from "./build.js"; import type {ClackEffects} from "./clack.js"; import {CliError, HttpError, isApiError} from "./error.js"; import {formatByteSize} from "./format.js"; @@ -196,7 +197,7 @@ export class ObservableApiClient { }); } - async postDeployUploaded(deployId: string, buildManifest: PostDeployUploadedRequest | null): Promise { + async postDeployUploaded(deployId: string, buildManifest: BuildManifest | null): Promise { return await this._fetch(new URL(`/cli/deploy/${deployId}/uploaded`, this._apiOrigin), { method: "POST", headers: {"content-type": "application/json"}, @@ -317,10 +318,3 @@ export interface PostDeployManifestResponse { detail: string | null; }[]; } - -export interface PostDeployUploadedRequest { - pages: { - path: string; - title: string | null; - }[]; -} diff --git a/src/preview.ts b/src/preview.ts index 4252f44a3..130340dcb 100644 --- a/src/preview.ts +++ b/src/preview.ts @@ -177,7 +177,10 @@ export class PreviewServer { } throw enoent(path); } else if (pathname.startsWith("/_file/")) { - send(req, await loaders.loadFile(pathname.slice("/_file".length)), {root}).pipe(res); + const path = pathname.slice("/_file".length); + const loader = loaders.find(path); + if (!loader) throw enoent(path); + send(req, await loader.load(), {root}).pipe(res); } else { if ((pathname = normalize(pathname)).startsWith("..")) throw new Error("Invalid path: " + pathname); diff --git a/test/build-test.ts b/test/build-test.ts index e1ff0a392..da7726f6c 100644 --- a/test/build-test.ts +++ b/test/build-test.ts @@ -124,28 +124,67 @@ describe("build", () => { join(inputDir, "weather.md"), "# It's going to be ${weather}!" + "\n\n" + - "```js\nconst weather = await FileAttachment('weather.txt').text(); display(weather);\n```" + "```js\nconst weather = await FileAttachment('weather.txt').text(); display(weather);\n```" + + "\n\n" + + "```js\nconst generated = await FileAttachment('generated.txt').text(); display(generated);\n```" + + "\n\n" + + "```js\nconst internal = await FileAttachment('internal.txt').text(); display(internal);\n```" + + "\n\n" + + "```js\nconst thing = await FileAttachment('parameterized-thing.txt').text(); display(thing);\n```" + + "\n\n" + + "```js\nimport * from '/module-internal.js';\n```" ); await mkdir(join(inputDir, "cities")); await writeFile(join(inputDir, "cities", "index.md"), "# Cities"); await writeFile(join(inputDir, "cities", "portland.md"), "# Portland"); - // A non-page file that should not be included + // exported files await writeFile(join(inputDir, "weather.txt"), "sunny"); + await writeFile(join(inputDir, "generated.txt.ts"), "process.stdout.write('hello');"); + await writeFile(join(inputDir, "parameterized-[page].txt.ts"), "process.stdout.write('hello');"); + // /module-exported.js, /module-internal.js + await writeFile(join(inputDir, "module-[type].js"), "console.log(observable.params.type);"); + // not exported + await writeFile(join(inputDir, "internal.txt.ts"), "process.stdout.write('hello');"); const outputDir = await mkdtemp(tmpPrefix + "output-"); const cacheDir = await mkdtemp(tmpPrefix + "output-"); - const config = normalizeConfig({root: inputDir, output: outputDir}, inputDir); + const config = normalizeConfig( + { + root: inputDir, + output: outputDir, + dynamicPaths: [ + "/module-exported.js", + "/weather.txt", + "/generated.txt", + "/parameterized-thing.txt", + "/parameterized-[page].txt" + ] + }, + inputDir + ); const effects = new LoggingBuildEffects(outputDir, cacheDir); await build({config}, effects); effects.buildManifest!.pages.sort((a, b) => ascending(a.path, b.path)); - assert.deepEqual(effects.buildManifest, { + const { + config: {root}, + ...manifest + } = effects.buildManifest!; + assert.equal(typeof root, "string"); + assert.deepEqual(manifest, { pages: [ - {path: "/", title: "Hello, world!"}, - {path: "/cities/", title: "Cities"}, - {path: "/cities/portland", title: "Portland"}, - {path: "/weather", title: "It's going to be !"} - ] + {path: "/", title: "Hello, world!", source: "/index.md"}, + {path: "/cities/", title: "Cities", source: "/cities/index.md"}, + {path: "/cities/portland", title: "Portland", source: "/cities/portland.md"}, + {path: "/weather", title: "It's going to be !", source: "/weather.md"} + ], + files: [ + {path: "/weather.txt", source: "/weather.txt"}, + {path: "/generated.txt", source: "/generated.txt.ts"}, + {path: "/parameterized-thing.txt", source: "/parameterized-[page].txt.ts"}, + {path: "/parameterized-[page].txt", source: "/parameterized-[page].txt.ts"} + ], + modules: [{path: "/module-exported.js", source: "/module-[type].js"}] }); await Promise.all([inputDir, cacheDir, outputDir].map((dir) => rm(dir, {recursive: true}))).catch(() => {}); diff --git a/test/deploy-test.ts b/test/deploy-test.ts index 7c09a3419..abca7ae80 100644 --- a/test/deploy-test.ts +++ b/test/deploy-test.ts @@ -8,7 +8,7 @@ import type {DeployEffects, DeployOptions} from "../src/deploy.js"; import {deploy, promptDeployTarget} from "../src/deploy.js"; import {CliError, isHttpError} from "../src/error.js"; import {visitFiles} from "../src/files.js"; -import type {ObservableApiClientOptions, PostDeployUploadedRequest} from "../src/observableApiClient.js"; +import type {ObservableApiClientOptions} from "../src/observableApiClient.js"; import type {GetCurrentUserResponse} from "../src/observableApiClient.js"; import {ObservableApiClient} from "../src/observableApiClient.js"; import type {DeployConfig} from "../src/observableApiConfig.js"; @@ -724,7 +724,7 @@ describe("deploy", () => { it("includes a build manifest if one was generated", async () => { const deployId = "deploy456"; - let buildManifestPages: PostDeployUploadedRequest["pages"] | null = null; + let buildManifestPages: BuildManifest["pages"] | null = null; getCurrentObservableApi() .handleGetCurrentUser() .handleGetProject(DEPLOY_CONFIG) @@ -744,7 +744,12 @@ describe("deploy", () => { deployConfig: DEPLOY_CONFIG, fixedInputStatTime: new Date("2024-03-09"), fixedOutputStatTime: new Date("2024-03-10"), - buildManifest: {pages: [{path: "/", title: "Build test case"}]} + buildManifest: { + config: {root: "src"}, + pages: [{path: "/", title: "Build test case"}], + modules: [], + files: [] + } }); effects.clack.inputs = ["fix some bugs"]; // "what changed?" await deploy(TEST_OPTIONS, effects); diff --git a/test/output/block-expression.md.json b/test/output/block-expression.md.json index 1fb8ce160..e65ceda01 100644 --- a/test/output/block-expression.md.json +++ b/test/output/block-expression.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "block-expression.md" } \ No newline at end of file diff --git a/test/output/comment.md.json b/test/output/comment.md.json index 7cf6ce0b3..c1c82a360 100644 --- a/test/output/comment.md.json +++ b/test/output/comment.md.json @@ -2,5 +2,6 @@ "data": {}, "title": null, "style": null, - "code": [] + "code": [], + "path": "comment.md" } \ No newline at end of file diff --git a/test/output/dollar-expression.md.json b/test/output/dollar-expression.md.json index 1fb8ce160..a1582b300 100644 --- a/test/output/dollar-expression.md.json +++ b/test/output/dollar-expression.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "dollar-expression.md" } \ No newline at end of file diff --git a/test/output/dot-graphviz.md.json b/test/output/dot-graphviz.md.json index fc1fb13a8..d303bb475 100644 --- a/test/output/dot-graphviz.md.json +++ b/test/output/dot-graphviz.md.json @@ -52,5 +52,6 @@ }, "mode": "block" } - ] + ], + "path": "dot-graphviz.md" } \ No newline at end of file diff --git a/test/output/double-quote-expression.md.json b/test/output/double-quote-expression.md.json index a128cea86..96f89be73 100644 --- a/test/output/double-quote-expression.md.json +++ b/test/output/double-quote-expression.md.json @@ -23,5 +23,6 @@ }, "mode": "inline" } - ] + ], + "path": "double-quote-expression.md" } \ No newline at end of file diff --git a/test/output/embedded-expression.md.json b/test/output/embedded-expression.md.json index cd8ebe9fa..d30d33cda 100644 --- a/test/output/embedded-expression.md.json +++ b/test/output/embedded-expression.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "embedded-expression.md" } \ No newline at end of file diff --git a/test/output/escaped-expression.md.json b/test/output/escaped-expression.md.json index c1cc6ae7b..2dcb9e9a8 100644 --- a/test/output/escaped-expression.md.json +++ b/test/output/escaped-expression.md.json @@ -163,5 +163,6 @@ }, "mode": "inline" } - ] + ], + "path": "escaped-expression.md" } \ No newline at end of file diff --git a/test/output/fenced-code-options.md.json b/test/output/fenced-code-options.md.json index ba1497bb5..112ab726e 100644 --- a/test/output/fenced-code-options.md.json +++ b/test/output/fenced-code-options.md.json @@ -275,5 +275,6 @@ }, "mode": "block" } - ] + ], + "path": "fenced-code-options.md" } \ No newline at end of file diff --git a/test/output/fenced-code.md.json b/test/output/fenced-code.md.json index 39b32715a..5ec6c0729 100644 --- a/test/output/fenced-code.md.json +++ b/test/output/fenced-code.md.json @@ -89,5 +89,6 @@ }, "mode": "block" } - ] + ], + "path": "fenced-code.md" } \ No newline at end of file diff --git a/test/output/fetch-parent-dir.md.json b/test/output/fetch-parent-dir.md.json index 7d93502a1..92043fa09 100644 --- a/test/output/fetch-parent-dir.md.json +++ b/test/output/fetch-parent-dir.md.json @@ -245,5 +245,6 @@ }, "mode": "block" } - ] + ], + "path": "fetch-parent-dir.md" } \ No newline at end of file diff --git a/test/output/heading-expression.md.json b/test/output/heading-expression.md.json index 1fb8ce160..e53362863 100644 --- a/test/output/heading-expression.md.json +++ b/test/output/heading-expression.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "heading-expression.md" } \ No newline at end of file diff --git a/test/output/hello-world.md.json b/test/output/hello-world.md.json index 2026591f2..7d1748ff7 100644 --- a/test/output/hello-world.md.json +++ b/test/output/hello-world.md.json @@ -2,5 +2,6 @@ "data": {}, "title": "Hello, world!", "style": null, - "code": [] + "code": [], + "path": "hello-world.md" } \ No newline at end of file diff --git a/test/output/indented-inline.md.json b/test/output/indented-inline.md.json index e17517e59..e7a066e46 100644 --- a/test/output/indented-inline.md.json +++ b/test/output/indented-inline.md.json @@ -23,5 +23,6 @@ }, "mode": "inline" } - ] + ], + "path": "indented-inline.md" } \ No newline at end of file diff --git a/test/output/inline-expression.md.json b/test/output/inline-expression.md.json index 1fb8ce160..e1677adb4 100644 --- a/test/output/inline-expression.md.json +++ b/test/output/inline-expression.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "inline-expression.md" } \ No newline at end of file diff --git a/test/output/inline-following-backticks.md.json b/test/output/inline-following-backticks.md.json index 20ae2b276..6606971c8 100644 --- a/test/output/inline-following-backticks.md.json +++ b/test/output/inline-following-backticks.md.json @@ -34,5 +34,6 @@ }, "mode": "inline" } - ] + ], + "path": "inline-following-backticks.md" } \ No newline at end of file diff --git a/test/output/inline-within-lists.md.json b/test/output/inline-within-lists.md.json index 1fb8ce160..b4fc92124 100644 --- a/test/output/inline-within-lists.md.json +++ b/test/output/inline-within-lists.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "inline-within-lists.md" } \ No newline at end of file diff --git a/test/output/jsx.md.json b/test/output/jsx.md.json index e8ab80d09..6b095d675 100644 --- a/test/output/jsx.md.json +++ b/test/output/jsx.md.json @@ -412,5 +412,6 @@ }, "mode": "jsx" } - ] + ], + "path": "jsx.md" } \ No newline at end of file diff --git a/test/output/linkify.md.json b/test/output/linkify.md.json index 98770d6cb..cea971ba6 100644 --- a/test/output/linkify.md.json +++ b/test/output/linkify.md.json @@ -2,5 +2,6 @@ "data": {}, "title": "Linkify", "style": null, - "code": [] + "code": [], + "path": "linkify.md" } \ No newline at end of file diff --git a/test/output/local-fetch.md.json b/test/output/local-fetch.md.json index 2afe8aa03..8f3dc4f01 100644 --- a/test/output/local-fetch.md.json +++ b/test/output/local-fetch.md.json @@ -69,5 +69,6 @@ }, "mode": "block" } - ] + ], + "path": "local-fetch.md" } \ No newline at end of file diff --git a/test/output/malformed-block.md.json b/test/output/malformed-block.md.json index 1f1097a0a..2ffbf20be 100644 --- a/test/output/malformed-block.md.json +++ b/test/output/malformed-block.md.json @@ -2,5 +2,6 @@ "data": {}, "title": "Malformed block", "style": null, - "code": [] + "code": [], + "path": "malformed-block.md" } \ No newline at end of file diff --git a/test/output/markdown-in-html.md.json b/test/output/markdown-in-html.md.json index 7bc9c0071..f0fc35137 100644 --- a/test/output/markdown-in-html.md.json +++ b/test/output/markdown-in-html.md.json @@ -2,5 +2,6 @@ "data": {}, "title": "Markdown in HTML", "style": null, - "code": [] + "code": [], + "path": "markdown-in-html.md" } \ No newline at end of file diff --git a/test/output/mermaid.md.json b/test/output/mermaid.md.json index fbc4ca5c8..74154c712 100644 --- a/test/output/mermaid.md.json +++ b/test/output/mermaid.md.json @@ -57,5 +57,6 @@ }, "mode": "block" } - ] + ], + "path": "mermaid.md" } \ No newline at end of file diff --git a/test/output/script-expression.md.json b/test/output/script-expression.md.json index a1f33a334..ebc117757 100644 --- a/test/output/script-expression.md.json +++ b/test/output/script-expression.md.json @@ -2,5 +2,6 @@ "data": {}, "title": "Script expression", "style": null, - "code": [] + "code": [], + "path": "script-expression.md" } \ No newline at end of file diff --git a/test/output/setext.md.json b/test/output/setext.md.json index 1fb8ce160..90ae0e580 100644 --- a/test/output/setext.md.json +++ b/test/output/setext.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "setext.md" } \ No newline at end of file diff --git a/test/output/single-quote-expression.md.json b/test/output/single-quote-expression.md.json index 0a0726ccf..7a0c40c14 100644 --- a/test/output/single-quote-expression.md.json +++ b/test/output/single-quote-expression.md.json @@ -23,5 +23,6 @@ }, "mode": "inline" } - ] + ], + "path": "single-quote-expression.md" } \ No newline at end of file diff --git a/test/output/svg-placeholder.md.json b/test/output/svg-placeholder.md.json index e17517e59..69b3b454a 100644 --- a/test/output/svg-placeholder.md.json +++ b/test/output/svg-placeholder.md.json @@ -23,5 +23,6 @@ }, "mode": "inline" } - ] + ], + "path": "svg-placeholder.md" } \ No newline at end of file diff --git a/test/output/template-expression.md.json b/test/output/template-expression.md.json index 1c1980b1b..275d95190 100644 --- a/test/output/template-expression.md.json +++ b/test/output/template-expression.md.json @@ -34,5 +34,6 @@ }, "mode": "inline" } - ] + ], + "path": "template-expression.md" } \ No newline at end of file diff --git a/test/output/tex-block.md.json b/test/output/tex-block.md.json index e6ae7abf6..8e26ac891 100644 --- a/test/output/tex-block.md.json +++ b/test/output/tex-block.md.json @@ -65,5 +65,6 @@ }, "mode": "block" } - ] + ], + "path": "tex-block.md" } \ No newline at end of file diff --git a/test/output/tex-expression.md.json b/test/output/tex-expression.md.json index 73ef2a851..f5e16d84a 100644 --- a/test/output/tex-expression.md.json +++ b/test/output/tex-expression.md.json @@ -101,5 +101,6 @@ }, "mode": "inline" } - ] + ], + "path": "tex-expression.md" } \ No newline at end of file diff --git a/test/output/triple-backtick-inline.md.json b/test/output/triple-backtick-inline.md.json index 1fb8ce160..df6aca3e4 100644 --- a/test/output/triple-backtick-inline.md.json +++ b/test/output/triple-backtick-inline.md.json @@ -36,5 +36,6 @@ }, "mode": "inline" } - ] + ], + "path": "triple-backtick-inline.md" } \ No newline at end of file diff --git a/test/output/wellformed-block.md.json b/test/output/wellformed-block.md.json index 71437db8e..073862e44 100644 --- a/test/output/wellformed-block.md.json +++ b/test/output/wellformed-block.md.json @@ -2,5 +2,6 @@ "data": {}, "title": "Well-formed block", "style": null, - "code": [] + "code": [], + "path": "wellformed-block.md" } \ No newline at end of file diff --git a/test/output/yaml-frontmatter.md.json b/test/output/yaml-frontmatter.md.json index c4e1d1987..39b04ee46 100644 --- a/test/output/yaml-frontmatter.md.json +++ b/test/output/yaml-frontmatter.md.json @@ -9,5 +9,6 @@ }, "title": "YAML", "style": "./custom.css", - "code": [] + "code": [], + "path": "yaml-frontmatter.md" } \ No newline at end of file