Django-Jinja (Jinja2) extension and filter for parsing markdown text markup.
Project description
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. Please see CHANGELOG for more history.
Releasing
Update the version number in pyproject.toml.
Add an entry to the CHANGELOG file.
Tag the commit with the version number: e.g. 1.21.
Push the commit and tag to the GitHub repo.
Create a new GitHub release, selecting the tag you just pushed to specify the commit. Hit Publish.
GitHub will build and release the package to PyPI. Monitor the progress via the Actions tab.
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_jinja_markdown-1.2.tar.gz.
File metadata
- Download URL: django_jinja_markdown-1.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f109ce81e3655c43a4df0e482f3de839e18f96fecaf7032c415a49a15fde13c4
|
|
| MD5 |
aaf345cc5eb63e100598681313338aac
|
|
| BLAKE2b-256 |
6aba8bc33dfd8644c00262d17e4091561e627feac540b73de3221e9152701974
|
File details
Details for the file django_jinja_markdown-1.2-py3-none-any.whl.
File metadata
- Download URL: django_jinja_markdown-1.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58cb4f0f87c7ef216865ff81df209a2aec8afb28451ee5c4aba3a0962da56f88
|
|
| MD5 |
5b4c99ae9428c2f0091309dd1242d81b
|
|
| BLAKE2b-256 |
45dc0449a46eeff79c08e78c8ed8597335c98930d16fa256e6598602a05955b8
|