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

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.

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.