Skip to content

Commit 4de52d4

Browse files
committed
Disambiguate embed ipynbs
1 parent 66b7c0e commit 4de52d4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/command/render/output.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ export function outputRecipe(
205205
}
206206
}
207207

208-
const kOutExt = "out";
209-
export function isOutputFile(path: string, ext: string) {
210-
return path.endsWith(`.${kOutExt}.${ext}`);
211-
}
212-
213208
export function normalizeOutputPath(input: string, output: string) {
214209
if (isAbsolute(output)) {
215210
return output;
@@ -220,3 +215,5 @@ export function normalizeOutputPath(input: string, output: string) {
220215
);
221216
}
222217
}
218+
219+
const kOutExt = "out";

src/project/types/manuscript/manuscript.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import {
7979
shouldMakeMecaBundle,
8080
} from "./manuscript-meca.ts";
8181
import { readLines } from "io/mod.ts";
82-
import { isOutputFile } from "../../../command/render/output.ts";
8382
import {
8483
computeProjectArticleFile,
8584
isArticle,
@@ -196,7 +195,16 @@ export const manuscriptProjectType: ProjectType = {
196195
}
197196

198197
// Filter output notebooks
199-
if (isOutputFile(file, "ipynb")) {
198+
const excludeSuffixes = [".out.ipynb", ".embed.ipynb"];
199+
if (
200+
excludeSuffixes.some((suffix) => {
201+
return file.endsWith(suffix);
202+
})
203+
) {
204+
return false;
205+
}
206+
207+
if (file.match(/\.embed\./)) {
200208
return false;
201209
}
202210
return true;

src/render/notebook/notebook-contributor-qmd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,5 @@ async function renderOutputNotebook(
158158

159159
function ipynbOutputFile(nbAbsPath: string) {
160160
const [_dir, stem] = dirAndStem(nbAbsPath);
161-
return `${stem}.ipynb`;
161+
return `${stem}.embed.ipynb`;
162162
}

0 commit comments

Comments
 (0)