codemix/htmling — pull request #11 by phpnode (2014-07-28 22:45:55+00:00)
Title: add support for custom elements

previously the only way to include partial views was via the non-standard `` tag, this PR implements the bare minimum required to allow partials via custom elements, e.g. ``, making it more inline with polymer. For now this is done by explicitly mapping element names to relative view paths, for example:

***usage***

```js
var HTMLing = require('htmling');

var templates = HTMLing.dir(__dirname + '/templates', {
elements: {
'my-element': '/elements/my-element.html'
}
});
```

***elements/my-element.html***
```html

Hello {{name}}

```

***input.html***
```html

Greetings

foo
```

***output.html***

```html

Greetings

Hello charles

foo
```