It's pronounced like the french word vipère
/vi.pɛʁ/
v install --git https://github.com/hanako-eo/viper.git
In main.v:
module main
import viper
fn main() {
mut engine := viper.new()
engine.add_tag(
name: "block",
handle: fn(_args string, value string) string {
return value
}
)
println(
engine.render("./example.html", map[string]string{}) // If in example.html you have error, it will be shown and exit.
)
}
In example.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Viper Example</title>
</head>
<body>
{[ block ]}
a
{[ endblock ]}
</body>
</html>
See the LICENSE file