yihui / knitr

A general-purpose tool for dynamic report generation in R
https://yihui.org/knitr/
2.36k stars 873 forks source link

Improve `convert_chunk_header()` #2262

Open cderv opened 1 year ago

cderv commented 1 year ago
ALanguillaume commented 11 months ago

What about making sure option are converted from echo = FALSE to #| echo: false ?

Currently : echo = FALSE will yield #| echo = FALSE My humble expectation : echo = FALSE will yield #| echo : false and be fully quarto compliant

ALanguillaume commented 11 months ago

My bad knitr::convert_chunk_header("foo.Rmd", output = "foo.qmd", type = "yaml") solves my problem. Apologies !

cderv commented 11 months ago

You indeed need to use type = "yaml" as it is not the default unless you are converting from a .qmd

knitr::convert_chunk_header("foo.qmd", output = identity)

So you can copy and rename you Rmd file and then convert.

We did that because for Rmd files the YAML syntax is not the prefered multiline syntax. https://yihui.org/en/2022/01/knitr-news/#an-alternative-syntax-for-chunk-options