360 Secure SkillHub
360 安全技能中心

md-2-pdf

该 Skill 通过 scripts/md-to-pdf.py 将 Markdown 文件转换为 PDF,支持标题、粗斜体、列表、代码块、表格、链接、任务列表、水平线和跳过 YAML frontmatter,并可用 -o 指定输出、-v 显示详情。依赖 Python/reportlab,通过 uv 运行。

araa47
araa47
热度 74.86
最近更新 2026-05-17 11:18:13
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add md-2-pdf
Metadata
name
md-to-pdf
description
Convert markdown files to clean, formatted PDFs using reportlab
metadata
{"openclaw":{"emoji":"📄","requires":{"bins":["uv"]}}}

Markdown to PDF

Convert markdown documents to professional, clean PDFs with proper formatting.

Usage

# Basic usage
uv run scripts/md-to-pdf.py input.md

# Specify output
uv run scripts/md-to-pdf.py input.md -o output.pdf
uv run scripts/md-to-pdf.py input.md --output my-report.pdf

# Verbose mode
uv run scripts/md-to-pdf.py input.md -v

Features

  • Headers: H1-H6 with hierarchical styling
  • Text formatting: Bold, italic, inline code
  • Lists: Bullet lists, numbered lists, task lists
  • Code blocks: Syntax highlighting with background
  • Tables: Full table support with headers
  • Links: Clickable hyperlinks
  • Horizontal rules: Visual section dividers
  • YAML frontmatter: Automatically skipped
  • Special characters: Emojis, Unicode symbols
  • Page numbers: Automatic footer with page numbers
  • Professional styling: Clean, readable output

Options

  • -o, --output: Output PDF file path (default: input_filename.pdf)
  • -v, --verbose: Print detailed processing information

Supported Markdown Elements

Element Syntax Status
Headers # H1 to ###### H6 ✅
Bold **text** or __text__ ✅
Italic *text* or _text_ ✅
Inline code `code` ✅
Code blocks ``` ✅
Bullet lists - item or * item ✅
Numbered lists 1. item ✅
Task lists - [x] done ✅
Tables ` col
Links [text](url) ✅
Horizontal rules --- or *** ✅
Blockquotes > quote ✅