Skip to content

Instantly share code, notes, and snippets.

@earl
Created June 5, 2010 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earl/427093 to your computer and use it in GitHub Desktop.
Save earl/427093 to your computer and use it in GitHub Desktop.
>> include('ringo/skin')
>> var schema = JSON.parse(require('ringo/httpclient').get('http://json-schema.org/address').content)
>> var ctx = {}
>> ctx['schema'] = schema
>> ctx['is_properties'] = function (macro) macro.parameters[0] == 'properties'
>> var skin = createSkin('<% for p in <% schema %> render property %><%subskin property %><% if <% is_properties <% index %> %> echo <% index %> %>')
>> render(skin, ctx)
properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment