-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
Writing new renderer backends | ||
============================= | ||
|
||
If you wish to implement an alternate method of template rendering, you can do so by subclassing | ||
the :class:`~asphalt.templating.api.TemplateRenderer` class. | ||
There is only one method implementors must override: | ||
.. highlight:: toml | ||
|
||
If you wish to implement an alternate method of template rendering, you can do so by | ||
subclassing the :class:`~asphalt.templating.api.TemplateRenderer` class. | ||
There are two methods implementors must override: | ||
|
||
* :meth:`~asphalt.templating.api.TemplateRenderer.render` | ||
* :meth:`~asphalt.templating.api.TemplateRenderer.render_string` | ||
|
||
If you want your renderer to be available as a backend for | ||
:class:`~asphalt.templating.component.TemplatingComponent`, you need to add the corresponding | ||
entry point for it. Suppose your serializer 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 ``setup.py`` under the ``entry_points`` argument in the ``asphalt.templating.renderers`` | ||
namespace:: | ||
:class:`~asphalt.templating.component.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:: | ||
|
||
setup( | ||
# (...other arguments...) | ||
entry_points={ | ||
'asphalt.templating.renderers': [ | ||
'awesome = foo.bar.awesome:AwesomeRenderer' | ||
] | ||
} | ||
) | ||
[project.entry-points."asphalt.templating.renderers"] | ||
awesome = "foo.bar.awesome:AwesomeRenderer" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters