You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Posit Quarto如何同时生成GFM(GitHub风格Markdown)和HTML格式?

在Quarto中同时渲染GFM和HTML格式是否可行?

当然可行,不过你提供的YAML配置存在语法问题,Quarto的多格式渲染需要严格遵循YAML的键值对语法。

你当前的format字段里,gfm没有使用键值对格式(缺少冒号),会导致Quarto无法正确识别格式配置。

正确的配置示例如下:

--- 
title: "My title"
author:
  - name: MyName
format:
  gfm: {}  # 空大括号表示使用GFM的默认配置
  html:
    self-contained: true
    number-sections: true
---

如果GFM不需要额外配置,也可以用更简洁的数组写法:

--- 
title: "My title"
author:
  - name: MyName
format: [gfm, html]
html:
  self-contained: true
  number-sections: true
---

配置好之后,直接执行Quarto渲染命令(比如quarto render your-file.qmd),就能同时生成GFM格式的.md文件和HTML格式的.html文件。

内容的提问来源于stack exchange,提问作者Thomas Speidel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 10:54:59