Skip to content
Development
Skill

/md2pdf

Convert a Markdown file to PDF with GitHub-style formatting using the md2pdf tool.

BOOST
From plugin
joshukraine-dotfiles
42924 skills
Install
$ npx -y skills add joshukraine/dotfiles --skill md2pdf --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/md2pdf

Context preview

The summary Claude sees to decide when to auto-load this skill.

Convert a Markdown file to PDF with GitHub-style formatting using the md2pdf tool.

SKILL.md

md2pdf.SKILL.md
name: md2pdf
description: Convert a Markdown file to PDF with GitHub-style formatting using the md2pdf tool.
argument-hint: "[file.md]"

Markdown to PDF

Convert Markdown files to PDF with GitHub-style formatting using the `md2pdf` tool.

Command Options

  • `$ARGUMENTS`: File paths or glob patterns to convert (e.g., `docs/guide.md`, `docs/*.md`)
  • `-o FILE`: Custom output path (only valid with a single input file)

Your task

1. **Determine input files**:

  • If `$ARGUMENTS` are provided, use them as the file paths
  • If no arguments are provided, ask the user which files to convert

2. **Run the conversion**: Execute `md2pdf` with the specified files

3. **Report results**: Confirm which PDFs were generated

Tool Details

The `md2pdf` tool uses pandoc + weasyprint with GitHub-style CSS. The CSS and script live in dotfiles (`~/dotfiles/bin/.local/bin/`). The `MD2PDF_CSS` environment variable can override the default CSS path.

Example Usage

# Convert a single file
/md2pdf docs/guide.md

# Convert multiple files with a glob
/md2pdf docs/qa-handoffs/qa-guide-*.md

# Convert with a custom output name
/md2pdf -o custom-name.pdf docs/guide.md
Ships withjoshukraine-dotfiles

:round_pushpin: My dotfiles for macOS using Neovim, Zsh, and Ghostty + Tmux

Get the whole plugin

Other skills on joshukraine-dotfiles.