betty.content_builders.template module#

Tools to build content plugins that render templates.

class betty.content_builders.template.Template#

Bases: ContentBuilder

Build content by rendering a Jinja2 template.

__init__(*args: Any, jinja: Environment, **kwargs: Any)#
final async build(*, document: Document) str | None#

Render the content.

abstractmethod async build_template(document: Document) TemplateBuild#

Build template data.

Return a template name, a tuple of a template name and template date to render it. Return None to prevent anything from being rendered at all.