quarto-authoring by posit-dev/skills
npx skills add https://github.com/posit-dev/skills --skill quarto-authoring此技能基于 Quarto CLI v1.8.26。
任务:编写新的 Quarto 文档 使用:遵循下方的“QMD 要点”,然后查看具体的参考文件
任务:将 R Markdown 转换为 Quarto 使用:references/conversion-rmarkdown.md
任务:迁移 bookdown 项目 使用:references/conversion-bookdown.md
任务:迁移 xaringan 幻灯片 使用:references/conversion-xaringan.md
任务:迁移 distill 文章 使用:references/conversion-distill.md
任务:迁移 blogdown 站点 使用:references/conversion-blogdown.md
任务:添加交叉引用 使用:references/cross-references.md
任务:配置代码单元 使用:references/code-cells.md
任务:添加带标题的图表 使用:references/figures.md
任务:创建表格 使用:references/tables.md
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
任务:添加引用和参考文献 使用:references/citations.md
任务:添加标注块 使用:references/callouts.md
任务:添加图表(Mermaid, Graphviz) 使用:references/diagrams.md
任务:控制页面布局 使用:references/layout.md
任务:使用短代码 使用:references/shortcodes.md
任务:添加条件内容 使用:references/conditional-content.md
任务:使用 div 和 span 使用:references/divs-and-spans.md
任务:配置 YAML 前言 使用:references/yaml-front-matter.md
任务:查找和使用扩展 使用:references/extensions.md
任务:应用 Markdown 代码检查规则 使用:references/markdown-linting.md
---
title: "Document Title"
author: "Author Name"
date: today
format: html
---
Content goes here.
一个 Quarto 文档由两个主要部分组成:
--- 包围。Div 使用三个冒号的围栏语法:
::: {.class-name}
Content inside the div.
:::
Span 使用括号语法:
This is [important text]{.highlight}.
代码单元以三个反引号和一个花括号内的语言标识符开始。代码单元是可以执行以产生输出的代码块。
Quarto 使用该语言的注释符号 + | 来表示单元选项。选项使用短横线,而非点号(例如,fig-cap 而非 fig.cap)。
R, Python: #|
Mermaid: %%|
Graphviz/DOT: //|
#| label: fig-example
#| echo: false
#| fig-cap: "A scatter plot example."
plot(x, y)
常用执行选项:
| 选项 | 描述 | 值 |
|---|---|---|
eval | 评估代码 | true, false |
echo | 显示代码 | true, false, fenced |
output | 包含输出 | true, false, asis |
warning | 显示警告 | true, false |
error | 显示错误 | true, false |
include | 包含在输出中 | true, false |
在 YAML 前言中设置文档级默认值:
execute:
echo: false
warning: false
标签必须以类型前缀开头。使用 @ 引用:
图表:fig- 前缀,例如 #| label: fig-plot → @fig-plot
表格:tbl- 前缀,例如 #| label: tbl-data → @tbl-data
章节:sec- 前缀,例如 {#sec-intro} → @sec-intro
公式:eq- 前缀,例如 {#eq-model} → @eq-model
#| label: fig-plot
#| fig-cap: "A caption for the plot."
plot(1)
See @fig-plot for the results.
五种类型:note, warning, important, tip, caution。
::: {.callout-note}
This is a note callout.
:::
::: {.callout-warning}
## Custom Title
This is a warning with a custom title.
:::
{#fig-name fig-alt="Alt text"}
子图:
::: {#fig-group layout-ncol=2}
{#fig-sub1}
{#fig-sub2}
Main caption for the group.
:::
::: {#tbl-example}
| Column 1 | Column 2 |
| -------- | -------- |
| Data 1 | Data 2 |
Table caption.
:::
According to @smith2020, the results show...
Multiple citations [@smith2020; @jones2021].
在 YAML 中配置:
bibliography: references.bib
csl: apa.csl
title: "My Report"
author: "Your Name"
date: today
format:
html:
toc: true
code-fold: true
theme: cosmo
title: "My Report"
format:
pdf:
documentclass: article
papersize: a4
---
title: "My Presentation"
format: revealjs
---
## First Slide
Content here.
## Second Slide
More content.
在项目根目录创建 _quarto.yml:
project:
type: website
website:
title: "My Site"
navbar:
left:
- href: index.qmd
text: Home
- href: about.qmd
text: About
format:
html:
theme: cosmo
每周安装数
152
代码仓库
GitHub 星标数
205
首次出现
2026年2月10日
安全审计
安装于
opencode142
github-copilot140
codex139
gemini-cli138
kimi-cli137
cursor137
This skill is based on Quarto CLI v1.8.26.
Task: Write a new Quarto document Use: Follow "QMD Essentials" below, then see specific reference files
Task: Convert R Markdown to Quarto Use: references/conversion-rmarkdown.md
Task: Migrate bookdown project Use: references/conversion-bookdown.md
Task: Migrate xaringan slides Use: references/conversion-xaringan.md
Task: Migrate distill article Use: references/conversion-distill.md
Task: Migrate blogdown site Use: references/conversion-blogdown.md
Task: Add cross-references Use: references/cross-references.md
Task: Configure code cells Use: references/code-cells.md
Task: Add figures with captions Use: references/figures.md
Task: Create tables Use: references/tables.md
Task: Add citations and bibliography Use: references/citations.md
Task: Add callout blocks Use: references/callouts.md
Task: Add diagrams (Mermaid, Graphviz) Use: references/diagrams.md
Task: Control page layout Use: references/layout.md
Task: Use shortcodes Use: references/shortcodes.md
Task: Add conditional content Use: references/conditional-content.md
Task: Use divs and spans Use: references/divs-and-spans.md
Task: Configure YAML front matter Use: references/yaml-front-matter.md
Task: Find and use extensions Use: references/extensions.md
Task: Apply markdown linting rules Use: references/markdown-linting.md
---
title: "Document Title"
author: "Author Name"
date: today
format: html
---
Content goes here.
A Quarto document consists of two main parts:
---.Divs use fenced syntax with three colons:
::: {.class-name}
Content inside the div.
:::
Spans use bracketed syntax:
This is [important text]{.highlight}.
Details: references/divs-and-spans.md
A code cell starts with triple backticks and a language identifier between curly braces. Code cells are code blocks that can be executed to produce output.
Quarto uses the language's comment symbol + | for cell options. Options use dashes, not dots (e.g., fig-cap not fig.cap).
R, Python: #|
Mermaid: %%|
Graphviz/DOT: //|
#| label: fig-example
#| echo: false
#| fig-cap: "A scatter plot example."
plot(x, y)
Common execution options:
| Option | Description | Values |
|---|---|---|
eval | Evaluate code | true, false |
echo | Show code | true, false, fenced |
output |
Set document-level defaults in YAML front matter:
execute:
echo: false
warning: false
Details: references/code-cells.md
Labels must start with a type prefix. Reference with @:
Figure: fig- prefix, e.g., #| label: fig-plot → @fig-plot
Table: tbl- prefix, e.g., #| label: tbl-data → @tbl-data
Section: sec- prefix, e.g., {#sec-intro} → @sec-intro
Equation: eq- prefix, e.g., →
Details: references/cross-references.md
Five types: note, warning, important, tip, caution.
::: {.callout-note}
This is a note callout.
:::
::: {.callout-warning}
## Custom Title
This is a warning with a custom title.
:::
Details: references/callouts.md
{#fig-name fig-alt="Alt text"}
Subfigures:
::: {#fig-group layout-ncol=2}
{#fig-sub1}
{#fig-sub2}
Main caption for the group.
:::
Details: references/figures.md
::: {#tbl-example}
| Column 1 | Column 2 |
| -------- | -------- |
| Data 1 | Data 2 |
Table caption.
:::
Details: references/tables.md
According to @smith2020, the results show...
Multiple citations [@smith2020; @jones2021].
Configure in YAML:
bibliography: references.bib
csl: apa.csl
Details: references/citations.md
title: "My Report"
author: "Your Name"
date: today
format:
html:
toc: true
code-fold: true
theme: cosmo
title: "My Report"
format:
pdf:
documentclass: article
papersize: a4
---
title: "My Presentation"
format: revealjs
---
## First Slide
Content here.
## Second Slide
More content.
Create _quarto.yml in the project root:
project:
type: website
website:
title: "My Site"
navbar:
left:
- href: index.qmd
text: Home
- href: about.qmd
text: About
format:
html:
theme: cosmo
Weekly Installs
152
Repository
GitHub Stars
205
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode142
github-copilot140
codex139
gemini-cli138
kimi-cli137
cursor137
新闻稿撰写工具:使用 inference.sh CLI 进行事实核查与专业新闻稿创作
7,500 周安装
| Include output |
true, false, asis |
warning | Show warnings | true, false |
error | Show errors | true, false |
include | Include in output | true, false |
{#eq-model}@eq-model#| label: fig-plot
#| fig-cap: "A caption for the plot."
plot(1)
See @fig-plot for the results.