Andriy Kornatskyy avatar Andriy Kornatskyy committed bfd67c3

Added inline_preprocessor to tenjin demo.

Comments (0)

Files changed (4)


                     <h1><a href="#{path_for('default')}">My Site</a></h1>
                 <div id="logindisplay">
-                    <?py include("shared/snippet/menu-signin.html") ?>
-                    <?py include("shared/snippet/menu-locale.html") ?>
+                    <?py inline("shared/snippet/menu-signin.html") ?>
+                    <?py inline("shared/snippet/menu-locale.html") ?>
                 <div id="menucontainer">
                     <ul id="menu">
                 <div id="footer">Version #{__version__}</div>
-        <?py include("shared/snippet/script.html") ?>
+        <?py inline("shared/snippet/script.html") ?>
         <?py if not captured_as("script"): ?>
         <?py pass ?>
         <?py #endif ?>


 auto-reload = False
 inline-preprocessor-fallback = False
+inline-preprocessor-fallback = False
 wsgi = app:main
 #uwsgi-socket = /tmp/uwsgi-test.sock


 install_requires = [
-    'wheezy.html>=0.1.95',
+    'wheezy.html>=0.1.97',


 elif template_engine == 'tenjin':
+    from wheezy.html.ext.tenjin import inline_preprocessor
     from wheezy.html.ext.tenjin import whitespace_preprocessor
     from wheezy.html.ext.tenjin import widget_preprocessor
     from wheezy.html.utils import format_value
     from wheezy.web.templates import TenjinTemplate
+    path = ['content/templates-tenjin']
     render_template = TenjinTemplate(
-            path=['content/templates-tenjin'],
+            path=path,
+                inline_preprocessor(path, config.getboolean(
+                    'tenjin', 'inline-preprocessor-fallback')),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.