Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronpowell/glue
Glue will stick your objects into your HTML
https://github.com/aaronpowell/glue
Last synced: about 1 month ago
JSON representation
Glue will stick your objects into your HTML
- Host: GitHub
- URL: https://github.com/aaronpowell/glue
- Owner: aaronpowell
- License: mit
- Created: 2011-06-27T11:51:42.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-08-03T05:43:29.000Z (over 13 years ago)
- Last Synced: 2024-11-17T19:53:56.630Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 184 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: License.txt
Awesome Lists containing this project
README
# Glue!
Glue is a micro templating library which uses the HTML5 data attributes to make HTML from your template.
Here's how you create a Glue template:
<h1 data-glue-name></h1>
$('#glue').glue([ { name: 'Glue tastes good' } ]).appendTo($('#body'));
Glue also allows you to set attributes rather than the innerHTML of an element:
<h1 data-glue-name='title'>Psst, check out the title</h1>
$('#glue').glue([ { name: 'Glue tastes good' } ]).appendTo($('#body'));
# Why Glue?I don't like templating libraries which require their own syntax like `${SomeProperty}`, and I don't see why you should hijack an existing property like `class` to specify your template operation. Instead Glue will take `data-glue-*` and map that into your objects property.