Skip to content

Instantly share code, notes, and snippets.

@jdkato
Last active February 17, 2019 23:45
Show Gist options
  • Select an option

  • Save jdkato/ec92ea4b05286edbc704dc5604b7ed81 to your computer and use it in GitHub Desktop.

Select an option

Save jdkato/ec92ea4b05286edbc704dc5604b7ed81 to your computer and use it in GitHub Desktop.
import mistune
def main(meta, content, level):
"""A Bootstrap-style alert.
"""
# We want to be able to write our body content in Markdown,
# so we use the `mistune` library to convert it to HTML.
html = mistune.markdown(content)
return '<div class="alert alert-{0}" role="alert">{1}</div>'.format(level, html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment