Convert markdown into Slack's bastardized markdown
⚠️ Warning: This is my first Rust project and it's an awful, hacky thing (but functional, atleast).
CTRL-V
Copy the markdown you want converted to your clipboard. Then...
- Mac OSX ->
pbpaste | slackify-markdown | pbcopy
... and paste it into Slack!
If you don't pipe anything to slackify-markdown
, it will read everything you type into the terminal
until you hit CTRL
+ D
, and then it will convert.
Easiest way to install on macOS is by using Homebrew.
$ brew tap thundergolfer/homebrew-formulae
$ brew install slackify-markdown
You can get binaries for OSX and Linux on this project's releases page.
After downloading, you unzip the .tar.gz
and move the binary to a place that's on your path ($PATH
on Linux/OSX).
main.rs
contains the basics of reading inputs and calling the conversion function, and also contains unit tests.slackdown.rs
implements the Markdown -> 'Slackdown' conversion logic. It is a copy-and-hack of thepulldown-cmark
crate'shtml.rs
module.escape.rs
is a direct lift frompulldown-cmark
and...lib.rs
is the crate's default library file, and (in my understanding) allows for modules withinsrc
to refer to each other throughuse crate::<BLAH>
TravisCI is used to release Linux and OSX binaries each time a tagged commit is pushed to master
.
This project uses the MIT license, preserving the original copyright of code used from pulldown-cmark
.