원클릭으로
brewdoc-md-to-pdf
Convert Markdown to PDF via reportlab or weasyprint engines. Triggers - pdf, md to pdf, markdown to pdf, generate pdf.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Convert Markdown to PDF via reportlab or weasyprint engines. Triggers - pdf, md to pdf, markdown to pdf, generate pdf.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | brewdoc:md-to-pdf |
| description | Convert Markdown to PDF via reportlab or weasyprint engines. Triggers - pdf, md to pdf, markdown to pdf, generate pdf. |
| argument-hint | <file.md> [--engine name] ["prompt"] | styles | test | (no args = help) |
| user-invocable | true |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion |
| model | sonnet |
Converts Markdown files to professional PDF using one of two rendering engines.
Parse $ARGUMENTS to determine mode and components.
| Component | Required | Description |
|---|---|---|
md_file | per mode | Path to .md file |
--engine | No | reportlab or weasyprint (overrides saved config) |
custom_prompt | No | Last argument in double quotes = LLM preprocessing instructions |
Mode detection rules:
| Condition | Mode |
|---|---|
Empty or help | HELP |
styles or config | STYLES |
test | TEST |
Path to .md file + quoted string at end | CONVERT+PROMPT |
Path to .md file (no quoted string) | CONVERT |
Extract --engine <name> from anywhere in arguments if present. Remove it before further parsing.
Determine the target engine (from --engine flag, saved config, or default reportlab).
EXECUTE using Bash tool:
bash "${CLAUDE_SKILL_DIR}/scripts/check_deps.sh" check ENGINE_NAME 2>&1; echo "EXIT_CODE=$?"
Replace ENGINE_NAME with the target engine.
If output contains MISSING_PIP or MISSING_SYSTEM:
Use AskUserQuestion presenting the engine comparison table:
| Feature | reportlab | weasyprint |
|---|---|---|
| Install | pip only | pip + brew |
| Quality | Good | Excellent |
| Speed | Fast | Moderate |
| Images | Basic | Full |
| CSS Styling | No | Yes |
| Code highlight | No | Yes (Pygments) |
Options:
If user chooses install, EXECUTE using Bash tool:
bash "${CLAUDE_SKILL_DIR}/scripts/check_deps.sh" install ENGINE_NAME 2>&1 && echo "---INSTALL_OK---" || echo "---INSTALL_FAILED---"
STOP if INSTALL_FAILED -- report error and exit.
If user cancels -- STOP.
Check for saved config in order:
.claude/md-to-pdf.config.json~/.claude/md-to-pdf.config.jsonIf --engine flag was provided -- use it (skip config lookup).
If no saved preference and no --engine flag -- use AskUserQuestion with the engine comparison table from Step 1. Save the choice:
{
"engine": "reportlab",
"pygments_theme": "github"
}
Write to project config .claude/md-to-pdf.config.json (create .claude/ dir if needed).
Print formatted usage:
MD to PDF Converter
Usage:
/brewdoc:md-to-pdf <file.md> Convert with saved engine/style
/brewdoc:md-to-pdf <file.md> --engine weasyprint Convert with specific engine
/brewdoc:md-to-pdf <file.md> "remove section X" Preprocess MD then convert
/brewdoc:md-to-pdf styles Configure page/color/font
/brewdoc:md-to-pdf test Convert bundled test file
/brewdoc:md-to-pdf help Show this help
Engines:
reportlab -- Pure Python, fast, no system deps (pip install reportlab)
weasyprint -- HTML/CSS pipeline, best quality (pip + brew deps)
EXIT after printing.
.pdf extension.--config CONFIG_PATH).EXECUTE using Bash tool:
python3 "${CLAUDE_SKILL_DIR}/scripts/md_to_pdf.py" "INPUT_PATH" "OUTPUT_PATH" --engine ENGINE --quiet 2>&1 && echo "---CONVERT_OK---" || echo "---CONVERT_FAILED---"
Replace INPUT_PATH, OUTPUT_PATH, ENGINE with actual values. Add --config CONFIG_PATH if a style config JSON exists. Add --pygments-theme THEME for weasyprint if configured.
STOP if CONVERT_FAILED -- read error output, attempt fix, retry once. If still failing -- report error.
STATUS, OUTPUT, PAGES, SIZE, ENGINE.custom_prompt instructions (delete sections, rewrite headings, restructure, etc.).{original_dir}/.tmp_{original_name}.mdEXECUTE using Bash tool:
rm -f "TEMP_FILE_PATH"
preprocessing: true.Run interactive configuration via AskUserQuestion dialogs:
Question 1 -- Page size:
Options: A4 (default), Letter, Legal
Question 2 -- Color scheme:
Options: Default blue (primary #1a3a5c), Dark (primary #2d3748), Custom (ask for hex values)
Question 3 -- Code theme (weasyprint only):
Options: github (default), monokai, friendly, solarized-dark, solarized-light
Question 4 -- Footer format:
Options: Page {page} of {total} (default), {page}/{total}, Disabled
Build JSON config matching styles/default.json structure, overriding changed values. Write to .claude/md-to-pdf.config.json.
Report saved settings table and EXIT.
${CLAUDE_SKILL_DIR}/test/test-all-elements.md as INPUT_PATH./tmp/md-to-pdf-test-ENGINE.pdf/tmp/ output).| Parameter | Value |
|---|---|
| Source | absolute path to input MD |
| Output | absolute path to output PDF |
| Pages | from PAGES= in script output |
| Size | from SIZE= in script output |
| Engine | reportlab or weasyprint |
| Preprocessing | custom_prompt summary (if used) or none |
SSH server management — connect, configure, deploy, administer Linux servers with safety gates.
Manager mode. on installs+arms a HARD delegation wall into THIS project (PreToolUse denies Write/Edit/Bash in main session, subagents free); off disarms; uninstall removes it. Codeword ++m auto-injects a delegate-everything prompt (plan-aware: adds the plan supplement in plan mode); ++a auto-injects an architecture-first directive (mode-agnostic); ++rr/++r auto-inject review discipline (anti-regression / two-phase double-check), all independent of this skill. level strict|balanced, status, edit, reset. Triggers: manager, менеджер, hard mode, хард режим, delegate.
Installs or removes the think-short terse-mode hooks. Triggers: think-short, be terse, terse mode, инжект терс-режим.
Creates and improves Claude Code subagents. Triggers: create agent, improve agent, scaffold agent, fix agent.
Extracts etalon classes, patterns, architecture into convention docs. Triggers: extract conventions, etalon classes.
Orchestrates e2e testing: BDD scenarios, Playwright autotests. Triggers: e2e tests, BDD scenarios, write autotest.