Markdown template filter for Django following CommonMark specs.
-
Install the package:
poetry add django-markdownit
or using pip:
pip install django-markdownit
-
Add
markdownit
to yourINSTALLED_APPS
:INSTALLED_APPS = [ # ... 'markdownit', ]
-
Load the template tag library in your template:
{% load markdownit %}
-
Use the
markdownit
filter on a string:{{ my_string|markdownit }}
- Inspired by django-markdownify.
- Using markdown-it-py for Markdown rendering.
- Using nh3/ammonia for HTML sanitization.