package
0.5.0
Repository: https://github.com/metafates/mangal-lua-libs.git
Documentation: pkg.go.dev

# README

template GoDoc

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).