LPC is a Lua-script that allows you to create static web pages using Lua objects, which makes web development much easier.
-- example.lua
local lpc_gui = require("libs.base_gui")
local page = lpc_gui.create_element("html")
local head = page:Add("head")
:Include("style.css", "css")
:Add("title", "Example Title")
local body = page:Add("body")
body.center_div = body:Add("div")
:SetSize("50vw", "50vh")
:SetBackgroundColor("gray")
:SetBorderRadius("16px")
:Center()
body.text = body.center_div:Add("h1", "Example Text")
:SetFont("Roboto")
:SetFontSize("24px")
:SetColor("white")
:Center()
return page
(You must have Lua installed)
- Create a *.lua file in the root directory of the LPC (this is where the main.lua file is located).
- Write your page code according to the documentation in the newly created file.
- Type the command lua main.lua * (where * is the name of the file you created; for example lua main.lua example.lua) into the terminal
- Go to the output/* directory and find the files of your project.
Done!