Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

generate HTML using CSS-like selectors

branch: gh-pages

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 css
Octocat-spinner-32 img
Octocat-spinner-32 js
Octocat-spinner-32 src
Octocat-spinner-32 templates
Octocat-spinner-32 test
Octocat-spinner-32 README.rest
Octocat-spinner-32 build.sh
Octocat-spinner-32 index.html
README.rest

legojs - generate HTML with CSS-like selectors

legojs is an js module that allows to generate complex HTML using a syntax that is similar to CSS selectors.

legojs is inspired by zen-coding: https://code.google.com/p/zen-coding/

get it

git clone https://github.com/marianoguerra/legojs

build it

this builds the parser for the expressions

cd legojs
./build.sh

try it

http://marianoguerra.github.com/legojs/

test it

http://marianoguerra.github.com/legojs/test

or open test/index.html in your browser

use it

there are two ways of using it, one is like any normal .js file, just add a script tag and import it (see test/index.html for an example)

the other one is using an AMD loader like requirejs, in this case you just require the lib, it will return you the legojs function standalone and will add the function to the jquery object in $.lego so you can just ignore it and use $.lego or use the returned function itself.

for an example of out to use it with requirejs see the main page at index.html

author

Mariano Guerra

license

BSD (+ optional beer to the author)

Something went wrong with that request. Please try again.