Skip to main content

Jade templates for Muffin Framework

Project description

Muffin-Jade – Jade template engine for Muffin framework.

Build Status http://img.shields.io/pypi/v/muffin-jade.svg?style=flat-square http://img.shields.io/pypi/dm/muffin-jade.svg?style=flat-square Donate

Requirements

  • python >= 3.3

Installation

Muffin-Jade should be installed using pip:

pip install muffin-jade

Usage

Add muffin_jade to PLUGINS in your Muffin Application configuration.

Options

JADE_CACHE_SIZE – Cache size for compiled templates (100)

JADE_ENCODING – Templates’ encoding (UTF-8)

JADE_PRETTY – Pretty output (True)

JADE_TEMPLATE_FOLDERS – List of pathes to templates folder ([templates])

Views

# Register custom context provider
# could be a function/coroutine
@app.ps.jade.ctx_provider
def custom_context():
    return { 'VAR': 'VALUE' }

# Register a function into templates
@app.ps.jade.register
def sum(a, b):
    return a + b

@app.register('/')
def index(request):
    """ Check for user is admin. """
    local_context = {'key': 'value'}
    return app.ps.jade.render('index.jade', **local_context)

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-jade/issues

Contributing

Development of Muffin-Jade happens at: https://github.com/klen/muffin-jade

Contributors

  • klen (Kirill Klenov)

License

Licensed under a MIT license.

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

muffin-jade-0.0.7.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

muffin_jade-0.0.7-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file muffin-jade-0.0.7.tar.gz.

File metadata

  • Download URL: muffin-jade-0.0.7.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for muffin-jade-0.0.7.tar.gz
Algorithm Hash digest
SHA256 54070ff18943321eff392098521ad5706b6d61f9ef01b1882d7e0082287cd6a7
MD5 35153521cd8974ca8b3f1730c1fe3176
BLAKE2b-256 bea077c10425b7bc2faba40a6eba66f50275190d9ce0bd3436380cbfdbd8a122

See more details on using hashes here.

File details

Details for the file muffin_jade-0.0.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for muffin_jade-0.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f368623c7a1a588dd62b4aa6ab3854c9e731b39855e5d640d45313023b895b04
MD5 7468056aba3a6522afbd80db8f7fee63
BLAKE2b-256 0b02edfdf9144b3bd41aa38b97eb27ba3e88cea2e5a2fb6f1399e78e0c5b65bf

See more details on using hashes here.

Supported by

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