lua-users home
lua-l archive

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


Nice job.  I use Orbits htmlification almost every day and like your syntax for multiple classes. I have never tried that in Orbit,  I wonder if it works like that.

I would actually prefer Penlights implementation better because of the misspelling checking,  but cannot figure out how to use it in an Orbit app. Steve,  have you ever tried this before and do you have an example?
--
Regards,
Ryan

Sent from my tablet

On Nov 18, 2012 10:55 AM, "steve donovan" <steve.j.donovan@gmail.com> wrote:
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.