Skip to content

Commit

Permalink
Don't run ipynb-filters for qmd source files
Browse files Browse the repository at this point in the history
The idea behind ipynb-filters is that you have a notebook created for some other purpose / within some other system that you want to adapt for processing by quarto.

However, if you are creating a qmd no such adaptation is required because the file is natively targeting quarto (and can be filtered as required with standard pandoc filters)
  • Loading branch information
jjallaire committed Aug 15, 2022
1 parent 912d535 commit 6a4696a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.1.md
Expand Up @@ -4,6 +4,7 @@
- Refine over-detection of Jupyter shell magics (which prevented kernel daemonization)
- Use on-disk cache for filtered jupyter notebooks
- Prevent error in `quarto check` when Jupyter is installed but has no Python kernel
- Don't run `ipynb-filters` for qmd source files (only run them for ipynb source files)

## Knitr

Expand Down
7 changes: 5 additions & 2 deletions src/execute/jupyter/jupyter.ts
Expand Up @@ -271,10 +271,13 @@ export const jupyterEngine: ExecutionEngine = {
}
}

// convert to markdown and write to target
// convert to markdown and write to target (only run notebook filters
// if the source is an ipynb file)
const nbContents = await jupyterNotebookFiltered(
options.target.input,
options.format.execute[kIpynbFilters],
isJupyterNotebook(options.target.source)
? options.format.execute[kIpynbFilters]
: [],
);
const nb = jupyterFromJSON(nbContents);
const assets = jupyterAssets(
Expand Down

0 comments on commit 6a4696a

Please sign in to comment.