markdown-to-pdf

Convert Markdown documents to PDF with tables, code blocks, and images.

7|1|Updated May 9, 2026
One-click install
npx skills add https://github.com/black-yt/skills --skill markdown-to-pdf-black-yt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: markdown-to-pdf
Source: https://github.com/black-yt/skills/tree/main/markdown-to-pdf
Command: npx skills add https://github.com/black-yt/skills --skill markdown-to-pdf-black-yt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires markdown2, weasyprint, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you convert Markdown documents into PDF files without manually rebuilding layout, preserving common formatting such as tables, code blocks, images, and simple styling.

Core Features & Use Cases

  • Markdown to PDF conversion: Render Markdown through HTML and export it as a PDF for sharing or archiving.
  • Resource-aware output: Resolve relative image and asset paths using a configurable base directory.
  • Practical documentation workflows: Useful for turning notes, reports, drafts, or README-style content into printable PDFs.

Quick Start

Ask the assistant to convert the Markdown file you provide into a PDF and use the document folder as the base path if it contains relative images.

Frequently Asked Questions about markdown-to-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to PDF while preserving tables and code blocks?

You can convert Markdown to PDF by rendering it through HTML, which preserves tables, fenced code blocks, images, and basic CSS styling for your documentation and reports.

What is the best way to generate a PDF from Markdown notes with relative images?

Generating a PDF from Markdown notes with relative images requires setting a base URL directory, which allows the HTML rendering engine to resolve relative asset paths and embed them correctly in the output.

Do I need WeasyPrint and markdown2 to convert Markdown documents into PDF files?

Yes, converting Markdown documents into PDF files requires both markdown2 for initial HTML rendering and WeasyPrint to generate the final PDF output, ensuring consistent formatting and resource resolution.

Can I use this Markdown to PDF conversion for archiving README documentation?

Yes, you can use this Markdown to PDF conversion for archiving README documentation, as it applies practical workflows to turn notes, drafts, and reports into printable and shareable PDF files.

Why does my Markdown to PDF conversion fail to load relative images?

Markdown to PDF conversion fails to load relative images when the base URL or base directory is not configured properly, preventing the HTML rendering engine from resolving and embedding the required assets.