Skip to content

Instantly share code, notes, and snippets.

@ijlyttle
Last active December 11, 2016 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijlyttle/000efb922103ff7bd55625443187e774 to your computer and use it in GitHub Desktop.
Save ijlyttle/000efb922103ff7bd55625443187e774 to your computer and use it in GitHub Desktop.
Sample Rmd file to use for testing knitr with class options
---
title: Background color
output:
html_document:
keep_md: yes
---
You will need a development version of knitr to get this to work (for now).
```
# install.packages("devtools")
install_github("ijlyttle/knitr", ref = "option_class")
```
```{r}
a <- 2
```
```{css}
.badSource { background-color: red; }
.badOutput { background-color: orange; }
```
```{r mtcars}
library("magrittr")
mtcars %>%
summary()
```
Putting in a second (meaningless) class in `class.output`, just to be sure that multiple classes work how I expect.
```{r cars, class.source="badSource", class.output=c("badOutput", "foo")}
summary(cars)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment