incubator-bloodhound-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olemis Lang <ole...@gmail.com>
Subject Re: Genshi XHTML + HTML 5
Date Fri, 30 Nov 2012 06:49:52 GMT
On 11/29/12, Olemis Lang <olemis@gmail.com> wrote:
> On 11/29/12, Olemis Lang <olemis@gmail.com> wrote:
>> On 11/29/12, Matevz Bradac <matevzb@gmail.com> wrote:
>>> Hi,
>>>
>>
>> :)
>>
[...]
>
> I suggest you to consider this approach
>
> 1. BH theme already implements IRequestFilter
> 2. implement a stream wrapper overriding render
>     method in such a way that DocType.HTML5
>     (or something more accurate , your choice ;)
>     is used instead of HTML strict *if appropriate*
>     e.g. bloodhound theme enabled , etc, etc ...

... and an elegant solution without wrappers consists of overriding
access to class' render method using instance attribute , like this

{{{
#!py

new_doctype = DocType.HTML5

def new_render(method, doctype, out, encoding, [...] ):
    return stream.render(method, doctype=new_doctype, out=out,
                           encoding=encoding)

stream.render = new_render

[...]

}}}

[...]

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Mime
View raw message