Welcome | Get started | Dive into Lino | Contribute | Reference | More

lino.modlib.jinja

loader

Defines a Loader which is automatically installed to TEMPLATE_LOADERS by lino.core.site

renderer

This initializes the SITE.jinja_env object.

Functions

get_environment(**options)

Classes

Plugin(site, app_label, app_name, ...)

See Introduction to plugins.

class lino.modlib.jinja.Plugin(site, app_label, app_name, app_module, needed_by, configs: dict)

Bases: Plugin

See Introduction to plugins.

post_site_startup(site)

This is being called from lino.core.kernel.Kernel.kernel_startup().

Adds a jinja_env attribute to settings.SITE.

Lino has an automatic and currently not configurable method for building Jinja's template loader. It looks for a "config" subfolder in the following places:

list_templates(ext, *groups)

Return a list of possible choices for a field that contains a template name.

render_from_request(request, template_name, **context)

Render the named Jinja template using an incoming HTTP request.

render_from_ar(ar, template_name, **context)

Render the named Jinja template using the given action request ar.

render_jinja(ar, tplname, context)

Render the named Jinja template, replacing ar.renderer by the Jinja renderer.