From notes-skills
Converts Markdown documents into professionally styled PDF whitepapers with Apple design aesthetic. Supports full Markdown syntax, auto-generated covers and tables of contents, and handles WebP images.
How this skill is triggered — by the user, by Claude, or both
Slash command
/notes-skills:markdown-to-pdfThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
将 Markdown 文档转换为专业的苹果设计风格 PDF 白皮书。
将 Markdown 文档转换为专业的苹果设计风格 PDF 白皮书。
重大改进:
依赖变更:
# 旧版本 (v1.0)
pip3 install markdown2 weasyprint
brew install pango # 复杂
# 新版本 (v2.0)
pip3 install markdown pdfkit Pillow
brew install wkhtmltopdf # 简单
# 转换单个文件
python scripts/convert.py input.md
# 指定输出文件名
python scripts/convert.py input.md -o "我的白皮书.pdf"
# 自定义标题和作者
python scripts/convert.py input.md --title "技术白皮书" --author "花叔"
# 一键执行: 图片处理 + PDF 生成
python scripts/workflow.py input.md
# 跳过图片处理
python scripts/workflow.py input.md --skip-images
# 完整自定义
python scripts/workflow.py input.md \
--title "技术白皮书" \
--author "团队" \
-o "output.pdf"
# 步骤 1: 分析图片格式
python scripts/analyze_images.py
# 步骤 2: 转换 WebP 图片
python scripts/batch_convert_images.py
# 步骤 3: 更新 Markdown 引用
python scripts/update_markdown_refs.py
# 步骤 4: 生成 PDF
python scripts/convert.py input.md
你的 Markdown 文档应该遵循以下结构:
# 文档标题
## 1. 第一章
### 1.1 第一节
### 1.2 第二节
## 2. 第二章
### 2.1 第一节
关键规则:
## 1. 标题 (数字 + 点 + 空格 + 标题)### 1.1 标题 (数字.数字 + 空格 + 标题)将 Markdown 转换为 PDF,支持:
检测图片实际格式:
批量转换 WebP 为 PNG:
更新 Markdown 中的图片引用:
一键执行所有步骤:
pip3 install markdown pdfkit Pillow
# macOS
brew install wkhtmltopdf
# Linux
sudo apt-get install wkhtmltopdf
# 或下载二进制: https://wkhtmltopdf.org/downloads.html
A: 确保你的 Markdown 使用了正确的章节格式:
## 1. 标题 而不是 ## 标题### 1.1 标题 而不是 ### 标题A: 确保使用三个反引号包裹:
```python
def hello():
print("Hello")
```
A: 使用标准的 Markdown 表格语法:
| 列1 | 列2 |
|-----|-----|
| 值1 | 值2 |
A:
# macOS
brew install wkhtmltopdf
# Linux
sudo apt-get install wkhtmltopdf
# 或下载二进制
# https://wkhtmltopdf.org/downloads.html
A: 使用完整工作流:
python scripts/workflow.py input.md
它会自动处理所有图片问题。
A: 查看 UPGRADE.md 文档了解详细升级步骤。
如果需要自定义样式,可以修改 scripts/convert.py 中的 CSS 变量:
# 主色调
PRIMARY_COLOR = '#06c' # 苹果蓝
TEXT_COLOR = '#1d1d1f' # 主文本黑色
GRAY_COLOR = '#86868b' # 浅灰色
# 字体大小
COVER_TITLE_SIZE = '64pt'
H2_SIZE = '22pt'
H3_SIZE = '17pt'
BODY_SIZE = '11pt'
.claude/skills/markdown-to-pdf/
├── SKILL.md # 本文件
├── README.md # 快速开始
├── EXAMPLES.md # 使用示例
├── UPGRADE.md # 升级指南
├── WORKFLOW.md # 工作流文档
└── scripts/
├── convert.py # 核心转换工具
├── analyze_images.py # 图片分析
├── batch_convert_images.py # 批量转换
├── update_markdown_refs.py # 引用更新
└── workflow.py # 完整工作流
本 Skill 使用:
npx claudepluginhub z-soulx/ai-toolkit --plugin doc-processing-skillsConverts Markdown documents to professionally typeset PDFs using reportlab (primary) or pandoc+XeLaTeX (fallback). Handles CJK/Latin mixed text, code blocks, tables, Obsidian callouts, math formulas, and 14 color themes. Triggered by "markdown to PDF", "md2pdf", "any2pdf", or export requests.
Converts Markdown files with Mermaid diagrams to styled PDFs using Python script and Puppeteer. Useful for generating PDF documentation, reports, or printable documents with custom styles.
Converts markdown files, globs, or directories to professional PDFs with Obsidian-style preview using pandoc and wkhtmltopdf. Supports custom output directories and auto-installs tools.