rstudio / blastula

Easily send great-looking HTML email messages from R
https://pkgs.rstudio.com/blastula
Other
548 stars 85 forks source link

Is code highlighting possible? #247

Open pschloss opened 3 years ago

pschloss commented 3 years ago

Is it possible to get code highlighting applied by default to output from blastula? If I do something like this...

---
title: test
output: blastula::blastula_email
highlight: pygments
---

```{r}
library(tidyverse)

filter(starwars, species == "Human")
```.

Then the outputted code block has a white background and there's no code highlighting. If I take the highlight line out of the YAML, I get the same output. I can change the background color with simple css, but is there an easier way and is it possible to get the code highlighting like a typical Rmd output document?

pschloss commented 3 years ago

If I do this instead...

---
title: test
output:
  blastula::blastula_email:
    highlight: pygments
---

It complains...

Error in rmarkdown::html_document(toc = toc, toc_depth = toc_depth, toc_float = toc_float,  : 
  formal argument "highlight" matched by multiple actual arguments