1 unstable release

Uses new Rust 2024

0.1.1 Oct 12, 2025
0.1.0 Oct 12, 2025

#5 in #mlua

WTFPL license

22KB
847 lines

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

Dependencies

~21MB
~360K SLoC