← ClaudeAtlas

md2pdf-typoralisted

Convert Markdown to PDF using Typora's Whitey theme via pandoc + Chrome headless, replicating Typora's PDF export appearance
Axect/skills · ★ 2 · Data & Documents · score 78
Install: claude install-skill Axect/skills
# Markdown to PDF (Typora-style) Convert a Markdown file to PDF that closely matches Typora's PDF export with the **Whitey** theme. Uses pandoc for MD→HTML conversion and Chrome headless for HTML→PDF rendering. ## Usage ``` /md2pdf-typora <input.md> [options] ``` ### Arguments - `<input.md>` — Path to the input Markdown file (required) - `--output <path>` — Output PDF path (default: same directory as input, `.pdf` extension) - `--dropbox [subfolder]` — Copy PDF to `~/Dropbox/Magi/[subfolder]/` - `--send-telegram` — Send compiled PDF via Telegram after compilation - `--toc` — Include table of contents ## Pipeline ### Step 1: Pre-process Markdown Before pandoc conversion, handle Typora-specific syntax and pandoc parser quirks that the input may not anticipate: - **`[TOC]` handling**: Typora uses `[TOC]` as an inline TOC marker, but pandoc ignores it and leaves it as literal text. Always strip `[TOC]` from the input and use pandoc's `--toc` flag instead. - **HR-then-heading normalization** (load-bearing): If a horizontal rule line `---` is *immediately* followed by a `## ` heading with no blank line between them, pandoc's reader can interpret the pair as a setext-style table fragment, swallowing the heading and several paragraphs into a single `<table><td>` cell. Symptoms: missing TOC entries for that section, AND the section's body content (especially pipe tables) renders as a single inline run-on paragraph in the PDF. This pattern is common in chunked-translation work