Skip to content

Commit

Permalink
Integration test for YAML parsing and dash to dot conversion (#88)
Browse files Browse the repository at this point in the history
this goes with yihui/knitr#2282
  • Loading branch information
cderv authored Aug 28, 2023
1 parent ba9079e commit 63671d7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 125-dash-options.Rmd
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"))
```

29 changes: 29 additions & 0 deletions 125-dash-options.md
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"
```

0 comments on commit 63671d7

Please sign in to comment.