Skip to content

fmontes/md2clip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/md2clip

Usage

echo "**bold** and _italic_" | md2clip
cat README.md | md2clip
pbpaste | md2clip   # convert clipboard markdown to HTML

Output is also printed to stdout, so you can pipe further:

cat doc.md | md2clip | less

Platform 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 --install

Without it, falls back to pbcopy (plain text only).

Linux requirement

Install one of: xclip, xsel, or wl-copy.

# Ubuntu/Debian
sudo apt install xclip

License

MIT

About

Pipe markdown, get HTML in your clipboard with proper HTML MIME type

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors