mcpField
Q
quarto-book

quarto-book

github.com/htlin222文档处理7845 次安装3 周前更新
代码仓库

关于 quarto-book

quarto-book 是用于生成 Quarto Book 项目结构的技能,适合编写书籍、多章节文档、技术手册或文档项目。它提供配置与章节模板,并支持 HTML、PDF、EPUB 和 MS Word 输出。

主要功能

  1. 01生成 Quarto Book 项目结构
  2. 02提供 _quarto.yml 配置模板
  3. 03提供章节模板
  4. 04支持 HTML、PDF、EPUB 和 MS Word

适用场景

  1. 01创建多章节书籍项目
  2. 02搭建技术手册结构
  3. 03生成文档项目配置
  4. 04将书稿渲染为指定格式

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/htlin222/dotfiles --skill quarto-book

安装后在 Claude Code 中输入/quarto-book确认已加载。

附带文件scripts/generate.py

详细介绍

Quarto 图书生成器

生成完整的 Quarto 图书项目结构,并进行适当配置。

适用场景

  • 用户想要创建图书或多章节文档
  • 用户要求设置 Quarto 图书项目
  • 用户需要技术手册或文档结构
  • 用户提到“quarto book”或“book project”

快速生成

运行生成器脚本,并指定图书名称:

python3 ~/.claude/skills/quarto-book/scripts/generate.py <book-name> [--chapters N] [--author "Name"]

或者直接使用 Quarto CLI:

quarto create project book <book-name>

项目结构

mybook/
├── _quarto.yml      # Book configuration
├── index.qmd        # Preface/Introduction
├── intro.qmd        # Chapter 1
├── methods.qmd      # Chapter 2
├── results.qmd      # Chapter 3
├── summary.qmd      # Summary/Conclusion
├── references.qmd   # References
├── references.bib   # Bibliography
└── _book/           # Output directory (generated)

_quarto.yml 模板

project:
  type: book
  output-dir: _book

book:
  title: "Book Title"
  author: "Author Name"
  date: today
  chapters:
    - index.qmd
    - intro.qmd
    - methods.qmd
    - results.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib
csl: apa.csl

format:
  html:
    theme: cosmo
    toc: true
  pdf:
    documentclass: scrbook
    papersize: a4
  epub:
    toc: true

章节模板

# Chapter Title {#sec-chapter-id}

## Section 1

Content here...

## Section 2

More content...

## References

::: {#refs}
:::

命令

命令描述
quarto preview在浏览器中实时预览
quarto render渲染所有格式
quarto render --to html仅渲染 HTML
quarto render --to pdf仅渲染 PDF

多部分结构

包含多个部分的图书:

book:
  chapters:
    - index.qmd
    - part: "Part I: Foundation"
      chapters:
        - basics.qmd
        - theory.qmd
    - part: "Part II: Application"
      chapters:
        - methods.qmd
        - results.qmd
    - references.qmd

输出格式

  • HTML:带搜索功能的交互式网络图书
  • PDF:适合打印的文档(需要 LaTeX)
  • EPUB:电子阅读器格式
  • MS Word:可编辑文档

评论

支持 Markdown