I'm working on a markdown document in Rstudio that compares Perl and R. What I'd like to be able to do is have different code block background colors depending on the language used. For example
R code block
```{r}
dog <- 1
cat <- 2
dog + cat
```
Perl code block
```{r, engine='perl'}
$dog = 1;
$cat = 2;
print $dog + $cat;
```
If you generate an html file using knitr with the above code, the r code block has a solid grey background while the output from the code block has a white/transparent background.
However, the Perl code block and output has a white/transparent background which looks confusing. My hope is that there's an elegant way to do this in markdown/knitr.