Skip to content

letientai299/md2cb

Repository files navigation

md2cb - Markdown to clipboard converter.

Converts GitHub Flavored Markdown (GFM) to rich HTML and copies it to the system clipboard for pasting into Word, Google Docs, Pages, Teams, etc.

Usage

cat file.md | md2cb

Then, paste the copied clipboard content to the target app.

Add --edit/-e flag to edit the content in $EDITOR before converting. -e would open an empty markdown file if run without any input (file or stdin).

Installation

Linux/macOS:

curl -fsSL https://raw.githubusercontent.com/letientai299/md2cb/main/scripts/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/letientai299/md2cb/main/scripts/install.ps1 | iex

Installs to /usr/local/bin (Unix) or %USERPROFILE%\bin (Windows) by default. Use -d <path> to specify a custom directory.

Demo

Rendered from test/demo.md.

Microsoft Teams Google Docs Froala Editor for reference
Teams demo Google Docs demo Froala demo

Development

See mise tasks for list of common tasks. Use mise dev to start the 2 web servers:

Requirements

Notes

Most of the code was written by Claude Code, with some code review from Copilot!

At work I need to use Teams. It supports a few makdown features, but the editing experience for long message isn't smooth. So, I often write in NVim and use the below shell script to convert them before paste to Teams.

pandoc --from gfm --to html |
    textutil -convert rtf -stdin -stdout -format html |
    pbcopy -Prefer

The script work well for typical bullet list, but:

  • Doesn't support image, mermaid.
  • Mac only.

Hence, I build this.

About

Convert Markdown to rich HTML clipboard content

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •