Lightning Talk
Intermediate

LLM Output to Slack-Friendly Markdown: How I Built the slackify-markdown Python Package

Approved

While working on my side project https://patra.app, I needed to send messages to Slack that were generated by LLMs. These messages used Markdown for formatting. The problem was simple but frustrating: the messages looked broken inside Slack.

LLMs do not generate Slack-compatible formatting. Even with detailed prompts asking them to use mrkdwn, the output is inconsistent and unreliable. Slack requires a custom syntax that looks like Markdown but differs in key ways. For example, it uses *bold* instead of **bold**, and <url|text> instead of [text](url).

To fix this, I built slackify-markdown-python. It is a Python package that converts standard Markdown into valid Slack mrkdwn.

In this talk, I’ll walk through the specific formatting issues caused by LLMs. I’ll explain the differences between Markdown and Slack’s syntax, and show how the package works under the hood to perform reliable conversions. It now runs in production for me, solves a small but common problem, and is open for others to use.

  1. Why Markdown from LLMs doesn't work in Slack: LLMs are great at generating standard Markdown, but Slack uses its own format called mrkdwn, which often breaks how messages appear. Simply asking LLMs to follow mrkdwn rules doesn’t work well, it’s unreliable, hard to get right consistently, and adds unnecessary overhead.

  2. Structured transformations: Learn how breaking text into defined "tokens" enables reliable formatting without relying on regular expressions.

  3. How languages handle ASTs: See examples from Python, JavaScript, C++ to understand how syntax trees are used to model and manipulate structure

  4. How slackify-markdown-python performs the conversion: Explore how the package processes Markdown and outputs Slack-compatible syntax using a simple, rule-based system.

  5. What changed in patra.app after using the package: View before and after examples of LLM-generated messages, and how formatting clarity improved inside Slack.

  6. Why small open-source tools matter: A weekend fix turned into a tool with 700+ downloads. Small, focused tools often prove surprisingly useful.

Introducing a FOSS project or a new version of a popular project
Tutorial about using a FOSS project
Story of a FOSS project - from inception to growth

Manthan Raju Surkar
Lead Founding Engineer Seezo.io
https://surkar.in/
Speaker Image

100 %
Approvability
1
Approvals
0
Rejections
0
Not Sure
Reviewer #1
Approved