Convert CommonMark Markdown to Slack Markdown
Project description
CommonMark-Slack
CommonMark-Slack extends the commonmark.py library to add rendering of the Slack flavor of Markdown. This can be handy if you are already using standard Markdown for another purpose and would like to also produce Slack output from the same source. CommonMark-slack also allows for producing plaintext from standard Markdown, useful for the areas of Slack that use unadorned text.
Installation
You can install CommonMark-Slack from PyPI:
pip install commonmark-slack
The commonmark-slack package is supported by Python 3.6 and above.
Usage
import commonmarkslack
parser = commonmarkslack.Parser()
ast = parser.parse("Hello *World*")
renderer = commonmark.SlackRenderer()
slack_md = renderer.render(ast)
print(slack_md) # Hello _World_
renderer = commonmarkslack.PlainTextRenderer()
plain_text = renderer.render(ast)
print(plain_text) # Hello World
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file commonmark-slack-1.0.0.tar.gz
.
File metadata
- Download URL: commonmark-slack-1.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da21444432d8cef79dbe5166776700640c704f52b8f758cfe83cc6e38278e52e |
|
MD5 | cae293456d2e9ba34267d386e3295f3c |
|
BLAKE2b-256 | 5b758aeea7d231c8e1cc7be2eeedcdf8dd5f940354220744d6db5729b6ae426a |
File details
Details for the file commonmark_slack-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: commonmark_slack-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e2623f274ba5a859d96e32686e4e6fa73b851341d6fcb17b44605a2be7f8f76 |
|
MD5 | bc1007c5917ce719549dbe697f03d15d |
|
BLAKE2b-256 | 44fe562b3da39894d0e66333d9d97ee8eb5c54d140b9e9ae63a694dea734bd9c |