Up to 9000

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
839 so....I was looking at how another lua web framework worked to see what good bits it had that I could "borrow"
I then looked at how you make a view in it:
Code:
function layout(web, args, inner_html)
   return html{
      head{
     title(blog_title),
     meta{ ["http-equiv"] = "Content-Type",
        content = "text/html; charset=utf-8" },
     link{ rel = 'stylesheet', type = 'text/css',
        href = web:static_link('/style.css'), media = 'screen' }
      },
      body{
     div{ id = "container",
        div{ id = "header", title = "sitename" },
        div{ id = "mainnav",
           _menu(web, args)
        },
            div{ id = "menu",
           _sidebar(web, args)
        },
        div{ id = "contents", inner_html },
        div{ id = "footer", copyright_notice }
     }
      }
   }
end
edit 840
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
845. Ok, let me quickly write some html so you can compare what they did together with how html looks. Then you can go ahead and figure out why I don't like that system
HTML:
<html
    <head>
        <title>blog_title</title>
    </head>
    <body>
        <div class="container">
            <h1>This is how HTML normaly looks</h1>
            <p>See the diffrence?</p>
        </div>
        <div>
            <h2>Credit for originality</h2>
            <p>That being said, I must give them credit for being pretty original as they used lua tables to repesent HTML. Having said that I don't think it works that nicely</p>
            <p>I mean, just look at how html looks and now at the table they made <a href="some link"><p> and I am pretty sure <img src="Some picture link"></p></a> doing things like this would be hell in that system but who am I to judge. I mean, if it works it works but I rather use the normal html way</p>
        </div
        <div>
            <p> Also, am I allowed to ask how you are supposed to write js in that system? Though, looking at it better it seems like they know that acctually filling in the text on the webpages is going to be hell using this system thus you need to write functions that are executed and probably pass the text that you would normally write here. Making that system even more weird.<p>
        </div>
    </body>
</html>
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
851 ok, in other words. Their system is a table fuck.
Waaaayyyy too much tables in tables and what not, it is not at all clear which tags are under each other and which are nested
 

RealKC

Popular Member
Dec 6, 2015
1,004
534
129
King of the Hill
8=5+3
When you can count something you use "many"(too many tables, cars, buildings).
When you cannot count something you use "much"(too much water, lava, liquid xp)
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
855 in lua you don't have arrays/objects
In stead they are "combined" into something they call tables.