https://github.com/smokingplaya/lua_pages_creator
🦖 A utility that allows you to create Web Pages using Lua.
https://github.com/smokingplaya/lua_pages_creator
css html lua luapower luapowered w3c web
Last synced: about 1 year ago
JSON representation
🦖 A utility that allows you to create Web Pages using Lua.
- Host: GitHub
- URL: https://github.com/smokingplaya/lua_pages_creator
- Owner: smokingplaya
- Created: 2023-11-18T08:37:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T20:50:05.000Z (over 2 years ago)
- Last Synced: 2025-02-05T01:48:34.204Z (about 1 year ago)
- Topics: css, html, lua, luapower, luapowered, w3c, web
- Language: Lua
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Lua Pages Creator
LPC is a Lua-script that allows you to create static web pages using Lua objects, which makes web development much easier.
### Code Example
```lua
-- 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
```
### How to work with LPC?
(You must have Lua installed)
1. Create a *.lua file in the root directory of the LPC (this is where the main.lua file is located).
2. Write your page code according to the [documentation](DOCS.md) in the newly created file.
3. 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
4. Go to the output/* directory and find the files of your project.
Done!