unleashed 0.1.1

A simple templating tools with soon to be added django's templating functionality

Unleashed

Just another simple templating tools

How to

The text

html
  head
    title
      'Test title
  body
    div#first_div.a_div
      % for item in items
        p
          '{{ item }}
    % if okay
      p
        'Hello World!

The dart

void main() {
  Template template = new Template('123.txt', {
    'items' : [1,2,3,4,5],
    'okay' : true,
  });
  template.render().then(print);
}

prints out

<html>
  <head>
    <title>Test title</title>
  </head>
  <body>
    <div id='first_div' class='a_div'>
      <p>1</p>
      <p>2</p>
      <p>3</p>
      <p>4</p>
      <p>5</p>
    </div>
    <p>Hello World</p>
  </body>
</html>

every ' at the start of a line indicates a text

every % indicates a logic tag

else it's a html tag (right now only supports class and id attribute)

Soon to be added:

  • Tag support user define attribute
  • Inheritance
  • Django block-tag-like functionality ( {% block main %}{% endblock %})

Bugs to be expected.