On Fri, Jul 29, 2011 at 9:08 PM, Christoph Zwerschke <[email protected]> wrote:
> Genshi actually inserts the proper doctype if you pass it along with the
> output method to the render method (e.g. doctype='html').
>
> The only problem is that Pylon's render_genshi function does not pass the
> doctype parameter. I had already reported this as Pylons ticket 613, but it
> was never fixed. So the best solution would be to just inline and improve
> Pylon's templating.render_genshi funtion into TG's render.render_genshi
> function.
>
> The doctype could then set from in render_genshi according to the
> 'templating.genshi.doctype' setting, with a suitable default derived from
> the output method.

Ok,
my proposal is available on development branch at
https://sourceforge.net/p/turbogears2/tg2/ci/c8eaa5aaf7174e3ab29318f36fa3606ab0d23b9d/

This permits to quickly switch between multiple rendering methods
writing both the correct content-type and DOCTYPE.
Available methods are:
 xhtml -> xhtml transitional
 xhtml-strict -> xhtml strict
 html -> HTML 4.01
 html5 -> HTML

Also switches doctype and content type according to the
response.content_type to automatically switch to XHTML Strict if
content_type is application/xhtml+xml

There is bunch of tests to check that it works as expected but I still
have to document it.
If it is approved as is, I'll close the related ticket and write documentation.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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/turbogears-trunk?hl=en.

Reply via email to