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
相关产品推荐
相关产品推荐

