Convert Markdown to Slack Block Kit JSON.
Reads Markdown from stdin and writes a {"blocks": [...]} JSON payload to stdout,
designed to pair with scli for posting to Slack from the terminal.
- GFM (GitHub Flavored Markdown) support
- H1/H2 → Slack header blocks (large font)
- H3–H6 → bold section blocks
- Paragraphs, blockquotes, ordered and unordered lists (nested)
- Fenced and indented code blocks
- GFM tables → aligned plain-text code blocks
- Standalone images → Slack image blocks
- Inline images → link fallback
- Strikethrough, bold, italic, inline code, links, autolinks
- Thematic breaks → Slack divider blocks
- Raw HTML discarded (not renderable in Slack)
go install github.com/nlink-jp/md-to-slack/cmd/md-to-slack@latestOr download a pre-built binary from the Releases page.
md-to-slack < README.md
echo "# Hello **world**" | md-to-slackmd-to-slack < message.md | scli post --channel general --blocks -| Flag | Description |
|---|---|
--version, -V |
Print version and exit |
--help, -h |
Print usage and exit |
make build # build for current platform
make build-all # cross-compile for all platforms
make test # run tests
make check # vet + lint + test + buildmd-to-slack writes a Slack Block Kit payload:
{
"blocks": [
{ "type": "header", "text": { "type": "plain_text", "text": "Title", "emoji": true } },
{ "type": "section", "text": { "type": "mrkdwn", "text": "Body text." } }
]
}