A package containing a markdown filter for jinja2
Project description
Jinja2 Markdown Filter
This package offers a markdown filter to can be used to convert markdown to html code within a jinja2 template.
How to Use
-
First install the package
pip install jinjaMarkdown -
Import and Add the extension to your jinja enviroment (this should be done in app.py for flask)
#import package from jinjaMarkdown.markdownExtension import markdownExtension #add markdownExtension to enviroment (by default jinja_env) app.jinja_env.add_extension(markdownExtension) -
Use markdown filter as you would any other jinja filter
{{ "# Hello World" | markdown }}The above code would be equivalent to
"<p><h1>Hello World</h1></p>"If autoescape is on (as it is by default) this will not be rendered as html code and instead as a string.
-
Autoescape can be turned off like so:
{% autoescape false %} {{ "# Hello World" | markdown }} {% endautoescape %}Note: Malicious code can be run while autoescape is turned off, so please keep your code secure.
Markdown Syntax in Use
The markdown syntax used in this package follows this guide.
Only the best practices for markdown are implemented. If you are getting an error while using this package ensure you follow best practice first and that the syntax you are using is not included below.
Basic Syntax Not Included (yet)
- Blockquotes
- Lists
- Code Blocks
- Escaping Characters and Code
- Reference links
- Links using angular brackets
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 jinjaMarkdown-0.0.6.tar.gz.
File metadata
- Download URL: jinjaMarkdown-0.0.6.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e3d3f7feca7fa262283095f920566ae9ee64d922f6865f7338b506f74658bac
|
|
| MD5 |
6343d0d0a126fb2c5e95d2600ac01061
|
|
| BLAKE2b-256 |
23d9329bac3cef6221f540c434fca3f9612d423ebfb6fc0b7f50bb1b1e4ac3cd
|
File details
Details for the file jinjaMarkdown-0.0.6-py3-none-any.whl.
File metadata
- Download URL: jinjaMarkdown-0.0.6-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10fe4556be8ac7fce2eba85437c558f6ad560cad49c998c973b43d7dd5f81d33
|
|
| MD5 |
35f7e537137411f15ee000896fdad405
|
|
| BLAKE2b-256 |
bf78af33eab2c0e3bb901961655d3132349cc7247be000bfd52762fccffc4794
|