Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gabrieljmj/tempimp

Importer for HTML templates
https://github.com/gabrieljmj/tempimp

Last synced: about 2 months ago
JSON representation

Importer for HTML templates

Awesome Lists containing this project

README

        

tempimp
=======
HTML template importer.

## Install
Via npm:
```console
$ npm install --save tempimp
```

## Usage
```template/nav.html ```

```html




```

```public/js/main.js ```

```js
import {importTemplate} from './import-template';

window.onload = function () {
importTemplate('template/nav.html', {doc: document}).then(content => {
const items = content.querySelectorAll('li.nav-item');

[].forEach.call(items, item => {
document.querySelector('nav > ul#nav-items').appendChild(item);
});
});
};
```

```index.html ```

```html


MmM




```