jeml-example
Installation
$ npm install jeml-example
example
in layout.jeml
:
{ html: head: title: `title` body: `body` }
in view.jeml
:
default % var title = "I am title"; `layout(title, body())` mixin body p: "I am body" % var users = % "foo": "I am foo" % "bar": "I am bar" % for name: introduction in `users` p: "name: " `name` p: "introduce: " `introduction` }
in main.js
:
// you need to compile *.jeml file to *.js file before `require`var view = ;var beautify = html; console;console;/* output:<html> <head> <title>I am title</title> <script src="some_address..."></script></head> <body> <p>I am body</p> <p>name: foo</p> <p>introduce: I am foo</p> <p>name: bar</p> <p>introduce: I am bar</p></body> </html>*/ console;/* output:<p>my name is Gyson</p>*/