mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
27 lines
546 B
JavaScript
27 lines
546 B
JavaScript
function create(__helpers) {
|
|
var str = __helpers.s,
|
|
empty = __helpers.e,
|
|
notEmpty = __helpers.ne,
|
|
escapeXml = __helpers.x;
|
|
|
|
return function render(data, out) {
|
|
out.w("Hello" +
|
|
data.name +
|
|
"!");
|
|
|
|
if (notEmpty(data.colors)) {
|
|
out.w("<ul class=\"colors\">");
|
|
|
|
forEach(data.colors, function(color) {
|
|
out.w("<li class=\"color\">" +
|
|
escapeXml(color) +
|
|
"</li>");
|
|
});
|
|
|
|
out.w("</ul>");
|
|
}
|
|
};
|
|
}
|
|
|
|
(module.exports = require("marko").c(__filename)).c(create);
|