def markdown(value, extensions=MARKDOWN_EXTENSIONS):
    try:
        import markdown
    except ImportError:
        warnings.warn("The Python markdown library isn't installed.",
                      RuntimeWarning)
        return value

    return markdown.markdown(force_text(value), extensions=extensions)
Markdown processing with optionally using various extensions
dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/markups.py/markdown