lua-users home
lua-l archive

Re: HTML-generating _ENV

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.

AltStyle によって変換されたページ (->オリジナル) /