patch added

This commit is contained in:
Meik Hellmund 2023-05-13 23:02:04 +02:00
parent b72b048c1e
commit 144bf1a4c6
2 changed files with 23 additions and 6 deletions

View File

@ -6,14 +6,16 @@ It works with HTML and LaTeX/PDF output.
*It works only with a patched version of quarto.*
Quarto itself supports ANSI colored/styled output only for HTML output and only for output cells of type `execute_result` ( and not for cells of type `stream output`). In all other cases it removes the ANSI escape sequences.
At the moment, Quarto itself supports ANSI colored/styled output only for HTML output and only for output cells of type `execute_result` ( and not for cells of type `stream output`). In all other cases it removes the ANSI escape sequences.
This extension uses a hack employing the `ipynb-filters` option and only works if https://github.com/quarto-dev/quarto-cli/commit/6a4696af6ba5a8a9e3f78e3205b17c86eeecd0f9 is reverted.
This extension uses a hack employing the `ipynb-filters` option and only works if https://github.com/quarto-dev/quarto-cli/commit/6a4696af6ba5a8a9e3f78e3205b17c86eeecd0f9 is reverted:
```shell
cd quarto-cli
patch -p1 < patch-quarto
```
#### Notes
- quarto per default calls pandoc with pandoc's `ipynb-output=best` option. Then pandoc removes ANSI escapes, see https://github.com/jgm/pandoc/commit/5454aad32474472a8f977c941e6f7d70e925bcc5
- so we overwrite this option and the lua filter as to reproduce the behaviour of this option, i.e., select the best output cell variant
- The current quarto behaviour is https://github.com/quarto-dev/quarto-cli/issues/929
All code licenced under [GNU General Public License v2.0 or later](https://spdx.org/licenses/GPL-2.0-or-later.html)

15
patch-quarto Normal file
View File

@ -0,0 +1,15 @@
diff --git a/src/execute/jupyter/jupyter.ts b/src/execute/jupyter/jupyter.ts
index 750eff367..3028c10ed 100644
--- a/src/execute/jupyter/jupyter.ts
+++ b/src/execute/jupyter/jupyter.ts
@@ -286,9 +286,7 @@ export const jupyterEngine: ExecutionEngine = {
// if the source is an ipynb file)
const nbContents = await jupyterNotebookFiltered(
options.target.input,
- isJupyterNotebook(options.target.source)
- ? options.format.execute[kIpynbFilters]
- : [],
+ options.format.execute[kIpynbFilters],
);
const nb = jupyterFromJSON(nbContents);
const assets = jupyterAssets(