mcpField
M
markdown-to-pdf

markdown-to-pdf

github.com/staskhDocuments39440 installsUpdated 1d ago
Repository

About markdown-to-pdf

A Python skill that converts Markdown files into formatted PDFs. It uses mistune and reportlab and supports common document elements including tables and code blocks.

Key features

  1. 01Convert Markdown files to PDF
  2. 02Render headings and text styling
  3. 03Support pipe-syntax tables
  4. 04Render fenced code and lists
  5. 05Choose a custom output path

Use cases

  1. 01Create a PDF from a Markdown report
  2. 02Export Markdown with tables or code blocks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/staskh/trading_skills --skill markdown-to-pdf

After installing, type/markdown-to-pdfin Claude Code to confirm it loaded.

Bundled filesscripts/markdown_to_pdf.py

Details

From the project README

Markdown to PDF Converter

Converts a markdown file to a professionally formatted PDF. Pure Python — no system tools required.

Dependencies

Requires two Python packages (already in pyproject.toml):

mistune>=3.2
reportlab>=4.0

Install with: uv sync (or pip install mistune reportlab)

Instructions

uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py <input.md> [output.pdf]
  • input.md — path to the markdown file (required)
  • output.pdf — output path (optional; defaults to same directory and basename as input)

Output

The script returns JSON with:

  • success — true or false
  • input — resolved absolute path of the input file
  • output — resolved absolute path of the generated PDF
  • error — error message if success is false
  • generated_at — NY timezone timestamp
  • data_delay — always "real-time"

After conversion, tell the user the output PDF path.

Examples

# Convert sandbox/report.md → sandbox/report.pdf (default output)
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py sandbox/report.md

# Explicit output path
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py sandbox/report.md sandbox/AAPL_Report_2026-05-20_1430.pdf

Supported Markdown

  • Headings (H1–H3)
  • Paragraphs, bold, italic
  • Tables (pipe syntax)
  • Fenced code blocks
  • Unordered and ordered lists

Comments

Markdown supported