diff --git a/.rockspec b/.rockspec index 572f9ce..d8ba7b5 100644 --- a/.rockspec +++ b/.rockspec @@ -1,5 +1,5 @@ package = "luax" -version = "1.0.1-1" +version = "1.0.1-2" source = { url = "https://github.com/syarul/luax/archive/refs/tags/v1.0.1.tar.gz", @@ -106,6 +106,7 @@ dependencies = { build = { type = "builtin", modules = { - luax = "luax.lua" + luax = "luax.lua", + h = "h.lua" } } diff --git a/README.md b/README.md index fdc4a0a..5d89087 100644 --- a/README.md +++ b/README.md @@ -6,37 +6,33 @@ Decent parse for HTML, so you don't have to write as concatenates string, in sho ### Usage +Install with `Luarocks` + +`luarocks install luax` + +load the `LuaX` `h` pragma **only** with ```lua local h = require('h') -local el = div( - { class = "container" }, - p({ class = "title" }, "Hello, world!"), - span({ style = "color: red;" }, "This is a span") -) - -print(h(el)) +print(h(div({ style = "color: red;" }, "Hello from LuaX!"))) ``` You'll get, ```html -
Hello, world!
This is a span