Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commonmark-slack-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

commonmark_slack-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for commonmark-slack-1.0.0.tar.gz
Algorithm Hash digest
SHA256 da21444432d8cef79dbe5166776700640c704f52b8f758cfe83cc6e38278e52e
MD5 cae293456d2e9ba34267d386e3295f3c
BLAKE2b-256 5b758aeea7d231c8e1cc7be2eeedcdf8dd5f940354220744d6db5729b6ae426a

See more details on using hashes here.

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

Hashes for commonmark_slack-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2623f274ba5a859d96e32686e4e6fa73b851341d6fcb17b44605a2be7f8f76
MD5 bc1007c5917ce719549dbe697f03d15d
BLAKE2b-256 44fe562b3da39894d0e66333d9d97ee8eb5c54d140b9e9ae63a694dea734bd9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page