-
Notifications
You must be signed in to change notification settings - Fork 327
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
Correctly replace knitr options which had their name normalized from - to . #5852
Comments
@yihui I would like your thoughts on this. Currently in knitr we do not normalize all the dashed form option like quarto-cli/src/resources/rmd/hooks.R Lines 631 to 634 in 5df9451
quarto-cli/src/resources/rmd/hooks.R Lines 668 to 749 in 5df9451
However, it is missing the merging step, meaning that if Initially it was done by Quarto, but now this step is run only for old knitr quarto-cli/src/resources/rmd/hooks.R Lines 604 to 631 in 5df9451
In yihui/knitr@e24dcb4, only normalization for If we do that in knitr directly, it would solve issue in Quarto. Related issues is
Should we do that in knitr ? Otherwise, I need to tweak options after knitr parsing to fix this, or maybe revert back to quarto parsing the YAML options using new exported Thanks for your input. |
I think we can normalize all option names inside knitr. I'll take a closer look today. |
Ok great ! Here is the branch I had in case we wanted to fix both issues in Quarto It seems better to me to do it in knitr, even if this means that user's would have to update knitr. |
…(converting dashes to dots)
This has been fixed on knitr - from next version 1.44 (and from current dev version 1.43.7), all dash option are changed to their dot version. This includes |
Change was introduced in knitr to fix quarto issues #5852 and #6576. Pre 1.44, knitr was only normalizing `fig-` to `fig.` and `out-` to `out.`. Post 1.44, knitr is normalizing from - version to . version its own known knitr chunk options. This means we need to now carefully handle backward compatibility to work with all versions. For future, this simplifies because Quarto-specific options will only be using - versions even during knitting.
Example from
cache-lazy
is an ignored cell option #6491This below won't work
This is because
tidy.opts = NULL
as a defaulttidy-opts
so it won't replace the default. Options have both nowtidy-opts
andtidy.opts
-
to.
in an option hook step, but this will just rename. This means options in knitr have twicetidy.opts
with two different value.Our options hooks should make the replacement.
Longer term, knitr should probably do the normalization as the YAML chunk option parsing step
quarto-cli/src/resources/rmd/hooks.R
Lines 11 to 18 in 5df9451
quarto-cli/src/resources/rmd/hooks.R
Lines 631 to 634 in 5df9451
The text was updated successfully, but these errors were encountered: