Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve convert_chunk_header() #2262

Open
1 of 2 tasks
cderv opened this issue Jun 6, 2023 · 3 comments
Open
1 of 2 tasks

Improve convert_chunk_header() #2262

cderv opened this issue Jun 6, 2023 · 3 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Jun 6, 2023

  • Using .qmd as extension for output name should use type = "yaml".
    This knitr::convert_chunk_header("rapport/pingouins.Rmd", "rapport/pingouins.qmd") should use YAML chunk option in output
  • when using with type: yaml or with .qmd extension, . in options should be replaced with -.
    knitr::convert_chunk_header("rapport/pingouins.qmd", output = identity) should have fig-width and not fig.with (closed by Improve convert_chunk_header for YAML options #2300)
@ALanguillaume
Copy link

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
Copy link

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

@cderv
Copy link
Collaborator Author

cderv commented Jul 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants