360 Secure SkillHub
360 安全技能中心

Markdown to PDF

该 Skill 通过 python3 脚本先把 Markdown 转为 HTML,再调用 wkhtmltopdf 生成 PDF。支持自定义 CSS、代码语法高亮和内嵌样式,适用于文档、笔记和报告的导出分享。需预先安装 markdown、pygments 与 wkhtmltopdf。

分类:效率
alone86136
alone86136
热度 36.86
最近更新 2026-05-11 17:35:43

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add alone86136/markdown-to-pdf
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
markdown-to-pdf
description
Convert Markdown files to beautiful PDF documents. Supports custom styling, code highlighting, and multiple output options. Use when users need to convert MD to PDF for documentation, notes, reports, or sharing.

markdown-to-pdf

Overview

Convert Markdown text or files to professional-looking PDF documents. Uses markdown package to convert MD to HTML, then wkhtmltopdf to generate PDF. Supports code syntax highlighting and custom CSS styling.

Features

  • Convert MD file to PDF: Take a Markdown file and output a ready-to-share PDF
  • Standalone output: Embeds all styles, no external dependencies
  • Code highlighting: Automatic syntax highlighting for code blocks
  • Custom CSS: Option to provide custom CSS for styling

Dependencies

pip install markdown pygments
# You also need wkhtmltopdf installed:
# macOS: brew install wkhtmltopdf
# Ubuntu/Debian: sudo apt install wkhtmltopdf

Usage

Basic conversion

python3 scripts/convert.py input.md output.pdf

With custom CSS

python3 scripts/convert.py --css custom.css input.md output.pdf

Resources

scripts/

  • convert.py - Convert Markdown file to PDF