-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration test for YAML parsing and dash to dot conversion (#88)
this goes with yihui/knitr#2282
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Using dash options in YAML options header | ||
--- | ||
|
||
In Quarto, it is recommended to use YAML options format with dash in option name instead of dot. In knitr 1.44, any chunk option with dash will be transformed to its dot counterpart. This is because knitr is responsible for engine option parsing in Quarto. | ||
|
||
This document checks that YAML options are parsed correctly and that dash option are correctly converted when provided in YAML. | ||
|
||
```{r} | ||
#| eval: true | ||
#| echo: false | ||
#| out-width: 850 | ||
#| sql-max-print: 1000 | ||
#| fig-cap: caption | ||
#| fig-dpi: 750 | ||
#| fig-format: svg | ||
knitr::opts_current$get(c("echo","out.width", "sql.max.print", "fig.cap", "dpi", "dev")) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Using dash options in YAML options header | ||
--- | ||
|
||
In Quarto, it is recommended to use YAML options format with dash in option name instead of dot. In knitr 1.44, any chunk option with dash will be transformed to its dot counterpart. This is because knitr is responsible for engine option parsing in Quarto. | ||
|
||
This document checks that YAML options are parsed correctly and that dash option are correctly converted when provided in YAML. | ||
|
||
|
||
``` | ||
## $echo | ||
## [1] FALSE | ||
## | ||
## $out.width | ||
## [1] 850 | ||
## | ||
## $sql.max.print | ||
## [1] 1000 | ||
## | ||
## $fig.cap | ||
## [1] "caption" | ||
## | ||
## $dpi | ||
## [1] 750 | ||
## | ||
## $dev | ||
## [1] "svg" | ||
``` | ||
|