md2mail
Overview
Convert a markdown file to Gmail-compatible rich text and copy to the Windows clipboard. Strips YAML frontmatter, converts GFM elements (tables, code blocks, headings, lists, blockquotes), injects inline styles that survive Gmail's CSS sanitizer, and places both CF_HTML and plain-text fallback on the clipboard.
Usage
python main.py md2mail [OPTIONS]
Options
| Option | Description | Default |
|---|---|---|
-i, --input | Markdown file to convert | stdin |
--preview | Open rendered HTML in browser before copying | false |
--stdout | Output HTML to stdout instead of clipboard | false |
Prerequisites
- Repo: content-conductor
- Install:
pip install -r requirements.txtfrom repo root - Platform: Windows (uses Win32 clipboard API for CF_HTML)
Examples
Convert and copy to clipboard
python main.py md2mail -i draft.md
Preview in browser before copying
python main.py md2mail -i draft.md --preview
Output to stdout for debugging
python main.py md2mail -i draft.md --stdout
Related Commands
cc validate-- validate markdown documents before sending