https://github.com/magifd2/md-to-slack-go
A Go application that converts Markdown content into Slack Block Kit JSON, providing a structured representation for rich Slack messages.
https://github.com/magifd2/md-to-slack-go
block-kit cli converter go golang markdown slack utility
Last synced: about 1 month ago
JSON representation
A Go application that converts Markdown content into Slack Block Kit JSON, providing a structured representation for rich Slack messages.
- Host: GitHub
- URL: https://github.com/magifd2/md-to-slack-go
- Owner: magifd2
- License: mit
- Created: 2025-08-15T01:10:22.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-19T22:30:06.000Z (10 months ago)
- Last Synced: 2025-10-08T23:39:12.725Z (8 months ago)
- Topics: block-kit, cli, converter, go, golang, markdown, slack, utility
- Language: Go
- Homepage:
- Size: 4.31 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# md-to-slack-go
A CLI tool to convert Markdown to Slack Block Kit JSON.
This is a Go port of [github.com/magifd2/md-to-slack](https://github.com/magifd2/md-to-slack).
## Features
Converts the following Markdown elements to Slack Block Kit blocks:
- Headings (`# H1`, `## H2`) are converted to `header` blocks.
- Other headings (`### H3`, etc.) are converted to `section` blocks with bold text.
- Paragraphs are converted to `section` blocks.
- Blockquotes are converted to `section` blocks with quote formatting.
- Fenced code blocks are converted to `section` blocks with formatted code.
- Thematic breaks (horizontal rules) are converted to `divider` blocks.
- GFM Tables are converted to `table` blocks.
- Inline formatting (bold, italic, strikethrough, code, links) is preserved as `mrkdwn`.
## Installation
Clone the repository from GitHub and build it using `make`.
```bash
git clone https://github.com/magifd2/md-to-slack-go.git
cd md-to-slack-go
make build
```
The binary will be available in the `bin/` directory.
You can also install it to `/usr/local/bin` (default) by running:
```bash
make install
```
Alternatively, you can download a pre-compiled binary for your OS from the [GitHub Releases](https://github.com/magifd2/md-to-slack-go/releases) page.
## Usage
### From a file
```bash
md-to-slack
```
### From standard input
```bash
cat file.md | md-to-slack
```
### Options
```
-version Print version and exit
```
## Development
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.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Acknowledgements
The implementation of the Markdown to Slack Block Kit conversion was greatly inspired by the insights from the following Qiita article.
- [MarkdownをSlackのBlock Kitに変換する](https://qiita.com/yhatt/items/ebe892f341ce03d6d23f)