Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create self contained HTML file with Quarto

Tags:

r

quarto

It should be possible to create a self-contained HTML file with Quarto using

format:
  html:
    embed-resources: true

as documented here: https://quarto.org/docs/output-formats/html-basics.html#self-contained, yet when I try to email the resulting HTML file, the chart does not appear, as in this image - [

and I get a file folder along with the HTML file

![enter image description here][2]][2].

(I think it was working last week, I'm not sure but I definitely did get a self-contained file).

Am I doing something wrong?

MWE:

---
title: "foo"
format: 
  html: 
    embed-resources: true
---

```{r}
library(ggplot2)

mtcars |> 
  ggplot(aes(mpg, disp)) + 
  geom_point() 
```

Using system("quarto render elevators.qmd --output elevators.html") gives the same result.

like image 906
dpel Avatar asked Dec 18 '25 04:12

dpel


2 Answers

self-contained: true works for me, e.g.,

format: 
  html:
    self-contained: true

using Quarto v1.2 - the current version at time of writing

like image 168
dpel Avatar answered Dec 19 '25 19:12

dpel


I solved with this:

---
format:
    html: 
       embed-resources: true
---
like image 43
RxT Avatar answered Dec 19 '25 19:12

RxT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!