HTML Generation

Mike 42flicks at gmail.com
Fri Apr 3 09:04:04 CEST 2009


Hello all,

I'm writing a web app and wanted to do some html generation (I really do not
like to maintain or write html).

I'm thinking of writing a dsl based on the following:

def html():
    return

def a():
    return

def body():
    return
(html,
...(head, (style, "id", {"font-color":"black"}))
...(body,
...... (a, "id", {"title":"bla"}, ("link title","http://www.link.com")),
......(p, "paragraph text")
...... )
...)
)

And then parsing the resulting list. (the specification of sorts is as far
as I've got) I'd have to create the list as a string and then call a method
which executes the contents as the methods would not be in the local scope.

The reason I'm posting is I'm curious what people think, I've been starting
to perfer this style and am curious if a similar solution exists or if this
is a good idea :)

I'll proberly finish it as a learning experience regardless.

I appreciate any responses :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090403/efdeaba7/attachment.html>


More information about the Python-list mailing list