Common Lisp guys have their CL-WHO, which makes HTML templating integrated with the \"main\" language thus making the task easier. For those who don\'t know CL-WHO, it looks
One of The Perl Foundation's current grant-sponsored projects (a lightweight web framework for Perl 6) has working Perl6 code that provides a similar interface:
use Tags;
say show {
html {
head { title { 'Tags Demo' } }
body {
outs "hi";
ul :id<numberlist> {
outs "A list from one to ten:";
for 1..10 {
li :class<number>, { $_ }
}
}
}
}
}
Browse or clone the current code on github.
There is stan: An s-expression-like syntax for expressing xml in pure python, from Divmod's Nevow. I think it's kind of what you want. An example from the tutorial linked:
t = T.table[
T.tr[
T.td[ "Name:" ],
T.td[ original.name ]
],
T.tr[
T.td[ "Email:" ],
T.td[T.a(href='mailto:%s' % original.email)[ original.email ] ]
],
T.tr[
T.td[ "Password:" ],
T.td[ "******" ]
],
]
Here is such thing for JavaScript. It looks like the following:
T.div({ className: "content"},
T.p("Some ", T.u("paragraph")),
T.p("Another paragraph"))