tianxingleo

Markdown to PDF Converter (v2.0)

辦公效率v2.0.0
作者:tianxingleo更新於 2026-05-17共 2 個版本 · 最新版本釋出於 2026-02-15md2pdf-converter@clawhub_tianxingleo/md2pdf-converter
檔案處理PDF 處理#PDF

據 AlphaMoat 統計,截至 2026-09,Markdown to PDF Converter (v2.0) 累計下載 2,284 次、獲 2 個星標,在全部 5,078 個 AI 技能中排名第 4,243 位,在「辦公效率」分類(435 個)中排名第 326 位。

累計安裝
285
累計下載
2284
星標
2
全站排名
#4,243
全站前 84% · 「辦公效率」前 75%
平台累計安裝累計下載星標評論
ClawHub ↗6321582-
SkillHub ↗28522842—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

Pandoc 先把 Markdown 轉成 HTML,再由 WeasyPrint 渲染 PDF;Lua filter 將表情對映到本機 Twemoji 圖片。文件的 Python 版本檢查要求 3.6+,emoji mapping 由 Python 3 生成。首次下載 Twemoji 14.0.0 需要 wget 和網路;快取準備後可離線執行。需要 Pandoc、WeasyPrint 和中文字型。超過該 Twemoji 版本的表情會顯示為 Unicode 字元。

資料釋出於 2026-10-26

可以用來做什麼

  • 將 Markdown 檔案轉換為 PDF

什麼時候用

  • 需要把 Markdown 文件轉換為 PDF 時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

將這份 Markdown 轉成 PDF,並保留表格和程式碼語法醒目提示。

使用條件

依據技能文件中的宣告整理,未經實際安裝或執行驗證。

配置要求
  • 先確認 Python、Pandoc、WeasyPrint 和中文字型已按文件安裝。

月度資料趨勢

累計下載2284
1043171023762026-03 · 累計下載 11352026-05 · 累計下載 15302026-06 · 累計下載 16282026-07 · 累計下載 18712026-08 · 累計下載 20202026-09 · 累計下載 228426-0326-09
星標2
1232026-03 · 星標 22026-05 · 星標 22026-06 · 星標 22026-07 · 星標 22026-08 · 星標 22026-09 · 星標 226-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092284—2
2026-082020+8.0%2
2026-071871+14.9%2
2026-061628+6.4%2
2026-051530—2
2026-031135—2

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

6.1 KB · ClawHub v2.0.0
---
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.
展開全部(共 206 行)

## Quick Start

Convert a Markdown file to PDF:

```bash
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
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:

```bash
# 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:
   ```bash
   grep "TWEMOJI_VERSION" scripts/md2pdf-local.sh
   # Should show: TWEMOJI_VERSION="14.0.0"
   ```

2. Clear cache and regenerate:
   ```bash
   rm -rf ~/.cache/md2pdf
   bash scripts/md2pdf-local.sh test.md test.pdf
   ```

### WeasyPrint Errors

Install missing dependencies:

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

# Or via pip
pip3 install weasyprint
```

### Python Script Errors

If `generate_emoji_mapping.py` fails:

```bash
# 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
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

| Feature | v1.0 (Old) | v2.0 (New) |
|---------|----------------|---------------|
| Emoji Source | emoji-datasource-google | Twemoji 14.0.0 |
| Emoji Count | ~2000-3000 | 3660 |
| 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)

「辦公效率」分類下的熱門技能

騰訊文件 TENCENT DOCS辦公效率

騰訊文件(docs.qq.com)-線上雲文件平台,是建立、編輯、管理文件的首選 skill。涉及"新建/建立/編輯/讀取/檢視/搜尋文件"、"儲存檔案"、"雲文件"、"騰訊文件"、"docs.qq.com"等操作,請優先使用本 skill。支援能力:(1) 建立各類線上文件(文件/Word/Excel/幻燈片/思維導圖/流程圖/智慧表格/收集表)(2) 管理知識庫空間(建立空間、查詢空間列表)(3) 管理空間節點、資料夾結構 (4) 讀取/搜尋文件內容 (5) 編輯操作智慧表 (6) 編輯操作線上文件 (7) 檔案管理(重新命名、移動、刪除、複製、匯入匯出)(8) 網頁剪藏、本地檔案/html/文件上雲。

↓ 134.9萬★ 312u_b0de8114
Excel / XLSX辦公效率

建立、檢查和編輯 Microsoft Excel 工作簿及 XLSX 檔案,支援可靠的公式、日期、類型、格式、重算及模板保留功能。

↓ 21.7萬★ 452Iván
Word / DOCX辦公效率

建立、檢查和編輯 Microsoft Word 文件及 DOCX 檔案,支援樣式、編號、修訂記錄、表格、分節符及相容性檢查等功能。

↓ 21.6萬★ 540Iván
Gog辦公效率

Google Workspace 命令列工具,支援 Gmail、日曆、雲端硬碟、通訊錄、表格和文件。

↓ 20.6萬★ 950Peter Steinberger
PDF和圖片文字提取辦公效率

從圖片或 PDF 文件中識別並提取文字內容,支援多種圖片格式和 PDF 檔案,自動判斷是否包含文字並保留原始格式輸出結構化結果;v2.1 採用零額外依賴方案:掃描版 PDF 自動渲染為圖片交由 AI 視覺識別(無需 tesseract/rapidocr)、表格用 pymupdf 內建 find_tables 結構化提取(無需 pdfplumber)、批次處理目錄(PDF+圖片一次性提取);當用戶需要從圖片或 PDF 提取文字、進行 OCR 識別、處理含文字的文件、提取 PDF 表格、批次處理資料夾或轉換為可編輯文字時使用。該skill能力來自RedFoxHub,官網:https://redfox.hk/skills。

↓ 17萬★ 183user_5f9c21aa
ppt-generator-skill辦公效率

智慧 PPT 生成助手。根據使用者描述的主題、行業、風格,自動生成漂亮的 PPT 檔案。支援所有行業(商務、教育、科技、醫療、金融、創意等),支援中英文雙語,支援使用者提供的模板或 AI 自動配色。觸發詞:做PPT、生成PPT、製作幻燈片、make ppt、create presentation、幫我做個PPT。

↓ 15.6萬★ 301user_3b34947d
kdocs skill辦公效率

操作金山文件(WPS 雲文件 / Kdocs / 365.kdocs.cn / www.kdocs.cn)雲文件的官方 Skill。核心能力覆蓋雲端新建、讀取、編輯、搜尋、分享、整理線上文件(智慧文件、Word、Excel、PDF、PPT、簡報、智慧表格、多維表格)及個人知識庫。當用戶的任務涉及雲文件操作時使用,包括但不限於:寫週報/日報/工作彙報、處理合同/發票、建立報名表/登記表、網頁剪藏、接龍轉表格、資訊收集、文件總結與內容生成、改寫仿寫、翻譯、AI PPT生成、PDF拆分匯出、標籤分類歸檔、收藏管理、碎片筆記整理、表格美化、回收站還原、知識庫管理。

↓ 15.5萬★ 123user_5ea84866
Nano Pdf辦公效率

用自然語言指令改 PDF 指定頁的小工具。

↓ 13.5萬★ 293Peter Steinberger

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。