mcpField
Q
quarto-authoring

quarto-authoring

github.com/posit-devドキュメント5511.4k 回インストール今日更新
リポジトリ

quarto-authoring について

quarto-authoringは、Quarto文書の作成を支援するスキルです。文書構成からコードセル、図、引用、レイアウトまで、タスク別のリファレンスを備え、既存プロジェクトの移行にも対応します。

主な機能

  1. 01Quarto文書の基本構成ガイド
  2. 02コードセルと実行設定
  3. 03図、表、相互参照
  4. 04引用、コールアウト、図解
  5. 05レイアウト、拡張機能、YAML設定
  6. 06移行用リファレンス

活用シーン

  1. 01HTML、PDF、プレゼンテーションの作成
  2. 02図や表へのキャプションと参照の追加
  3. 03コードセルと計算エンジンの設定
  4. 04既存プロジェクトのQuartoへの移行

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/posit-dev/skills --skill quarto-authoring

インストール後、Claude Code で/quarto-authoringを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
callouts.md
citations.md
code-cells.md
conditional-content.md
conversion-blogdown.md
conversion-bookdown.md
conversion-distill.md
conversion-jupyter.md
conversion-rmarkdown.md
conversion-xaringan.md
cross-references.md
diagrams.md
divs-and-spans.md
engines.md
extensions.md
figures.md
layout.md
markdown-linting.md
shortcodes.md
tables.md
yaml-front-matter.md

詳細

Quarto の文書作成

このスキルは Quarto CLI v1.9.36 (2026-03-24) に基づいています。

用途に応じた参照先

タスク:新しい Quarto ドキュメントを作成する 使用:以下の「QMD の基本」を参照してから、該当するリファレンスファイルを確認してください

タスク:相互参照を追加する 使用:references/cross-references.md

タスク:コードセルを設定する 使用:references/code-cells.md

タスク:キャプション付きの図を追加する 使用:references/figures.md

タスク:表を作成する 使用:references/tables.md

タスク:引用と参考文献を追加する 使用: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

タスク:計算エンジン(knitr、jupyter、julia)を選択または設定する 使用:references/engines.md

移行(既存プロジェクトを変換する場合のみ)

新しい Quarto ドキュメントを作成する場合は、これらのリファレンスを読まないでください。 ユーザーから既存プロジェクトの変換または移行を明示的に依頼された場合に限り、ソース形式に対応するものを読んでください。

QMD の基本

基本的なドキュメント構造
---
title: "Document Title"
author: "Author Name"
date: today
format: html
---

Content goes here.

Quarto ドキュメントは、次の 2 つの主な部分で構成されます。

  1. YAML フロントマター:先頭に記述するメタデータと設定で、--- で囲みます。
  2. Markdown コンテンツ:標準的な Markdown 構文を使った本文です。
Div と Span

Div は、コロン 3 つを使ったフェンス構文で記述します。

::: {.class-name}
Content inside the div.
:::

Span は、角括弧を使った構文で記述します。

This is [important text]{.highlight}.

詳細:references/divs-and-spans.md

コードセルオプションの構文

コードセルは、トリプルバッククォートと波括弧で囲んだ言語識別子で始まります。 コードセルは、出力を生成するために実行できるコードブロックです。

Quarto では、セルオプションに言語のコメント記号と | を使います。オプションにはドットではなくハイフンを使います(例:fig.cap ではなく fig-cap)。

  • R、Python、Julia:#|
  • Mermaid:%%|
  • Graphviz/DOT://|
```{language}
#| label: fig-example
#| echo: false
#| fig-cap: "A scatter plot example."

# code that produces a figure
```

ドキュメント全体の既定値は、YAML フロントマターで設定します。

execute:
  echo: false
  warning: false

キャッシュ — エンジンごとの重要な違い: #| cache: true を提案するのは、R コードセル(knitr エンジン)の場合に限ってください。 ほかの言語のセルでは提案しないでください。機能せず、警告なしで無視されます。 knitr 以外のエンジンを使う場合の正しい方法は、トップレベルの YAML フロントマターで execute: cache: true を指定することだけです。 Python/Jupyter では jupyter-cache が必要です(pip install jupyter-cache)。

execute:
  cache: true

詳細:references/code-cells.md

相互参照

ラベルは型のプレフィックスで始める必要があります。@ を使って参照します。

  • 図:fig- プレフィックス。例:#| label: fig-plot → @fig-plot
  • 表:tbl- プレフィックス。例:#| label: tbl-data → @tbl-data
  • セクション:sec- プレフィックス。例:{#sec-intro} → @sec-intro
  • 数式:eq- プレフィックス。例:{#eq-model} → @eq-model
```{language}
#| label: fig-plot
#| fig-cap: "A caption for the plot."

# code that produces a figure
```

See @fig-plot for the results.

詳細:references/cross-references.md

コールアウトブロック

5 つの種類があります:note、warning、important、tip、caution。

::: {.callout-note}
This is a note callout.
:::

::: {.callout-warning}

## Custom Title

This is a warning with a custom title.

:::

詳細:references/callouts.md

図
![Caption text](image.png){#fig-name fig-alt="Alt text"}

サブ図:

::: {#fig-group layout-ncol=2}
![Sub caption 1](image1.png){#fig-sub1}

![Sub caption 2](image2.png){#fig-sub2}

Main caption for the group.
:::

詳細:references/figures.md

表
::: {#tbl-example}

| Column 1 | Column 2 |
| -------- | -------- |
| Data 1   | Data 2   |

Table caption.
:::

詳細:references/tables.md

引用
According to @smith2020, the results show...
Multiple citations [@smith2020; @jones2021].

YAML で設定します:

bibliography: references.bib
csl: apa.csl

詳細:references/citations.md

よく使うワークフロー

HTML ドキュメントの作成
title: "My Report"
author: "Your Name"
date: today
format:
  html:
    toc: true
    code-fold: true
    theme: cosmo
PDF ドキュメントの作成
title: "My Report"
format:
  pdf:
    documentclass: article
    papersize: a4
RevealJS プレゼンテーションの作成
---
title: "My Presentation"
format: revealjs
---

## First Slide

Content here.

## Second Slide

More content.
Quarto プロジェクトのセットアップ

プロジェクトのルートに _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

リソース

コメント