@fmontes/md2clip
v1.0.1
Published
Pipe markdown, get HTML in your clipboard with proper HTML MIME type
Readme
md2clip
Pipe markdown into your terminal, get HTML in your clipboard with proper text/html MIME type.
Apps like Notion, Slack, Mail, and Google Docs will paste it as rich text.
Install
npm install -g @fmontes/md2clipUsage
echo "**bold** and _italic_" | md2clip
cat README.md | md2clip
pbpaste | md2clip # convert clipboard markdown to HTMLOutput is also printed to stdout, so you can pipe further:
cat doc.md | md2clip | lessPlatform support
| Platform | Method | MIME type |
|----------|--------|-----------|
| macOS | Swift + NSPasteboard | public.html |
| Linux | xclip / xsel / wl-copy | text/html |
| Windows | PowerShell + System.Windows.Forms | HTML format |
macOS requirement
Requires Xcode Command Line Tools for proper HTML MIME type:
xcode-select --installWithout it, falls back to pbcopy (plain text only).
Linux requirement
Install one of: xclip, xsel, or wl-copy.
# Ubuntu/Debian
sudo apt install xclipLicense
MIT
