Changes between Version 15 and Version 16 of GenshiRecipes/PylonsWithGenshi
- Timestamp:
- Jun 4, 2010, 12:38:55 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiRecipes/PylonsWithGenshi
v15 v16 3 3 In Pylons 0.9.6rc1, you need to replace `template_engine='mako'` with `template_engine='genshi'` in `config/environment.py`. 4 4 5 Apparently as of Pylons 0.9.5, if you have genshi installed you may invoke genshi templates just by using `render_response("genshi","<templatename>")`. The instructions below are helpful for making genshi the "default" templates.5 Apparently as of Pylons 0.9.5, if you have Genshi installed you may invoke Genshi templates just by using `render_response("genshi","<templatename>")`. The instructions below are helpful for making genshi the "default" templates. 6 6 7 7 To use Genshi with [http://pylonshq.com/ Pylons] 0.9.4 and below, you need to take some additional steps, which is what's going to be explained here. See also the [http://docs.pythonweb.org/display/pylonscookbook/Genshi+templates Pylons Cookbook variant] … … 37 37 38 38 Finally, the Pylons template plug-ins currently expect paths to act as module imports, so you will also need to create an empty `__init__.py` file inside appname/templates. 39 39 40 == !WebHelpers and Genshi == 40 41 To use [http://pylonshq.com/WebHelpers/ WebHelpers] within a Genshi template, the helper return values need to be wrapped in a Markup object, as it would otherwise be escaped. Think carefully before following this suggestion, however, as this effectively works around the white-listing effect of the Markup object, automatically running any HTML that users may submit to your site. It is safer (albiet much more annoying) to manually wrap specific WebHelpers in your pages. … … 83 84 wrap_helpers(locals()) 84 85 }}} 86 87 ---- 88 89 '''Note''': as of !WebHelpers 1.0 the `webhelpers.rails` package [http://webhelpers.groovie.org/whats_new.html#deleted-packages has been removed] and it seems the `wrap_helpers` workaround above isn't required anymore(?) 90 91 ---- 92 85 93 Now edit '''`<appname>/config/middleware.py`''' and just add: 86 94 {{{