Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added pyramid processor,

Delete develop mode mako reference in README
  • Loading branch information...
commit 4ac331d15f83d00ec2e39b5aa17a42f51ae56ace 1 parent 36eaa69
@syrusakbary authored
Showing with 21 additions and 1 deletion.
  1. +0 −1  README.rst
  2. +21 −0 pyjade/ext/pyramid/__init__.py
View
1  README.rst
@@ -57,7 +57,6 @@ Just add `pyjade.ext.mako.preprocessor` as preprocessor::
preprocessor=mako_preprocessor
)
-**Actually the mako preprocessor is in development mode**
Flask
-----
View
21 pyjade/ext/pyramid/__init__.py
@@ -0,0 +1,21 @@
+# from pyramid.threadlocal import get_current_request
+# from pyramid.events import BeforeRender
+from pyramid import mako_templating
+from pyjade.ext.mako import preprocessor
+
+def includeme(config):
+ config.add_renderer(".jade", PyjadeRenderer)
+ # config.add_subscriber\
+ # ( BeforeRender
+ # )
+
+class PyjadeRenderer(object):
+ """
+ The jade renderer
+ """
+ def __init__(self, info):
+ info.settings['mako.preprocessor'] = preprocessor
+ self.makoRenderer = mako_templating.renderer_factory(info)
+
+ def __call__(self, value, system):
+ return self.makoRenderer(value, system)
Please sign in to comment.
Something went wrong with that request. Please try again.