Markdown2pdf

# ๐Ÿ“„ Markdown2PDF Skill

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Markdown2pdf" with this command: npx skills add leohuang8688/markdown2pdf

๐Ÿ“„ Markdown2PDF Skill

A professional OpenClaw skill for converting Markdown documents to PDF and PNG with colored emoji support.


๐Ÿ“‹ Overview

PropertyValue
Namemarkdown2pdf
Version1.0.0
AuthorPocketAI for Leo
LicenseMIT
CategoryDocument Conversion
RepositoryGitHub

โœจ Features

  • ๐Ÿ“„ Markdown to PDF - Professional PDF document generation
  • ๐Ÿ–ผ๏ธ Markdown to PNG - High-quality PNG image generation
  • ๐ŸŽจ 5 Professional Themes - default, dark, github, minimal, professional
  • ๐ŸŒˆ Colored Emoji Support - Automatic emoji to colored text label conversion
  • โœจ Custom CSS - Complete style control
  • ๐Ÿš€ CLI & API - Multiple usage methods
  • ๐Ÿงฉ OpenClaw Integration - Seamless integration

๐Ÿš€ Quick Start

Installation

cd ~/.openclaw/workspace/skills/markdown2pdf
pip3 install markdown pdfkit imgkit
brew install wkhtmltopdf  # macOS
# or
sudo apt-get install wkhtmltopdf  # Ubuntu

Basic Usage

# Convert to PDF
python3 src/converter.py input.md -f pdf

# Use theme
python3 src/converter.py README.md -t github -f pdf

# List themes
python3 src/converter.py --list-themes

๐ŸŽจ Available Themes

ThemeDescriptionBest For
defaultModern clean designGeneral documents
darkDark themePresentations, night reading
githubGitHub-styleTechnical docs, README
minimalMinimalist designElegant documents
professionalBusiness styleReports, business docs

๐ŸŒˆ Colored Emoji Support

Automatically converts emoji to colored text labels for PDF compatibility:

EmojiConvertedColorMeaning
๐Ÿ“Š[ๆ•ฐๆฎ]๐Ÿ”ต BlueData
๐Ÿ“ˆ[่ถ‹ๅŠฟโ†‘]๐ŸŸข GreenGrowth
๐Ÿ“‰[่ถ‹ๅŠฟโ†“]๐Ÿ”ด RedDecline
โœ…[โˆš]๐ŸŸข GreenSuccess
โŒ[ร—]๐Ÿ”ด RedError
โš ๏ธ[!]๐ŸŸ  OrangeWarning
๐Ÿš€[ๅฏๅŠจ]๐Ÿ”ด RedLaunch
โญโ˜…๐ŸŸก GoldStar

๐Ÿ“– API Usage

Python API

from src.converter import convert_markdown_to_pdf, MarkdownConverter

# Simple conversion
pdf_path = convert_markdown_to_pdf(
    markdown_text="# Hello World",
    output_filename="hello.pdf",
    theme="github"
)

# Advanced usage
converter = MarkdownConverter(
    output_dir=Path("./output"),
    theme="professional",
    custom_css=".custom { color: red; }"
)

pdf_path = converter.convert_to_pdf(
    markdown_text="# Document",
    output_filename="doc.pdf",
    page_size="A4",
    margin="15mm"
)

โš™๏ธ Configuration

Default Settings

SettingValueDescription
default_themeprofessionalDefault theme for conversion
default_formats["pdf"]Default output formats
default_width1200Default PNG width in pixels
default_page_sizeA4Default PDF page size
default_margin20mmDefault PDF margin
emoji_supporttrueEnable emoji replacement
colored_emojitrueUse colored text labels

๐Ÿ“ฆ Dependencies

PackageVersionPurpose
markdown>=3.5.0Markdown processing
pdfkit>=1.0.0PDF generation
imgkit>=1.2.3Image generation
wkhtmltopdf>=0.2.0HTML to PDF engine

๐Ÿ“ Project Structure

markdown2pdf/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ converter.py          # Main converter
โ”‚   โ””โ”€โ”€ emoji_replacer.py     # Emoji conversion utility
โ”œโ”€โ”€ output/                    # Output files
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_converter.py     # Test suite
โ”œโ”€โ”€ README.md                  # Documentation
โ”œโ”€โ”€ SKILL.md                   # This file
โ””โ”€โ”€ requirements.txt           # Dependencies

๐Ÿงช Testing

# Run tests
pytest tests/

# Test conversion
python3 src/converter.py test_document.md -t github -f pdf

๐Ÿ“ Changelog

v1.0.0 (2026-03-16)

Initial Stable Release

  • โœจ Markdown to PDF/PNG converter
  • ๐ŸŽจ 5 professional themes
  • ๐ŸŒˆ Colored emoji support
  • ๐Ÿ”ง CLI and API interfaces
  • ๐Ÿ“š Complete documentation
  • ๐Ÿงฉ OpenClaw integration

๐ŸŽฏ Use Cases

1. Investment Analysis Reports

python3 src/converter.py stock_analysis.md -t professional -f pdf

2. Technical Documentation

python3 src/converter.py README.md -t github -f pdf,png

3. Presentations

python3 src/converter.py presentation.md -t dark -f png --width 1920

4. Business Reports

python3 src/converter.py business_report.md -t professional -f pdf

๐Ÿ“ž Support


๐Ÿ“„ License

MIT License - See LICENSE file for details.


Happy Converting! ๐Ÿ“„๐ŸŽจ


Last Updated: 2026-03-17
Version: 1.0.0
Author: PocketAI for Leo

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

scellrun

Opinionated, report-first single-cell + multi-omics analysis CLI. Use when the user asks anything that involves an .h5ad / 10x mtx / cellranger output. Defau...

Registry SourceRecently Updated
Coding

Salesforce Fast integrations

Complete Salesforce CRM integration for real-time data access, lead management, opportunity tracking, duplicate detection, and bulk operations. One-click OAu...

Registry SourceRecently Updated
Coding

swift-expert

Expert Swift developer specializing in Swift 5.9+ with async/await, SwiftUI, and protocol-oriented programming. Masters Apple platforms development, server-s...

Registry SourceRecently Updated
Coding

pcloud-components-usage

Use when developer needs to install, use, or look up components from @pointcloud/pcloud-components npm package

Registry SourceRecently Updated