inyanga

Crates.ioinyanga
lib.rsinyanga
version0.1.1
created_at2025-10-12 16:50:29.193186+00
updated_at2025-10-12 16:54:43.99395+00
descriptionAxum/mlua based server-side lua scripting
homepage
repositoryhttps://github.com/KonradNoTantoo/Inyanga
max_upload_size
id1879446
size52,024
Knife (KonradNoTantoo)

documentation

README

Inyanga

Inyanga is a Rust™ crate that allows embedding Lua scripts inside HTML, making it easy to create dynamic web pages using Lua. It enables interpreting Lua code directly within HTML pages, similar to how PHP works.

Technically, Inyanga is a layer of paste between the Axum web framework and the mlua crate for Lua integration in Rust™.

It works as a Layer, to simplify integration of Lua-powered HTML rendering into an Axum application.

Example better than words

Inyanga will interpret the <?lua .. ?> block from the following HTML code:

<!DOCTYPE html>
<html>
<head>
    <title>Inyanga Example</title>
</head>
<body>
    <h1>Hello from Lua!</h1>
    <?lua
        for i = 1, 5 do
            ?><p><?lua echo("Number: " .. i)?><p><?lua
        end
    ?>
</body>
</html>

Example server (including exposure of Rust™ callbacks to Lua code) can be found in examples/server.rs.

License

WTFPL-2

Commit count: 0

cargo fmt