A CLI tool to convert Markdown to Slack Block Kit JSON. This is a Go port of github.com/magifd2/md-to-slack.
Converts the following Markdown elements to Slack Block Kit blocks:
- Headings (
# H1,## H2) are converted toheaderblocks. - Other headings (
### H3, etc.) are converted tosectionblocks with bold text. - Paragraphs are converted to
sectionblocks. - Blockquotes are converted to
sectionblocks with quote formatting. - Fenced code blocks are converted to
sectionblocks with formatted code. - Thematic breaks (horizontal rules) are converted to
dividerblocks. - GFM Tables are converted to
tableblocks. - Inline formatting (bold, italic, strikethrough, code, links) is preserved as
mrkdwn.
Clone the repository from GitHub and build it using make.
git clone https://github.com/magifd2/md-to-slack-go.git
cd md-to-slack-go
make buildThe binary will be available in the bin/ directory.
You can also install it to /usr/local/bin (default) by running:
make installAlternatively, you can download a pre-compiled binary for your OS from the GitHub Releases page.
md-to-slack <path/to/your/file.md>cat file.md | md-to-slack-version Print version and exit
This project uses make for common development tasks.
make build: Build the binary for your current OS and architecture.make test: Run tests.make lint: Run the linter.make cross-compile: Build for all target platforms (macOS, Linux, Windows).make clean: Clean up build artifacts.
This project is licensed under the MIT License. See the LICENSE file for details.
The implementation of the Markdown to Slack Block Kit conversion was greatly inspired by the insights from the following Qiita article.