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.

(This module's source code is available here.)

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)

Bases: lino.core.plugin.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, replacing ar.renderer by the Site's default renderer. Adds some more context names.

render_jinja(ar, tplname, context)

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