QuartoNotebookRunner.jl
QuartoNotebookRunner.jl copied to clipboard
Make `--color=yes` the default for workers
```{julia}
printstyled(1/7, bold=true, color=:green, reverse=true)
```
doesn't work as expected. It is not enough to set color=true
in IOCapture.capture()
, see
https://github.com/JuliaDocs/IOCapture.jl/blob/874d47adccbf49708e43f2fcc9329695203846cb/src/IOCapture.jl#L112
This patch https://github.com/MHellmund/QuartoNotebookRunner.jl/commit/9609377303cbc8061e8737012d48fd1c81801f50 works but is probably not the best way to go. Perhaps a modified version of IOCapture
, also providing separate cells for stdout and stderr?
Hi @MHellmund, worker processes that run the notebooks don't get passed the color
arg by default. We can consider changing that default if that's what users will prefer. What does the output look like when setting
---
julia:
exeflags: ["--color=yes"]
---
```{julia}
printstyled(1/7, bold=true, color=:green, reverse=true)
```
Can you provide the output .ipynb
result of that cell? We don't of course handle the quarto render
part of rendering in this repo.
Ah, you are absolutely right!
Coloring works with exeflags: ["--color=yes"]
and that is fine.
I did look into the documentation of Malt.jl but not into the source code :-)
Please close this issue.
seems reasonable to make --color=yes
a default flag I would say
seems reasonable to make
--color=yes
a default flag I would say
Initially, I thought about including a fix for this issue in #73. But I started to question whether --color=yes
is a good default setting when I remembered how cumbersome it was to parse log messages with colorized output in another project. Probably that's not a common thing to do in a qmd file but it made me wonder if there are any other negative implications.
Just a note: As far as I know, Quarto keeps (i.e., converts to HTML spans with color attributes) the ANSI sequences in output cells only for HTML based output formats. For other formats like PDF/LaTeX, they are, alas, filtered out at some stage by the Quarto/Pandoc system.
For other formats like PDF/LaTeX, they are, alas, filtered out at some stage by the Quarto/Pandoc system.
Yeah, a bit unfortunate that that happens.
Probably that's not a common thing to do in a qmd file but it made me wonder if there are any other negative implications.
Worth taking into account. Users should still be able to do --color=no
if they want no colour for any particular reason.
Users should still be able to do --color=no
The input flags overwrite each other, so one could still pass --color=no