package
0.0.0-20250120080617-bb7c638c6f78
Repository: https://github.com/chainreactors/mals.git
Documentation: pkg.go.dev
# README
template 
Usage
local template = require("template")
local mustache, err = template.choose("mustache")
local values = {name="world"}
print( mustache:render("Hello {{name}}!", values) ) -- mustache:render_file()
-- Output:"Hello world!"
local values = {data = {"one", "two"}}
print( mustache:render("{{#data}} {{.}} {{/data}}", values) )
-- Output:" one two "
Supported engines
# Functions
Choose lua template.get(engine) returns (template_ud, err).
Loader is the module loader function.
Preload adds template to the given Lua state's package.preload table.
RegisterTemplateEngine register template engine.
Render lua template_ud:render(string, values) returns (string, err).
RenderFile lua template_ud:render(string, values) returns (string, err).