Wire is an extendable and customisable dynamic HTML template engine based on element attributes and HTML5 user-defined elements.
import wire
var wireapp = wire()
echo wireapp.renderString('mytemplate')
When no extension is given, wire assumes that the file carries the .html
extension (e.g. mytemplate.html).
Here’s a quick sample of a Wire template.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Welcome to OurSite</h1>
<div w-if="logged_in">
Your name is .
<div w-for="posts" w-key="post">
<a href="{! base_url !}/post/1"></a>
</div>
</div>
<div w-not="logged_in">Please Login!</div>
</body>
</html>