Mercurial > piecrust2
comparison piecrust/templating/jinjaengine.py @ 849:8f8bbb2e70e1
templating: Template engines can now load extensions directly from plugins.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 27 Apr 2017 20:55:07 -0700 |
parents | 0da1207472d3 |
children | 2c7e57d80bba |
comparison
equal
deleted
inserted
replaced
848:7d83b9484b98 | 849:8f8bbb2e70e1 |
---|---|
125 PieCrustFormatExtension] | 125 PieCrustFormatExtension] |
126 for n in ext_names: | 126 for n in ext_names: |
127 if '.' not in n: | 127 if '.' not in n: |
128 n = 'jinja2.ext.' + n | 128 n = 'jinja2.ext.' + n |
129 extensions.append(n) | 129 extensions.append(n) |
130 for je in self.app.plugin_loader.getTemplateEngineExtensions('jinja'): | |
131 extensions.append(je) | |
130 | 132 |
131 # Create the Jinja environment. | 133 # Create the Jinja environment. |
132 logger.debug("Creating Jinja environment with folders: %s" % | 134 logger.debug("Creating Jinja environment with folders: %s" % |
133 self.app.templates_dirs) | 135 self.app.templates_dirs) |
134 loader = PieCrustLoader(self.app.templates_dirs) | 136 loader = PieCrustLoader(self.app.templates_dirs) |