[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: HTML-generating _ENV
- From: steve donovan <steve.j.donovan@...>
- Date: Sun, 18 Nov 2012 17:54:40 +0200
On Sat, Nov 17, 2012 at 6:47 AM, Tangent 128 <tangent128@gmail.com> wrote:
> local _ENV = require"htmlua".new()
> return html {
> body {
> div {
> class = "class",
> p "Hello"
> }
> }
> }
This is also done in Orbit using a setfenv trick (it's called
'htmlification') See the tutorial
http://keplerproject.github.com/orbit/example.html and look for
'Generating HTML'
In Penlight, pl.xml allows a similar trick, but the tags must all be
declared first. Otherwise it's too easy to generate bad HTML/XML with
spelling mistakes.
I do like the div.class {p"Hello"} notation you have.
steve d.