-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 28 May 2007, at 00:01, Julien Cigar wrote:
> I wondered how can I tell to Pylons that the rendered template
> (with Genshi) should be in utf-8 / xhtml-strict ?
>
> I tried the following (middleware.py) but without success :
> config.template_engines = []
> config.add_template_engine('genshi', 'ias.templates',
> {'genshi.encoding' : 'utf-8', 'genshi.output' : 'xhtml-strict'})
Configuration options are laid out in this doc (see section 4):
http://genshi.edgewall.org/wiki/Documentation/plugin.html
for those variables, you need to use genshi dot /default/ thingy
(illustrated below). Otherwise, you're more or less on the right track.
development.ini:
============
# Genshi settings:
genshi.auto_reload = True
genshi.default_doctype = xhtml-strict
genshi.default_encoding = utf-8
genshi.default_format = xhtml
middleware.py:
============
# Setup Genshi Template Engine, read settings made in development.ini
genshi_options = dict((k,v) for k,v in app_conf.iteritems() if
k.startswith('genshi'))
config.add_template_engine('genshi', '/bel/genshi', genshi_options)
Cheers,
Graham.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAgUBRlqsPVnrWVZ7aXD1AQI+3gP/YBKOGGhecHgmHPWBzlkP6tnewtnLlj5E
3qrP6jL0gwCx9S2uUqEtjdBP2qdaluGFyWjbPsYAtkSiIBhtzImnMCpJKAQWCXGI
NFHKVwJHo7C9u9/T532ydcF4Ykrftc2a+QXxKiMl7p+GQFJQqS/4rJePPZII3JDx
nhWy/6PMZ7s=
=M5fc
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---