Releases: dylanwh/mdcopy
mdcopy 1.3
mdcopy 1.2
This isn't much different from 1.0, just a few things I needed for my usecase.
- new option -t/--transient marks pasteboard content as transient (previously this was the default)
- new option -i/--input removes need for "echo ... | " construction, useful in Alfred workflows
- command line help descriptions improved
mdcopy 1.0
This is the first release of mdcopy, a simple command line tool that copies markdown input to the macOS pasteboard as both plain text and HTML. Input can be stdin or a file passed as an argument. The markdown flavor used is the GitHub-flavored fork of cmark, using the lovely Maaku framework.
It supports a few options, --smart-quotes for those that want it, --format text which is useful for my primary use of this: being able to paste hyperlinks generated by shortcuts. With --format text, the text-version of the clipboard will replace named links with their url.
This is best explained with an example:
echo ' [Maaku](https://github.com/KristopherGBaker/Maaku.git)' | mdcopy
# plain text paste would be '[Maaku](https://github.com/KristopherGBaker/Maaku.git)'
echo ' [Maaku](https://github.com/KristopherGBaker/Maaku.git)' | mdcopy
# plain text paste would be 'https://github.com/KristopherGBaker/Maaku.git'Most applications that support rich text support html. Currently tested:
- TextEdit
- Microsoft Office
- Apple Pages
- Google Docs
- Confluence
- Slack
- Tot
- Apple Notes
You can achieve similar results using applescript and something like the builtin textutil command or pandoc, but usually this works by converting markdown to HTML and then HTML to RTF. This is because of a mistaken assumption that "rich text" == "RTF", but this is not the case (as shown above).