Slack Markdown List

  

Knives out rating canada

  1. Slack Markdown Nested List
  2. Slack Markdown Listening
  3. Slack Markdown Listing
markdown-to-slack.py
# Translates Markdown syntax to Slack, replaces:
#
# - hyphened lists with bullet symbols
# - double bold marker asterisks `**` with single asterisk `*`
# - headers `#` with bold marker asterisks `*`
#
# Run with
#
# python markdown-to-slack.py filename.md
#
# Result will be in filename.md.slack.
# Assumes that lists are indented with two spaces and underscore '_'
# is used for italic, which is already compatible with Slack.
importre
importsys
REGEX_REPLACE= (
(re.compile('^- ', flags=re.M), '• '),
(re.compile('^ - ', flags=re.M), ' ◦ '),
(re.compile('^ - ', flags=re.M), ' ⬩ '), # ◆
(re.compile('^ - ', flags=re.M), ' ◽ '),
(re.compile('^#+ (.+)$', flags=re.M), r'*1*'),
(re.compile('**'), '*'),
)
defmain(i, o):
s=i.read()
forregex, replacementinREGEX_REPLACE:
s=regex.sub(replacement, s)
o.write(s)
if__name__'__main__':
withopen(sys.argv[1], encoding='utf-8') asi,
open(sys.argv[1] +'.slack', 'w', encoding='utf-8') aso:
main(i, o)

Escaping the dot, like by writing 2., avoids that Markdown recognizes 2. As an item of a (new or existing) numbered list. Hence, writing 2. Cat would avoid the new list with 1. This article describes a curated list of open sourceand low-cost wiki and knowledge management software. Gebus people - while flavors vary, Markdown in general is meant to be 100% compatible with HTML. It'll look for certain markers in text (double astrix, uderscores, and the like) and convert it to HTML. BUT.dramatic gasp. you can ALSO just write HTML! Given the implementation of Slack, their 'rich text' is just HTML.

Slack markdown listings

Slack Markdown Nested List

Slack Markdown List

Slack Markdown Listening

Slack

Slack Markdown Listing

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment