asphalt.templating.api

class asphalt.templating.api.TemplateRenderer

Abstract base class for template renderers.

abstract render(template, **vars)

Render the named template.

Parameters:
  • template (str) – name of the template file, relative to any of the configured template directories

  • vars (Any) – extra context variables made available to templates

Return type:

str

Returns:

the rendered results

abstract render_string(source, **vars)

Render the template contained in the given string.

Parameters:
  • source (str) – content of the template to render

  • vars (Any) – extra variables made available to the template

Return type:

str

Returns:

the rendered results