Mullet logic-less HTML templates

  • Extremely simple variable syntax is incapable of expressing logic in the templates.
  • Templates are clean HTML which your HTML authoring tool and browser can display correctly. You can use the templates as a static HTML prototype for your user interface.

Example

Given the template:

<ul>
  <li data-for="repos">
    <a data-href="url" data-text="description"></a>
  </li>
</ul>

Given the data in the hash:

{
  repos: [
    { url: "hello", description: "Hello project" },
    { url: "world", description: "World project" }
  ]
}

Will render the output:

<ul>
  <li>
    <a href="hello">Hello project</a>
  </li>
  <li>
    <a href="world">World project</a>
  </li>
</ul>

Credits