📄
简介
基于 pandoc 与 wkhtmltopdf 的命令行工具,将 Markdown 转换为样式化 PDF,支持多种预设主题与自定义 CSS。
原始描述
Convert Markdown files to styled PDFs using pandoc and wkhtmltopdf with built-in or custom CSS style options.
通过你的 Agent 添加
点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。
或者手动安装
Claude Codeunzip -o skill.zip -d ~/.claude/skills/markdown-to-pdf-styled/
其它 Agent解压到它自己的 skills 目录,目录名用 markdown-to-pdf-styled
包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。
技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。
技能正文
md-to-pdf
version: 1.0.0
author: 大总管
description: Convert Markdown (.md) files to styled PDF documents with pandoc + wkhtmltopdf
Use this skill to convert Markdown to PDF with consistent styles.
Quick Start
- Ensure dependencies exist:
pandoc --version
wkhtmltopdf --version
- Run conversion:
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md
Style Options
Use built-in styles:
clean(default): simple business stylemodern: blue, presentation-friendlypaper: serif, reading-friendly
Examples:
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md --style clean
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md /abs/path/out.pdf --style modern
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md --style paper
Custom CSS
Pass an absolute CSS path:
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md /abs/path/doc.pdf --style /abs/path/custom.css
Notes
- Script enables local CSS loading via
--enable-local-file-access. - If output title warning appears, set Markdown metadata
title:. - For detailed usage and troubleshooting, read
{baseDir}/references/usage.md.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。