Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mateusmaso/jquery.html
jQuery plugin for building declarative HTML tags with imperative code
https://github.com/mateusmaso/jquery.html
coffeescript dsl html javascript jquery jquery-plugin
Last synced: 11 days ago
JSON representation
jQuery plugin for building declarative HTML tags with imperative code
- Host: GitHub
- URL: https://github.com/mateusmaso/jquery.html
- Owner: mateusmaso
- License: mit
- Created: 2013-08-19T06:22:22.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-03T02:26:59.000Z (almost 10 years ago)
- Last Synced: 2024-10-06T04:24:17.449Z (about 1 month ago)
- Topics: coffeescript, dsl, html, javascript, jquery, jquery-plugin
- Language: JavaScript
- Homepage:
- Size: 199 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
jquery.html [![Build Status](https://travis-ci.org/mateusmaso/jquery.html.svg?branch=master)](https://travis-ci.org/mateusmaso/jquery.html)
===========This library is an extension for jQuery which allows writing HTML using Javascript or Coffeescript, reducing the visual pollution while creating elements dynamically.
## Features
* Build node trees using tag as methods.
* Attributes and string content support.## Dependencies
* jquery.js (>= 2.1.0)
## Examples
### Javascript DSL
```javascript
$('body').$div(function() {
this.$h1({id: "hello-world"}, "Hello World");
this.$ul({class: "list"}, function() {
this.$li("One");
this.$li("Two");
this.$li("Three");
});
});
```### Coffeescript DSL
```coffeescript
$('body').$div ->
@$h1 id: "hello-world", "Hello World"
@$ul class: "list", ->
@$li "One"
@$li "Two"
@$li "Three"
```### Expected result
```html
Hello World
- One
- Two
- Three
```
## License
Copyright (c) 2013-2014 Mateus Maso. Released under an MIT license.