Django-Jinja (Jinja2) extension and filter for parse markdown text markup.
Python
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 8 commits ahead of nrsimha:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
django_jinja_markdown
tests
.gitignore
.travis.yml
CHANGELOG
LICENSE
MANIFEST.in
README.rst
runtests.py
setup.cfg
setup.py
tox.ini

README.rst

Django-Jinja-Markdown

https://img.shields.io/travis/pmac/django-jinja-markdown/master.svg?maxAge=2592000 https://img.shields.io/pypi/v/django-jinja-markdown.svg?maxAge=2592000

Django-Jinja (Jinja2) extension and filter to parse markdown text in templates.

Requirements

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.