Skip to main content

Template.handlebars

def Template.handlebars(
template: str,
/,
*,
data: dict[str, typing.Any] = ,
) -> str
Renders a Handlebars template with the provided data. Parameters
  • template: The Handlebars template string.
  • data: A dictionary of data to render the template with.
Returns The rendered template as a string. Example
result = ctx.template.handlebars("Hello, {{name}}!", {"name": "World"})

Template.jinja2

def Template.jinja2(
template: str,
/,
*,
data: dict[str, typing.Any] = ,
) -> str
Renders a Jinja2 template with the provided data. Parameters
  • template: The Jinja2 template string.
  • data: A dictionary of data to render the template with.
Returns The rendered template as a string. Example
result = ctx.template.jinja2("Hello, {{ name }}!", {"name": "World"})

Template.liquid

def Template.liquid(
template: str,
/,
*,
data: dict[str, typing.Any] = ,
) -> str
Renders a Liquid template with the provided data. Parameters
  • template: The Liquid template string.
  • data: A dictionary of data to render the template with.
Returns The rendered template as a string. Example
result = ctx.template.liquid("Hello, {{ name }}!", {"name": "World"})