Skip to content

Commit c341936

Browse files
authored
Merge pull request #8752 from quarto-dev/bugfix/4802
jupyter - use different name for input .ipynb file
2 parents 9b59f9e + 93a50b7 commit c341936

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

news/changelog-1.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All changes included in 1.5:
2727

2828
## Jupyter
2929

30+
- ([#4802](https://github.com/quarto-dev/quarto-cli/issues/4802)): Change name of temporary input notebook to avoid accidental overwriting.
3031
- ([#8433](https://github.com/quarto-dev/quarto-cli/issues/8433)): Escape jupyter widget states that contain `</script>` so they can be embedded in HTML documents.
3132

3233
## Website Listings

src/execute/jupyter/jupyter.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,13 @@ export const jupyterEngine: ExecutionEngine = {
185185
if (isQmdFile(file) || isPercentScript) {
186186
// write a transient notebook
187187
const [fileDir, fileStem] = dirAndStem(file);
188-
const notebook = join(fileDir, fileStem + ".ipynb");
188+
// See #4802
189+
// I don't love using an extension other than .ipynb for this file,
190+
// but doing something like .quarto.ipynb would require a lot
191+
// of additional changes to our file handling code (without changes,
192+
// our output files would be called $FILE.quarto.html, which
193+
// is not what we want). So for now, we'll use .quarto_ipynb
194+
const notebook = join(fileDir, fileStem + ".quarto_ipynb");
189195
const target = {
190196
source: file,
191197
input: notebook,

0 commit comments

Comments
 (0)