Hypernova Directive for Jinja2
This directive enables you render a Hypernova placeholder for Nova Proxy using Jinja2
You can install the package from pip.
pip install hypernova_jinja2_directive
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)
You need to pass the component name and component data. The data
is optional.
{{ nova('Navbar', {'brand':'Ara Framework'}) }}