Token导航 LogoToken导航TokenDH.com
效率需要联网clawhub未标认证来源可访问clear审计提醒

md2pdf-converterMD2PDF 转换器

Agent Skill

md2pdf-converter 用于整理文档、README、Markdown 和说明材料,适合在 OpenClaw 中需要把零散信息整理成结构清晰的文档时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

30,962

周安装

1,330

GitHub Stars

2

下载量

10,853
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:md2pdf-converter(MD2PDF 转换器)
来源仓库:https://github.com/tianxingleo/md2pdf-converter
安装命令:
openclaw skills install md2pdf-converter
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install md2pdf-converter

简介

离线 Markdown 转 PDF 工具,集成 Pandoc 与 WeasyPrint,支持 Unicode 全字符集。

  • 适合 OpenClaw 中在无网络环境下生成专业级 PDF 文档。
  • 内置表情符号缓存,确保特殊符号正确显示。
  • 需确保宿主安装 pandoc 及 weasyprint 命令行工具。
  • 建议测试复杂排版案例,验证样式兼容性后再投入生产使用。

SKILL.md

name
md2pdf-converter
description
Offline Markdown to PDF converter with FULL Unicode support using Pandoc + WeasyPrint + local Twemoji cache (3660 colorful emojis). Converts Markdown documents to professional PDFs with Chinese fonts and colorful emojis (complete version with all variants). Use when user needs to convert Markdown reports or documents to PDF, generate PDFs with emoji support, create PDFs with proper Chinese character rendering, or work offline after initial setup.

Markdown to PDF Converter (Complete Version)

Overview

Convert Markdown documents to professional PDFs with FULL Unicode support, Chinese fonts, and colorful emojis (3660 emojis including all variants). Uses Pandoc + WeasyPrint with a local Twemoji cache to work offline after first run.

Quick Start

Convert a Markdown file to PDF:

bash scripts/md2pdf-local.sh input.md output.pdf

First run only: Downloads ~150MB emoji resources (Twemoji 14.0.0) from GitHub. Subsequent runs work offline.

Example:

bash scripts/md2pdf-local.sh report.md report.pdf

Features

  • Full Unicode support (Chinese, Japanese, Korean)
  • Complete emoji support (Twemoji 14.0.0, 3660 colorful PNGs)
  • All emoji variants (skin tones, hair styles, regional flags, etc.)
  • Offline operation after initial setup
  • Professional PDF layout with page numbers
  • Code highlighting, tables, blockquotes
  • Accurate emoji mapping via Python pre-generated lookup table

Technical Details

Dependencies

  • Pandoc - Universal document converter
  • WeasyPrint - CSS-to-PDF renderer
  • Python 3 - For emoji mapping generation
  • wget - For emoji download (first run only)

How It Works

  1. First run: Downloads Twemoji 14.0.0 to ~/.cache/md2pdf/emojis/
  2. Python script: Generates emoji → filename mapping table (emoji_mapping.json)
  3. Pandoc: Converts Markdown to HTML with a Lua filter that replaces emoji characters with local image references
  4. WeasyPrint: Renders HTML to PDF using:

- AR PL UMing CN for Chinese characters - Local emoji images (PNG, 72x72px, colorful) - Professional CSS styling

Emoji Cache Location

~/.cache/md2pdf/
├── emojis/                    # 3660 colorful PNG files
│   ├── 0023-fe0f-20e3.png
│   ├── 1f600.png
│   └── ...
└── emoji_mapping.json         # Emoji to filename mapping
    {
      "🙀": "1f600.png",
      "⌛": "0023-fe0f-20e3.png",
      ...
    }

Emoji Mapping

The Python script generate_emoji_mapping.py scans all Twemoji files and creates a precise mapping from emoji characters to PNG filenames. This ensures accurate emoji replacement even for complex variants like skin tones and regional indicators.

Fonts

Primary Chinese font: AR PL UMing CN

Fallback: Noto Sans SC, Noto Sans CJK SC, Microsoft YaHei

Monospace: Menlo, Monaco

Version History

v2.0 (Current)

  • ✅ Switched to Twemoji 14.0.0 (complete version)
  • 3660 colorful emojis (including all variants)
  • Python pre-generated mapping for accurate emoji replacement
  • ✅ Fixed black-and-white emoji display issue
  • ✅ Proper support for emoji variants (skin tones, hair styles, etc.)

v1.0 (Previous)

  • Used emoji-datasource-google (~2000-3000 emojis)
  • Simple hex-based filename matching (inaccurate for variants)
  • Some emojis displayed as Unicode characters (black-and-white)

Troubleshooting

Font Issues

If Chinese characters display incorrectly, ensure AR PL UMing CN is installed:

# Ubuntu/Debian
sudo apt-get install fonts-arphic-uming

# Check if installed
fc-list | grep "AR PL UMing"

Emoji Not Showing

  1. Check if emoji cache exists: ls ~/.cache/md2pdf/emojis/
  2. Check if mapping exists: ls ~/.cache/md2pdf/emoji_mapping.json
  3. If missing, delete cache and re-run: rm -rf ~/.cache/md2pdf
  4. Verify emoji file exists: ls ~/.cache/md2pdf/emojis/1f600.png

Emoji Displaying as Black-and-White

This issue has been FIXED in v2.0. If you still see black-and-white emojis:

  1. Verify you're using the v2.0 script:
   grep "TWEMOJI_VERSION" scripts/md2pdf-local.sh
   # Should show: TWEMOJI_VERSION="14.0.0"
  1. Clear cache and regenerate:
   rm -rf ~/.cache/md2pdf
   bash scripts/md2pdf-local.sh test.md test.pdf

WeasyPrint Errors

Install missing dependencies:

# Ubuntu/Debian
sudo apt-get install python3-weasyprint

# Or via pip
pip3 install weasyprint

Python Script Errors

If generate_emoji_mapping.py fails:

# Check Python version
python3 --version
# Should be Python 3.6+

# Check emoji cache
ls ~/.cache/md2pdf/emojis

Resources

scripts/

md2pdf-local.sh - Main conversion script with automatic emoji caching and mapping

generate_emoji_mapping.py - Python script to generate emoji lookup table

Usage: Direct execution from any location (uses absolute paths):

bash /path/to/skills/md2pdf-converter/scripts/md2pdf-local.sh input.md output.pdf

Key Features:

  • Automatic Twemoji download and caching
  • Python pre-generated emoji mapping (accurate)
  • Lua filter for emoji replacement
  • CSS styling for professional output
  • Temporary file cleanup (automatic)

Comparison: v1.0 vs v2.0

Featurev1.0 (Old)v2.0 (New)
Emoji Sourceemoji-datasource-googleTwemoji 14.0.0
Emoji Count~2000-30003660
Color Display❌ Unstable✅ Stable
Variants Support❌ Incomplete✅ Complete
Mapping Accuracy⚠️ Low✅ High
Offline Support✅ After first run✅ After first run
First Run Size~68MB~150MB

Performance

  • First run: ~150MB download, 10-30 seconds (depending on network)
  • Subsequent runs: Offline, seconds-level conversion
  • Memory usage: ~150MB for emoji cache
  • PDF generation: 1-5 seconds per page

Limitations

  • Missing emojis (newer than Twemoji 14.0.0) will display as Unicode characters
  • First run requires internet connection (for Twemoji download)
  • Emoji cache size: ~150MB (3660 PNG files at 72x72px)

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

85.15%
按下载量换算9,241

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills