Your AI writes Markdown. Your boss wants a Word doc. One click — cleaned, branded, done.
A Visual Studio Code extension that turns Markdown into clean, professional documents — PDF, Word (.docx), or HTML — with a visual customization studio, reusable document profiles, an AI tone-polish engine, and a rule-based cleanup system that strips AI clutter. No Pandoc. No CSS. No setup.
Table of Contents
- About
- Why This Extension
- Features
- AI Tone Polish
- Installation
- Usage
- Commands
- Settings
- How It Works
- Document Profiles
- Build From Source
- Contributing
- Roadmap
- Star History
- License
- Acknowledgments
📖 About
Markdown is great for developers and AI tools, but raw .md files — full of #, *,
backticks, emoji, and chatty AI phrases like "Certainly! Here's your document…" — are not
something you can hand to HR, a client, or any non-technical reader.
Markdown to PDF & Word solves this entirely inside VS Code. It cleans the Markdown, applies a professional layout (cover page, branding, headers/footers, table of contents), optionally polishes the tone with your preferred AI provider, and exports a polished PDF, Word, or HTML document you can send to anyone — all in one click, with nothing else to install (no Pandoc, no external tools).
It is designed for developers who dislike reading raw Markdown and who frequently need to share AI- or hand-written Markdown as a real, presentable document.
🎯 Why This Extension
Most existing tools do one piece of this. None combine them:
| Capability | Typical MD→PDF tools | Pandoc tools | This extension |
|---|---|---|---|
| Clean AI clutter (intros/outros, emoji) | ❌ | ❌ | ✅ |
| Word (.docx) export without Pandoc | ❌ | ❌ (needs Pandoc) | ✅ |
| Visual customization (no CSS editing) | ❌ | ❌ | ✅ |
| Reusable, shareable document profiles | ❌ | ❌ | ✅ |
| Cover page + branding builder | ⚠️ Partial | ⚠️ Partial | ✅ |
| AI tone polish (optional, BYO key) | ❌ | ❌ | ✅ |
| Gather a whole folder into one document | ❌ | ❌ | ✅ |
| 100% offline (except AI polish) | ❌ (bundled Chromium) | ✅ | ✅ |
✨ Features
🧹 Cleanup Engine (Offline, No AI)
Rule-based removal of AI conversational filler — "Certainly! Here's…", "Let me know if…" — emoji, inconsistent heading spacing, smart quotes/dashes, and excessive blank lines. 100% offline and deterministic. Toggle each rule on/off in the studio.
🎨 Customization Studio
A visual panel — no CSS required — to set a cover page, brand colors, fonts, header/footer, page numbers, and layout. Includes a page-accurate live preview (real A4/Letter/Legal sheet, portrait/landscape, margins, header/footer bands), zoom controls (in/out/fit-to-width), a draggable splitter, and a fullscreen mode.
📁 Document Profiles
Save your look as a reusable profile in .markready/profiles/*.json and commit it so your
whole team exports the same way. Ships with presets: HR Formal, Client Proposal,
Internal Report, Minimal — plus in-studio New / Duplicate / Delete / Reset / Import / Export.
🤖 AI Tone Polish
Optionally polish your markdown through OpenAI, Claude, Gemini, or OpenRouter before export. See the AI section for details.
📄 Rich Markdown Rendering
- Syntax highlighting for fenced code blocks (selectable theme)
- Task lists, footnotes, tables, blockquotes, horizontal rules
- KaTeX math (
$...$/$$...$$), opt-in per profile - YAML front matter —
title/author/datefeed the cover and{{placeholder}}tokens - Table of Contents with depth control and optional heading numbering
- Optional watermark on every page
📂 Folder Gather + Reorder
Gather every .md file in a folder, include/exclude and reorder them, then combine into one document.
📦 Three Export Formats
- PDF — via your installed Chrome/Edge/Chromium (auto-detected)
- Word (.docx) — no Pandoc, no external tools
- HTML — standalone, self-contained
All exports embed relative images automatically.
🧼 Clean UI
Built with official VS Code Codicons — no emoji anywhere in the product UI.
🤖 AI Tone Polish
Bring your own API key. No subscription, no lock-in, no usage tracking.
The AI tone polish feature lets you run your markdown through a large language model before export — cleaning up phrasing, removing awkward sentences, and making the language professional, clear, and confident — all while preserving structure, code blocks, and data.
How It Works
Original Markdown → [Your chosen LLM] → Diff Review → Apply / Discard
↑
Your API Key (never stored in files)
- Enable AI polish in the studio and select a provider
- Configure your API key (stored securely in VS Code's secret storage)
- Click Polish Now — the diff is shown inline
- Review changes: Apply to accept or Discard to reject
- During export with AI enabled, polish is applied seamlessly
Supported Providers
| Provider | API Format | Default Model | Authentication |
|---|---|---|---|
| OpenAI | Chat Completions | gpt-4o-mini |
Authorization: Bearer <key> |
| Claude (Anthropic) | Messages API | claude-3-5-haiku-latest |
x-api-key: <key> |
| Google Gemini | Generate Content | gemini-1.5-flash |
Query parameter ?key=<key> |
| OpenRouter | OpenAI-compatible | openai/gpt-4o-mini |
Authorization: Bearer <key> |
Configuration
| Setting | Type | Default | Description |
|---|---|---|---|
markready.ai.defaultProvider |
enum | "openai" |
Default AI provider |
markready.ai.defaultModel |
string | "" |
Default model (empty = provider default) |
markready.ai.defaultTemperature |
number (0-1) | 0.3 |
AI response creativity |
Commands
| Command | Description |
|---|---|
Markdown to PDF & Word: Configure AI API Key |
Set a provider's API key |
Markdown to PDF & Word: Test AI API Key |
Validate a stored key |
Markdown to PDF & Word: Clear All AI API Keys |
Delete all stored keys |
Security
- API keys are stored in VS Code's secret storage — never in profiles, settings, logs, or files
- Each key is stored under a provider-specific secret identifier
- Supports distinct keys per provider (OpenAI, Claude, Gemini, OpenRouter)
- Keys can be tested, individually reconfigured, or bulk-cleared
Default System Prompt
The polish is guided by a carefully crafted system prompt that instructs the AI to:
- Preserve all headings, code blocks, lists, tables, and formatting exactly as-is
- Make language professional, clear, and confident
- Remove casual or conversational phrasing
- Never add, remove, or alter data, numbers, names, or specifications
- Output only the polished markdown — no greeting, sign-off, or explanation
You can edit the prompt freely in the studio and reset to default at any time.
📥 Installation
From VS Code Marketplace (recommended)
- Open Visual Studio Code
- Go to the Extensions view (
Ctrl+Shift+X) - Search for Markdown to PDF & Word
- Click Install
Or install from the command line:
code --install-extension AnandSundaramoorthySa.markdown-to-pdf-word
From a .vsix file
Download the .vsix from the Releases page, then:
code --install-extension markdown-to-pdf-word-1.3.1.vsix
PDF requirement: PDF export renders through an installed Google Chrome, Microsoft Edge, or Chromium (auto-detected on Windows/macOS/Linux). Most machines already have one. If yours doesn't, install Chrome/Edge or point
markready.chromePathat a browser executable (or set theCHROME_PATHenvironment variable). Word (.docx) and HTML export need no browser at all.
🚀 Usage
- Open any Markdown (
.md) file - Press
Ctrl+Shift+Pand run Markdown to PDF & Word: Open Customization Studio - Adjust the cover page, colors, fonts, layout, and AI options — watch the live preview update
- Click Export PDF, Export Word, or Export HTML
You can also right-click a .md file (or a folder) in the Explorer for quick actions.
⌨️ Commands
Open the Command Palette (Ctrl+Shift+P):
| Command | Description |
|---|---|
Markdown to PDF & Word: Open Customization Studio |
Visual editor + live preview + export buttons |
Markdown to PDF & Word: Export as PDF |
Clean + render the active file to PDF |
Markdown to PDF & Word: Export as Word (DOCX) |
Clean + render the active file to Word (no Pandoc) |
Markdown to PDF & Word: Export as HTML |
Clean + render the active file to HTML |
Markdown to PDF & Word: Clean Markdown |
Open a cleaned copy of the active file |
Markdown to PDF & Word: Gather Folder into One Document |
Combine all .md in a folder into one document |
Markdown to PDF & Word: Configure AI API Key |
Set a provider's API key |
Markdown to PDF & Word: Test AI API Key |
Validate a stored key |
Markdown to PDF & Word: Clear All AI API Keys |
Delete all stored keys |
⚙️ Settings
| Setting | Default | Description |
|---|---|---|
markready.defaultProfile |
HR Formal |
Profile used by the quick export commands |
markready.chromePath |
"" |
Optional path to a Chrome/Edge/Chromium executable for PDF export |
markready.cleanup.removeChatter |
true |
Remove AI intros/outros |
markready.cleanup.removeEmoji |
true |
Strip emoji from headings and text |
markready.cleanup.normalizeHeadings |
true |
Normalize heading spacing |
markready.cleanup.normalizeWhitespace |
true |
Collapse excessive blank lines |
markready.cleanup.normalizePunctuation |
true |
Convert smart quotes/dashes to ASCII |
markready.ai.defaultProvider |
"openai" |
Default AI provider (openai, claude, gemini, openrouter) |
markready.ai.defaultModel |
"" |
Default AI model (empty = provider default) |
markready.ai.defaultTemperature |
0.3 |
AI response creativity (0.0 – 1.0) |
🔧 How It Works
.md → front matter + cleanup (rules, no AI) → markdown-it (+highlight/math/GFM)
→ AI polish (optional, BYO key) → HTML + cover + TOC + CSS
→ PDF (Chrome/Edge) | DOCX (no Pandoc) | HTML
↑
Document Profile (JSON)
The Customization Studio edits the Profile JSON and renders the preview through the same pipeline used for export, so what you see is what you get.
📁 Document Profiles
A profile is a small JSON file describing the cover page, branding, header/footer, layout, options, and AI polish configuration. Saving a profile writes it to:
<your-project>/.markready/profiles/<profile-name>.json
Commit this file to your repository and everyone on the team exports documents with the same look. Built-in presets are available out of the box and can be cloned and customized.
🔨 Build From Source
# 1. Clone
git clone https://github.com/anandsundaramoorthysa/markdown-to-pdf-word.git
cd markdown-to-pdf-word
# 2. Install dependencies (no browser download — PDF uses your installed Chrome/Edge)
npm install
# 3. Compile
npm run compile
# 4. Run the unit tests
npm test
# 5. Launch the Extension Development Host
# Press F5 in VS Code
To package a .vsix:
npm install -g @vscode/vsce
vsce package
See CONTRIBUTING.md for detailed development setup and contribution guidelines.
👥 Contributing
Contributions are welcome — bug fixes, new presets, features, or docs.
- Discuss first: for anything non-trivial, open an issue before coding
- Understand the codebase: the pipeline is
cleanup.ts → render.ts → ai/ → exporters/*, with the UI inpanel.ts(studio) andgatherPanel.ts(folder gather) - Keep the cleanup safe: the cleanup engine must never delete real content — add tests when adding rules
- Match the style: TypeScript, no emoji in code or UI (use Codicons)
See CONTRIBUTING.md for the full contribution workflow, code style guide, and development setup.
🗺 Roadmap
- Code-block theme options
- Page watermark
- Math (KaTeX) and richer markdown (task lists, footnotes, front matter)
- AI tone-polish (optional, bring-your-own-key)
- Mermaid diagrams (kept off for now to preserve the fully-offline, small-bundle promise)
- Logo positioning in header/footer
- Publish to Open VSX (for Cursor / VSCodium / Windsurf)
- More built-in profile presets
See PLAN.md for the full design and roadmap.
⭐ Star History
📄 License
This project is released under the MIT License. You are free to use, modify, and distribute it under the terms of this license. See the LICENSE file for the full text.
🙏 Acknowledgments
Built with these excellent open-source projects:
- markdown-it — Markdown parsing and rendering
- puppeteer-core — HTML to PDF via your installed browser
- html-to-docx — HTML to Word, no Pandoc
- highlight.js — code syntax highlighting
- KaTeX — fast math typesetting
- diff — text diff engine for AI polish review
- gray-matter — YAML front-matter parsing
- VS Code Codicons — the icon set used in the UI
GitHub · Marketplace · Issues · Discussions