Skip to main content

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

  1. First install the package

     pip install jinjaMarkdown
    
  2. 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)
    
  3. 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.

  4. 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

jinjaMarkdown-0.0.8.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jinjaMarkdown-0.0.8-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file jinjaMarkdown-0.0.8.tar.gz.

File metadata

  • Download URL: jinjaMarkdown-0.0.8.tar.gz
  • Upload date:
  • Size: 5.2 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

Hashes for jinjaMarkdown-0.0.8.tar.gz
Algorithm Hash digest
SHA256 3f62bf07d94eff0ffcae228e29bb706e34ef5b8f3e27c07875a1fee891883c7e
MD5 d762086e244b515af189ab6cbe9e2729
BLAKE2b-256 e7c23cc712f7585743bbc63c70191ee7bfaa3b8d588b3fce7698c10c8018fc77

See more details on using hashes here.

File details

Details for the file jinjaMarkdown-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: jinjaMarkdown-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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

Hashes for jinjaMarkdown-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ca218129d885ecabf1670600f67f8f7e63c4218b8acca35349b6c674f22ebd47
MD5 f010f51dae104362d40b0841a2318f97
BLAKE2b-256 679da9e94a7a9a2481f7349178c22ade078417885ac0c8820c435c2e9195f2d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page