A lightweight, efficient Python library (current version 0.3.2) for converting standard Markdown to Slack's custom mrkdwn format. It helps maintain consistent formatting when sending messages to Slack from applications. The library features comprehensive support for various Markdown elements and includes a plugin system for extended functionality. It has a moderate release cadence, with several minor releases and bug fixes in the past year.
pip install markdown-to-mrkdwnVerified import paths — ran on the pinned version, not inferred.
Initialize the converter and pass your Markdown string to the `convert` method. The library will return the equivalent Slack mrkdwn string.
Upgrade Python to version 3.8 or higher, or pin to an older `markdown-to-mrkdwn` version (e.g., `<0.3.0`) if Python upgrade is not feasible.
Familiarize yourself with Slack's `mrkdwn` specifications (api.slack.com/reference/block-kit/composition-objects#mrkdwn_element) to understand potential differences and test the converted output thoroughly.
Refer to the library's documentation on plugin development. When creating custom plugins, write comprehensive unit tests to ensure they handle various Markdown inputs correctly and don't interfere with built-in conversions.
Install the library using pip: `pip install markdown_to_mrkdwn`
Use underscores in the import statement: `from markdown_to_mrkdwn import SlackMarkdownConverter`
Ensure the `SlackMarkdownConverter` class is explicitly imported: `from markdown_to_mrkdwn import SlackMarkdownConverter`
Verify the method name is correctly spelled as 'convert' and ensure you are calling it on an instantiated object: `converter = SlackMarkdownConverter() mrkdwn_text = converter.convert(markdown_text)`
No dependency data recorded yet.