Skip to content

hexagontal-mpti/lol

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

literaly only lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%