https://github.com/343max/zencode.js
Plugin for jQuery to provide zencode like syntax.
https://github.com/343max/zencode.js
Last synced: 8 months ago
JSON representation
Plugin for jQuery to provide zencode like syntax.
- Host: GitHub
- URL: https://github.com/343max/zencode.js
- Owner: 343max
- Created: 2009-11-23T16:26:41.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-11-24T16:17:36.000Z (over 16 years ago)
- Last Synced: 2025-03-30T01:46:25.875Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 89.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This morning I was quite flashed by Zen Code, an really simple way to write HTML Code.
http://code.google.com/p/zen-coding/
With this you can write something like
div.article>p*3 and expand it to this:
So I asked myself, why there is not something like this in JavaScript, for, say, jQuery.
So I hacked up zencode.js.
For now it's quite simple and I'm quite sure, there will be some rewrite quite soon, but for now you can do something like this:
var div = $.zencode.expand('div#id.class.anotherClass>p');
to get something you would normaly write this way:
var div = $('
').attr('id', 'id').addClass('class').addClass('anotherClass').append('');
or
var div = $('
');
that's not very usefull for now, but maybe I will find a way to hook some callbacks into this.