360 Secure SkillHub
360 安全技能中心

md2pdf (Pandoc + Typst)

该 Skill 通过 Bash 脚本调用 Pandoc 和 Typst,把指定的 Markdown 文件转换为带标题、表格、代码块、链接和 Emoji 等 GitHub 风格格式的 PDF,结果保存在源文件同目录。使用前需自行安装 Pandoc 与 Typst。

hansschinkenwurst78-dev
hansschinkenwurst78-dev
热度 60.55
最近更新 2026-05-11 17:38:19
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-md2pdf
Metadata
name
md2pdf
description
Convert Markdown files to beautifully formatted PDFs using Pandoc and Typst. Supports headings, tables, code blocks, links, emojis, and GitHub-style formatting. Output lands next to the source file.

md2pdf

Converts Markdown to PDF with professional formatting.

Requirements

  • Pandoc (v3.2+): brew install pandoc
  • Typst (v0.12+): brew install typst

Usage

bash ~/.openclaw/workspace/skills/md2pdf/scripts/md2pdf.sh "/path/to/file.md"

The PDF is saved in the same directory as the source MD file.

Features

  • GitHub-style headings with horizontal rules
  • Tables, bullet lists, numbered lists
  • Code blocks with syntax highlighting (monospace, grey background)
  • Inline code formatting
  • Clickable links (blue, underlined)
  • Emoji support
  • German language optimized (hyphenation)
  • Clean typography (Helvetica Neue / Arial)

Examples

# Single file
bash ~/.openclaw/workspace/skills/md2pdf/scripts/md2pdf.sh report.md
# → creates report.pdf in same folder

# From any agent workspace
bash ~/.openclaw/workspace/skills/md2pdf/scripts/md2pdf.sh /full/path/to/notes.md

TOOLS.md Entry

Add this to your agent's TOOLS.md:

## PDF erstellen (md2pdf)
- Markdown zu PDF: `bash ~/.openclaw/workspace/skills/md2pdf/scripts/md2pdf.sh "/pfad/zur/datei.md"`
- Das PDF wird im gleichen Ordner wie das MD abgelegt.