Jade - Node Template Engine

Tags

By default, text at the start of a line (or after only white space) represents an html tag. Indented tags are nested, creating the tree like structure of html.

ul
  li Item A
  li Item B
  li Item C
<ul>
  <li>Item A</li>
  <li>Item B</li>
  <li>Item C</li>
</ul>

Jade also knows which elements are self closing:

img
<img/>

Block Expansion

To save space, jade provides an inline syntax for nested tags.

a: img
<a><img/></a>

Self Closing Tags

Tags such as img, meta, link and so on are automatically self-closing (unless you use the xml doctype). You can also explicitly self close a tag by simply appending the / character. Only do this if you know what you're doing

foo/
foo(bar='baz')/
<foo/>
<foo bar="baz"/>