Skip to main content

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

OptionDescriptionDefault
-i, --inputMarkdown file to convertstdin
--previewOpen rendered HTML in browser before copyingfalse
--stdoutOutput HTML to stdout instead of clipboardfalse

Prerequisites

  • Repo: content-conductor
  • Install: pip install -r requirements.txt from 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
  • cc validate -- validate markdown documents before sending