Last active
August 1, 2020 02:12
-
-
Save mikeslattery/6187a171201075c5be5137aa07c03108 to your computer and use it in GitHub Desktop.
Markdown to Clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Converts markdown format to clipboard in html format. | |
# Requres Wayland, pandoc, and wl-clipboard. | |
# Usage: | |
# rt-clip - Copy from stdin | |
# rt-clip <file> Copy from a file | |
# rt-clip Copy from clipbaord | |
if [[ "$1" == "-" ]]; then shift; cat | |
elif [[ -f "$1" ]]; then shift; cat "$1" | |
else wl-paste | |
fi | pandoc -f markdown -t html | wl-copy -t text/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment