Writing new renderer backends
If you wish to implement an alternate method of template rendering, you can do so by
subclassing the TemplateRenderer
class.
There are two methods implementors must override:
If you want your renderer to be available as a backend for
TemplatingComponent
, you need to add the
corresponding entry point for it. Suppose your template renderer class is named
AwesomeRenderer
, lives in the package foo.bar.awesome
and you want to give it
the alias awesome
, add this line to your project’s pyproject.toml
under the
entry_points
argument in the asphalt.templating.renderers
namespace:
[project.entry-points."asphalt.templating.renderers"]
awesome = "foo.bar.awesome:AwesomeRenderer"