Search

PythonReactSEOPDF
OpenClaw

md2pdf

Markdown 转 PDF 技能。将 Markdown 文件转换为精美的 PDF 文档,完美支持中文、代码高亮、自定义样式。

franklu0819-lang0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install franklu0819-lang/markdown-pdf

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Markdown 转 PDF 技能

将 Markdown 文件转换为精美的 PDF 文档,支持中文、代码高亮、自定义样式。

⭐ 推荐方案:WeasyPrint

完美支持中文,无需 LaTeX,自动处理依赖!

快速开始
# 转换 Markdown 为 PDF(推荐)
bash /root/.openclaw/workspace/skills/md2pdf/scripts/convert-weasyprint.sh input.md

# 指定输出文件名
bash /root/.openclaw/workspace/skills/md2pdf/scripts/convert-weasyprint.sh input.md output.pdf
优点
  • ✅ 完美中文支持(使用 Noto Sans CJK 字体)
  • ✅ 自动安装依赖(首次运行时自动安装)
  • ✅ 专业排版样式(代码高亮、表格美化)
  • ✅ 轻量级(无需 LaTeX,仅 Python)
  • ✅ 跨平台(支持 Linux、macOS、Windows)

功能特性

  • ✅ Markdown 转 PDF
  • ✅ 完美中文支持(无乱码)
  • ✅ 代码语法高亮(深色主题)
  • ✅ 专业表格样式(斑马纹、圆角)
  • ✅ 多级标题样式
  • ✅ 引用块美化
  • ✅ 列表、链接、图片支持
  • ✅ 自定义 CSS 样式

使用方法

方法 1:WeasyPrint(推荐)⭐

适合场景: 需要完美中文显示、专业排版

# 使用 Bash 脚本(自动处理依赖)
bash scripts/convert-weasyprint.sh document.md

# 指定输出文件
bash scripts/convert-weasyprint.sh document.md output.pdf

# 直接使用 Python 脚本
python3 scripts/convert-weasyprint.py input.md output.pdf
方法 2:Pandoc(备选)

适合场景: 已安装 LaTeX 环境

bash scripts/convert.sh input.md output.pdf
方法 3:简化 HTML

适合场景: 需要在浏览器中打印

bash scripts/convert-simple.sh input.md output.pdf

脚本说明

convert-weasyprint.sh ⭐

推荐使用 - WeasyPrint 方案,完美支持中文。

特性:

  • 自动检测并安装 Python 依赖(markdown、weasyprint)
  • 自动检测并安装中文字体(google-noto-sans-cjk-fonts)
  • 专业的 CSS 样式(代码高亮、表格美化)
  • 完整的错误处理

用法:

bash scripts/convert-weasyprint.sh <输入.md> [输出.pdf]

参数:

  • 输入.md (必需): Markdown 文件路径
  • 输出.pdf (可选): PDF 输出路径(默认:输入文件名.pdf)

示例:

# 转换单个文件
bash scripts/convert-weasyprint.sh README.md

# 指定输出...

Source information

Source
github
Repository
openclaw/skills
Path
skills/franklu0819-lang/markdown-pdf
Version
—
Commit
aecdfb4cd29fa71c399b7d807dabbde3c2e79e29
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# Markdown 转 PDF 技能

将 Markdown 文件转换为精美的 PDF 文档,支持中文、代码高亮、自定义样式。

## ⭐ 推荐方案:WeasyPrint

**完美支持中文,无需 LaTeX,自动处理依赖!**

### 快速开始

```bash
# 转换 Markdown 为 PDF(推荐)
bash /root/.openclaw/workspace/skills/md2pdf/scripts/convert-weasyprint.sh input.md

# 指定输出文件名
bash /root/.openclaw/workspace/skills/md2pdf/scripts/convert-weasyprint.sh input.md output.pdf
```

### 优点

- ✅ **完美中文支持**(使用 Noto Sans CJK 字体)
- ✅ **自动安装依赖**(首次运行时自动安装)
- ✅ **专业排版样式**(代码高亮、表格美化)
- ✅ **轻量级**(无需 LaTeX,仅 Python)
- ✅ **跨平台**(支持 Linux、macOS、Windows)

## 功能特性

- ✅ Markdown 转 PDF
- ✅ **完美中文支持**(无乱码)
- ✅ 代码语法高亮(深色主题)
- ✅ 专业表格样式(斑马纹、圆角)
- ✅ 多级标题样式
- ✅ 引用块美化
- ✅ 列表、链接、图片支持
- ✅ 自定义 CSS 样式

## 使用方法

### 方法 1:WeasyPrint(推荐)⭐

**适合场景:** 需要完美中文显示、专业排版

```bash
# 使用 Bash 脚本(自动处理依赖)
bash scripts/convert-weasyprint.sh document.md

# 指定输出文件
bash scripts/convert-weasyprint.sh document.md output.pdf

# 直接使用 Python 脚本
python3 scripts/convert-weasyprint.py input.md output.pdf
```

### 方法 2:Pandoc(备选)

**适合场景:** 已安装 LaTeX 环境

```bash
bash scripts/convert.sh input.md output.pdf
```

### 方法 3:简化 HTML

**适合场景:** 需要在浏览器中打印

```bash
bash scripts/convert-simple.sh input.md output.pdf
```

## 脚本说明

### convert-weasyprint.sh ⭐

**推荐使用** - WeasyPrint 方案,完美支持中文。

**特性:**
- 自动检测并安装 Python 依赖(markdown、weasyprint)
- 自动检测并安装中文字体(google-noto-sans-cjk-fonts)
- 专业的 CSS 样式(代码高亮、表格美化)
- 完整的错误处理

**用法:**
```bash
bash scripts/convert-weasyprint.sh <输入.md> [输出.pdf]
```

**参数:**
- `输入.md` (必需): Markdown 文件路径
- `输出.pdf` (可选): PDF 输出路径(默认:输入文件名.pdf)

**示例:**
```bash
# 转换单个文件
bash scripts/convert-weasyprint.sh README.md

# 指定输出...

Related skills

OpenClaw

dojo.md

edholofy

University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning req...

OpenClaw

wps-macos-helper

lethehades

macOS WPS Office workflow helper skill for safer document preparation, conversion, export, and compatibility guidance