Markdown to PDF Advanced

v1.1.1

Convert Markdown files to PDF with multiple backend options (WeasyPrint, Pandoc, wkhtmltopdf). Supports syntax highlighting, tables, images, custom CSS theme...

0· 178·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for 20181112523/md-to-pdf-advanced.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Markdown to PDF Advanced" (20181112523/md-to-pdf-advanced) from ClawHub.
Skill page: https://clawhub.ai/20181112523/md-to-pdf-advanced
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install md-to-pdf-advanced

ClawHub CLI

Package manager switcher

npx clawhub@latest install md-to-pdf-advanced
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description match the files and code: a Python-based Markdown→PDF converter with optional pandoc/wkhtmltopdf support. Required binaries (python3, optional pandoc/wkhtmltopdf) and provided CSS assets are appropriate for this purpose.
Instruction Scope
SKILL.md instructs the agent to run the included script (exec('python3 .../md_to_pdf.py')) which is expected. The script reads only the input Markdown and optional CSS, writes the output PDF, and may invoke subprocesses (pandoc/wkhtmltopdf or pip). One small inconsistency: the skill metadata says "No network required for local file conversion," but the script can attempt to auto-install WeasyPrint via pip at runtime (and support for remote images implies optional network access).
Install Mechanism
Install spec uses standard package managers (pip, apt, brew) and only installs well-known packages (weasyprint, markdown, Pygments, pandoc, wkhtmltopdf). No downloads from untrusted URLs. Runtime pip install (install_weasyprint) occurs inside the script if WeasyPrint is missing — this is normal but requires network and executes package installation.
Credentials
The skill requests no environment variables or credentials and does not access config paths. It only reads user-supplied input and optional local CSS files, which is proportionate to its function.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges, always:false, and does not modify other skills or system-wide settings. It runs as an ordinary utility invoked by the agent.
Assessment
This skill appears to do what it says: run the included Python script to convert Markdown to PDF. Before installing/use: (1) be aware the script may attempt to install Python packages via pip at runtime (network access and package installation), so pre-install dependencies if you require offline or locked environments; (2) the script invokes subprocesses (pandoc/wkhtmltopdf) if present — review and install those from your trusted package sources if needed; (3) it does not request any secrets, but run it in a controlled environment if you want to limit package installs or subprocess execution. If you want to avoid any runtime network activity, pre-install WeasyPrint/Pygments/markdown and/or ensure pandoc/wkhtmltopdf are available on the system.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

Binspython3
Any binpandoc, wkhtmltopdf

Install

Install pandoc and wkhtmltopdf (brew)brew install pandoc
latestvk97699m2rpg2pramnrm653spd183sanv
178downloads
0stars
3versions
Updated 1mo ago
v1.1.1
MIT-0

Markdown to PDF Converter

Convert Markdown files to PDF with professional formatting. Supports multiple backends for different use cases.

Backends

Primary: WeasyPrint (Pure Python)

  • Pros: No system dependencies, pip install only, good CSS support
  • Cons: Slightly slower on large documents
  • Use for: Most use cases, especially when you can't install system packages

Optional: Pandoc + wkhtmltopdf

  • Pros: Most powerful, LaTeX support, best typography
  • Cons: Requires system package installation
  • Use for: Academic papers, complex documents, LaTeX math

Quick Start

# Using WeasyPrint (recommended, auto-installed)
python3 scripts/md_to_pdf.py input.md output.pdf

# Using Pandoc (if installed)
python3 scripts/md_to_pdf.py input.md output.pdf --backend pandoc

Usage from Agent

Basic Conversion

# Convert markdown to PDF
exec("python3 skills/md-to-pdf-advanced/scripts/md_to_pdf.py /path/to/input.md /path/to/output.pdf")

With Custom CSS

# Apply custom theme
exec("python3 skills/md-to-pdf-advanced/scripts/md_to_pdf.py input.md output.pdf --css skills/md-to-pdf-advanced/assets/github-theme.css")

With Options

# Landscape, custom margins
exec("python3 skills/md-to-pdf-advanced/scripts/md_to_pdf.py input.md output.pdf --orientation landscape --margin 15mm")

Features

  • ✅ Syntax-highlighted code blocks
  • ✅ Tables with styling
  • ✅ Images (local and remote)
  • ✅ Headers and footers with page numbers
  • ✅ Custom CSS themes
  • ✅ Page size and orientation options
  • ✅ Adjustable margins

CSS Themes

Available in assets/:

  • github-theme.css - GitHub-like styling
  • minimal-theme.css - Clean minimal look
  • academic-theme.css - Academic paper style

Troubleshooting

WeasyPrint fails to install

# Install system dependencies first (Ubuntu/Debian)
sudo apt-get install python3-dev libffi-dev libxml2-dev libxslt1-dev

# Then install Python packages
pip3 install weasyprint markdown Pygments

Images not showing

Use absolute paths or ensure images are relative to the markdown file location.

Fonts look wrong

WeasyPrint uses system fonts. Install the fonts you reference in CSS:

# Ubuntu/Debian
sudo apt-get install fonts-liberation fonts-dejavu

# macOS
brew install --cask font-liberation

Emoji display as □ (boxes) or not rendered

PDF 中 emoji(如 ✅、🔄、📋)显示为方框是因为系统缺少彩色 Emoji 字体支持。

解决方案:

# 1. 安装 Google Noto Color Emoji 字体(支持全量 Unicode Emoji)
# Fedora/RHEL/CentOS
dnf install -y google-noto-emoji-color-fonts

# Ubuntu/Debian
sudo apt-get install fonts-noto-color-emoji

# 2. 刷新字体缓存让系统识别新字体
fc-cache -fv

# 3. 重新转换 PDF
python3 skills/md-to-pdf-advanced/scripts/md_to_pdf.py input.md output.pdf

替代方案(如果不想安装字体):

将 Markdown 中的 emoji 替换为文字描述或 ASCII 符号:

Emoji文字替代ASCII 替代
[OK](完成)[x]
[FAIL](失败)[ ]
🔄[更新](刷新)~>
📋[列表](任务)[#]
⚠️[警告](注意)!
💡[提示](建议)i
🔧[修复](工具)`
🐛[BUG](缺陷)*

Comments

Loading comments...