asphalt.templating.component
¶
-
class
asphalt.templating.component.
TemplatingComponent
(renderers: typing.Dict[str, typing.Dict[str, typing.Any]] = None, **default_renderer_args)¶ Creates one or more
TemplateRenderer
resource factories.Template renderers can be configured in two ways:
- a single renderer, with configuration supplied directly as keyword arguments to this
- component’s constructor (with the resource name being
default
and the context attribute matching the backend name)
- multiple renderers, by providing the
renderers
option where each key is the resource - name and each value is a dictionary containing that renderer’s configuration (with the context attribute matching the resource name by default)
- multiple renderers, by providing the
Each renderer configuration has two special options that are not passed to the constructor of the backend class:
- backend: entry point name of the renderer backend class (required)
- context_attr: name of the context attribute of the renderer resource factory
Parameters: