ANN : TurboHtmlPy 0.2a

to install (available on CheeseShop):
$> easy_install TurboHtmlPy

to use inheritance (updated):

-------------------------------------------------------------------------------------------------
file myproject/templates/master.htmlpy :
-------------------------------------------------------------------------------------------------
html(xmlns="http://www.w3.org/1999/xhtml";)(
        head (
                slot.title,
                meta(name="DC.title", content=slot.title.text),
                meta(**{'content':"text/html; charset=utf-8",
'http-equiv':"Content-Type"}),
                link(rel="stylesheet", type="text/css",
href="/static/css/default.css", media="screen, projection"),
                slot.head[:],
        ),
        slot.body
)

-------------------------------------------------------------------------------------------------
file myproject/templates/home.htmlpy
-------------------------------------------------------------------------------------------------
hpy__define (into = '.master') (
    title('MyProject : Home'),
    body(
            h1('Welcome'),
            strong('Under Contruction'),
            p("It's the homepage of my futur webapp"),
            p("I run over ",
a(href="http://turbogears.org/";)("TurboGears")),
    )
)


The new inheritence provide :
* simplest syntax (IMHO) for slot's attribute definition (every
children of hpy_define define a slot attributes)
* simplest syntax for master (less quote and parenthesis)
* more function for master, ability to call method of ElementTree (like
head[:] or title.text)
* n-level inheritence (not tested)

Thanks

Reply via email to