hypernova-jinja2-directive

Hypernova Directive jinja2


Keywords
hypernova, jinja2
License
MIT
Install
pip install hypernova-jinja2-directive==0.1.0

Documentation

Hypernova Jinja2 Directive

Hypernova Directive for Jinja2

This directive enables you render a Hypernova placeholder for Nova Proxy using Jinja2

Installation

You can install the package from pip.

pip install hypernova_jinja2_directive

Setup

You need to register a global function when the Jinja2 environment is defined.

from hypernova_jinja2_directive import nova

class JinjaEnvironment(Environment):
    def __init__(self,**kwargs):
        super(JinjaEnvironment, self).__init__(**kwargs)
        self.globals['nova'] = nova

Setup Flask.

from hypernova_jinja2_directive import nova

app.jinja_env.globals.update(nova=nova)

Usage

You need to pass the component name and component data. The data is optional.

{{ nova('Navbar', {'brand':'Ara Framework'}) }}