On 02/08/2012 02:30 PM, Christoph Zwerschke wrote: > Am 08.02.2012 12:10, schrieb Alessandro Molina: >> Now it should be possible to use all the three options: >> - Do not pass doctype to tg.render.render mean automatic detection >> - Set it to None to enforce no doctype >> - Set it to any string to force it if available for that content_type > > Ok, I'll add tests for all these use cases. > > We still have to clarify what takes precedence, templating.genshi.doctype > (which > was set excplicitly, but as a static value) or the doctype derived from > response.content_type via doctypes_for_content_type. > > Also, maybe we should allow templating.genshi.doctype to be a dict in which > case > doctypes_for_content_type would be updated by that dict. Same for > templating.genshi.method and methods_for_content_type. > > We could then let templating.genshi.doctype take precedence (as we currently > do), but we shouldn't set in the quickstart templates any more so that the > default automatic detection is active. > > Does that make sense? > >> It still doesn't solve in any way the issue of alex as there is still >> no way to enforce a doctype from the expose decorator or from the >> controller method. Adding text/xml to doctypes_for_content_type with >> None provides a fix for XML target output, but we should think if we >> want a more general way or if it is enough as genshi is actually able >> to render only a known set of documents when used in xml mode. > > I would not add None values to doctypes_for_content_type but assume the > doctype > value is None for all content types not contained in the dict. this is being done already by dict.get(key). but when using the xml rendering method, genshi would tolerate no doctype in it's args. > > If you want to render a special doctype I think you can always include that > verbatim in the template and set doctype=None when rendering.
however it would be great to guess the parameters of each supported engine, freedom should be left to allow controller methods to get their exact rendering parameters' that might well be the mere reason of an user to choose one engine over the others. > > -- Christoph > -- alex -- You received this message because you are subscribed to the Google Groups "TurboGears" 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?hl=en.

