Lua Resty Template

screenshot of Lua Resty Template

Templating Engine (HTML) for Lua and OpenResty.

Overview

lua-resty-template is a compiling (HTML) templating engine for Lua and OpenResty. It allows you to translate templates to Lua functions or bytecode blobs that can be later used with lua-resty-template or standard Lua functions. The engine handles the compilation process behind the scenes, so you don't have to worry about it.

Features

  • Template compilation to Lua functions or bytecode blobs
  • Support for inline template strings
  • Template syntax with tags for expressions, Lua code, and includes
  • Built-in template helpers
  • Ability to extend templates with blocks and inheritance
  • Integration with Angular or other tags/templating frameworks
  • Supports embedding Markdown inside templates
  • Lua Server Pages (LSP) support with OpenResty

Using OpenResty Package Manager (opm)

opm install bungle/lua-resty-template

Using LuaRocks

luarocks install lua-resty-template

Summary

lua-resty-template is a powerful templating engine for Lua and OpenResty. It provides features like template compilation, inline template strings, template syntax with various tags, and support for template inheritance. The engine is easy to install using either opm or LuaRocks. With lua-resty-template, you can efficiently generate dynamic HTML content in your Lua or OpenResty applications.