Skip to content
/ md2cb Public

simple markdown to formatted text in clipboard

License

Notifications You must be signed in to change notification settings

oderwat/md2cb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

md2cb - Markdown to Clipboard with Rich Text support

A simple command line tool that converts markdown to rich text and copies it to the clipboard. Perfect for converting markdown tables to rich text that can be pasted into applications that support formatted text.

BEWARE

This is MAC OS only!

Requirements

  • macOS (uses native Cocoa framework for clipboard operations)
  • Go 1.17 or later
  • pandoc (brew install pandoc)

Installation

go install github.com/oderwat/md2cb@latest

Or download the latest release from the releases page.

Usage

The program reads markdown from stdin and places the converted rich text on the clipboard:

echo "| Header | Content |
|-|-|
| Cell 1 | Cell 2 |" | md2cb

Or read from a file:

cat your_table.md | md2cb

How it Works

  1. Uses pandoc to convert markdown to HTML
  2. Converts the HTML to rich text using macOS's native NSAttributedString
  3. Places the result on the clipboard in both HTML and rich text formats
  4. Ready to paste into any application that supports formatted text

License

MIT License - see LICENSE.txt file

About

simple markdown to formatted text in clipboard

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages