digital-stoic-org

convert-md-to-pdf

0
0
# Install this skill:
npx skills add digital-stoic-org/agent-skills --skill "convert-md-to-pdf"

Install specific skill from multi-skill repository

# Description

Convert Markdown files with Mermaid diagrams to styled PDF. Use when user wants to export/convert markdown to PDF, generate PDF documentation, or create printable documents.

# SKILL.md


name: convert-md-to-pdf
description: Convert Markdown files with Mermaid diagrams to styled PDF. Use when user wants to export/convert markdown to PDF, generate PDF documentation, or create printable documents.
tools: Bash, Read, Write
model: sonnet


Convert Markdown to PDF

Convert markdown files to professionally styled PDFs with Mermaid diagram support.

Usage

python <skill_dir>/scripts/converter.py <input.md> [output.pdf] [--style=STYLE]

Note: The converter.py script automatically handles TMPDIR overrides to avoid /tmp/claude permission issues.

Available Styles

Check <skill_dir>/styles/ for options:
- default - Clean sans-serif, professional
- modern - Bold headers, accent colors
- minimal - Serif font, whitespace
- report - Formal corporate style

First Run

Install dependencies via install-dependency skill:

  1. Python packages: Use install-dependency to install from <skill_dir>/requirements.txt
  2. Mermaid CLI: Use install-dependency for @mermaid-js/mermaid-cli

Note: The install-dependency skill automatically sets up local TMPDIR to avoid permission conflicts.

Linux setup (Ubuntu 23.10+ or AppArmor systems):

Create puppeteer-config.json in your project root:

{
  "args": ["--no-sandbox", "--disable-setuid-sandbox"]
}

This allows Puppeteer (used by Mermaid) to launch Chrome for diagram rendering.

Adding Styles

Create .css file in <skill_dir>/styles/ directory.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.