Stats
Actions
Tags
From md-to-pdf
Convert a directory of markdown files to PDF with Mermaid diagram rendering
How this command is triggered — by the user, by Claude, or both
Slash command
/md-to-pdf:md-to-pdf <directory-path>This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Markdown to PDF Converter Convert a directory of markdown files into a single PDF document with properly rendered Mermaid diagrams. ## Workflow 1. **Validate input**: Confirm the directory exists and contains markdown files 2. **Ask for output location**: Prompt user where to save the PDF 3. **Check dependencies**: Ensure weasyprint and pandoc are installed (auto-install weasyprint via pipx if missing) 4. **Combine markdown files**: Merge all .md files in alphabetical order, stripping YAML frontmatter 5. **Render Mermaid diagrams**: Download diagrams from mermaid.ink API as PNG images ...
Convert a directory of markdown files into a single PDF document with properly rendered Mermaid diagrams.
Check if the provided path is a directory with markdown files:
ls -la "<directory>" && ls "<directory>"/*.md 2>/dev/null | head -5
If no directory provided or no .md files found, inform the user.
Use AskUserQuestion to ask where to save the PDF:
# Check for pandoc
which pandoc || echo "pandoc not found - please install with: brew install pandoc"
# Check for weasyprint, install if missing
which weasyprint || pipx install weasyprint
Execute the main conversion script:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/md-to-pdf.py" "<source-directory>" "<output-path>"
The script handles:
open "<output-path>"
/md-to-pdf /path/to/documentation
This will:
npx claudepluginhub cajias/claude-skills --plugin md-to-pdf