使用 Quarto 创建独立的 HTML 文件

dpe*_*pel 8 r quarto

应该可以使用 Quarto 创建一个独立的 HTML 文件

format:
  html:
    embed-resources: true
Run Code Online (Sandbox Code Playgroud)

如此处所述: https://quarto.org/docs/output-formats/html-basics.html#self-contained,但是当我尝试通过电子邮件发送生成的 HTML 文件时,图表不会出现,如下图所示 -[

我得到一个文件夹和 HTML 文件

![在此处输入图像描述][2]][2]。

(我认为它上周有效,我不确定,但我确实得到了一个独立的文件)。

难道我做错了什么?

微量元素:

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

```{r}
library(ggplot2)

mtcars |> 
  ggplot(aes(mpg, disp)) + 
  geom_point() 
```
Run Code Online (Sandbox Code Playgroud)

使用system("quarto render elevators.qmd --output elevators.html")给出相同的结果。

dpe*_*pel 10

self-contained: true对我有用,例如,

format: 
  html:
    self-contained: true
Run Code Online (Sandbox Code Playgroud)

using Quarto v1.2- 撰写本文时的当前版本

  • 我很确定这与四开本版本有关。我建议指定您的四开本版本以及此答案以供将来参考。 (2认同)