0.10.2 • Published 2 years ago

tagel v0.10.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

tagel template engine

Creates html pages using patrials (import) and applies a context (binding).

Elements and attributes

import

imports content of template at RELATIVE_PATH and rewrites paths

<link rel="import" href="RELATIVE_PATH">

lang

reads lang from html tag and removes all elements with a lang attribute that doesn't match

<html lang="en">
...
  <div lang="fr">...</div> <!-- will be removed -->

tg-env

removes elements having tg-env attribute that doesn's match process.env.NODE_ENV

<div tg-env="development"></div>

tg-if

if tg-if attribute value is falsy, it removes the element

<div tg-if="something_falsy">
  ...
</div>

tg-for

attribute value must be an array. It repeats the element (and subtree) and binds values based on array item

<div tg-for="this.items">
  <div tg-bind="this.property1"></div>
</div>

tg-text

set the element's content to the evaluated value (textContent)

<div tg-text="this.textProperty"></div>

tg-html

set the element's inner html tree to the evaluated value (innerHTML)

<div tg-html="this.htmlProperty"></div>

tg-bind

replaces element with the evaluated value

<div tg-bind="this.property"></div>

Attribute Binding

to bind a value to an attribute, prefix attribute name with tg:

<a tg:href="this.imageUrl">...</a>
0.10.2

2 years ago

0.9.7

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.7.5

2 years ago

0.5.7

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.10.1

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.7.2

2 years ago

0.5.4

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.9.2

2 years ago

0.7.4

2 years ago

0.5.6

2 years ago

0.9.1

2 years ago

0.7.3

2 years ago

0.5.5

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.3

2 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.2

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago