lua-users home
lua-l archive

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

Hello, I was looking at this ruby library:

In which you can do things like:

HammerBuilder::Formated.get.go_in do
  html do
    head { title 'my_page' }
    body do
      div :id => 'content' do
        p "my page's content", :class => 'centered'
end.to_xhtml! # =>

I started to think this could be written more succinctly in lua:

local t = {
  html {
    head { title {'my_page'} },
    body { id='content',
      p { class='centered', "my page's content"}

It does not look that bad, does it? Here is some quick and dirty code
to render that template:

I'm wondering if there is already a lua project that handles a
template like in the example above.

I think writing a web application templates in the way outlined in
that example could be a viable option. What do you think?

-------------------------------------------------------------- - Software Developer