Permalink
Browse files

Added pyramid processor,

Delete develop mode mako reference in README
  • Loading branch information...
syrusakbary committed Mar 27, 2012
1 parent 36eaa69 commit 4ac331d15f83d00ec2e39b5aa17a42f51ae56ace
Showing with 21 additions and 1 deletion.
  1. +0 −1 README.rst
  2. +21 −0 pyjade/ext/pyramid/__init__.py
View
@@ -57,7 +57,6 @@ Just add `pyjade.ext.mako.preprocessor` as preprocessor::
preprocessor=mako_preprocessor
)
-**Actually the mako preprocessor is in development mode**
Flask
-----
@@ -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)

0 comments on commit 4ac331d

Please sign in to comment.