Skip to content

Commit 28b882d

Browse files
committed
Properly include embedded figures
1 parent bdac632 commit 28b882d

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/command/render/render.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,15 @@ export async function renderPandoc(
282282
supporting.push(...htmlPostProcessResult.supporting);
283283
}
284284

285+
// Add notebook embed results
286+
if (
287+
notebookResult.supporting &&
288+
notebookResult.supporting.length > 0
289+
) {
290+
supporting = supporting || [];
291+
supporting.push(...notebookResult.supporting);
292+
}
293+
285294
withTiming("render-cleanup", () =>
286295
renderCleanup(
287296
context.target.input,

src/core/jupyter/jupyter-embed.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ export async function replaceNotebookPlaceholders(
148148
flags: RenderFlags,
149149
markdown: string,
150150
) {
151+
// Assets
152+
const assets = jupyterAssets(
153+
input,
154+
to,
155+
);
156+
151157
let match = kPlaceholderRegex.exec(markdown);
152158
let includes;
153159
while (match) {
@@ -166,12 +172,6 @@ export async function replaceNotebookPlaceholders(
166172
? placeholderToOptions(placeholderStr)
167173
: {};
168174

169-
// Assets
170-
const assets = jupyterAssets(
171-
input,
172-
to,
173-
);
174-
175175
// Compute appropriate includes based upon the note
176176
// dependendencies
177177
const notebookIncludes = () => {
@@ -218,6 +218,7 @@ export async function replaceNotebookPlaceholders(
218218
return {
219219
includes,
220220
markdown,
221+
supporting: [join(assets.base_dir, assets.supporting_dir)],
221222
};
222223
}
223224

0 commit comments

Comments
 (0)