Django-Jinja (Jinja2) extension and filter for parse markdown text markup.
Project description
Django-Jinja (Jinja2) extension and filter to parse markdown text in templates.
Requirements
Django 1.8 or 1.9
Installation
Install django-jinja-markdown:
pip install django-jinja-markdown
Add django_jinja_markdown to INSTALLED_APPS.
To be able to use the {% markdown %} tag you should add the Jinja extension to your django_jinja TEMPLATES extensions list:
TEMPLATES = [
{
'BACKEND': 'django_jinja.backend.Jinja2',
'OPTIONS': {
'extensions': [
'django_jinja_markdown.extensions.MarkdownExtension',
],
}
},
]
Basic Use
Examples of using filter in template:
{{ content|markdown }}
{{ markdown('this is **bold**') }}
Or with additional settings:
{{ content|markdown(extensions=['nl2br',]) }}
{{ markdown(content, extensions=['nl2br',]) }}
Example of using extension:
{% markdown %}
Text which will get converted with Markdown.
{% endmarkdown %}
License
This software is licensed under The MIT License (MIT). For more information, read the file LICENSE.
History
Forked in 2016 from the jingo-markdown project. Please see CHANGELOG for more history.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-jinja-markdown-1.1.tar.gz
.
File metadata
- Download URL: django-jinja-markdown-1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f41e7e722f2ef6d489d1768e45883f48a5f4e89ac0b34bb44d819d3c7d4a359 |
|
MD5 | 60544febf224061b98891447916d7979 |
|
BLAKE2b-256 | e79cc323217705ec6ac79ab051086ff946ea9869d48af7ea45b97944c12cf215 |
File details
Details for the file django_jinja_markdown-1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_jinja_markdown-1.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e7235c7e6d8876e8c56016e49c2673882ff075ea8dec5a78a400775e8095bf |
|
MD5 | ef1b1424501f59daabe19e6bba75837b |
|
BLAKE2b-256 | fc1bfc985a147a04214c622f15e383e28f1961dd2d4d437670d58f6d7bfc6f4f |