{"name":"h","version":"0.0.0","author":{"url":"http://dominictarr.com","name":"'Dominic Tarr'","email":"dominic.tarr@gmail.com"},"license":"MIT","_id":"h@0.0.0","maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"homepage":"https://github.com/dominictarr/h","dist":{"shasum":"c4675e9481ff5b82a802bb240529e701707abb48","tarball":"http://registry-npm.ywwl.com/h/download/h-0.0.0.tgz","integrity":"sha512-XlABBYJO0WEYRhT2pAIk1ZMufpIIV+1jqDxcJ/bXethWpPmNjSq+lNhqOQXwNHrKw0LP82eOvvtXwtc5uADJjA==","signatures":[{"sig":"MEQCIBTPk7mHnsBxJ3nNaKWppPjpG4O3ujerjxmDn0bO1c4SAiAiiw9l9qYTwKo4EmTs2JlJjN5FL11WNrMZJnYYNf36pg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":2062,"noattachment":false,"key":"/h/-/h-0.0.0.tgz"},"scripts":{"test":"tap test"},"repository":{"url":"git://github.com/dominictarr/h.git","type":"git"},"description":"## License","directories":{},"dependencies":{},"devDependencies":{"tap":"0.3.0"},"readme":"# h\n\ngenerate HTML from javascript array structures\n\nlike hyperscript but with arrays instead of functions.\nruns easily on the server and web workers, without a HtmlElement polyfil.\n\n## Example\n\n``` js\n\nvar toHTML = require('h')\n\ntoHTML(\n  ['div#page',\n    ['div#header',\n      ['h1.classy', 'h')),\n    ['div#menu', { style: 'float: left, width: 200px' } },\n      ['ul',\n        ['li', 'one'],\n        ['li', 'two'],\n        ['li', 'three']]],\n    ['div#content', {style: 'float: left;' },\n      ['h2', 'content title'],\n      ['p', \n        \"so it's just like a templating engine,\\n\",\n        \"but easy to use inline with javascript\\n\"],\n      ['p', \n        \"the intension is for this to be used to create\\n\",\n        \"reusable, interactive html widgets. \"]]]\n)\n\n```\n\n## toHTML (ary)\n\nCreate some html from an array structure.\nIf the first element in the array is a string, that's the tag name.\nif it is an array of arrays, each item is mapped through `toHTML`\nand the results are concatenated.\n\n### classes & id\n\nIf the tag name is of form `name.class1.class2#id` that is a short cut\nfor setting the class and id.\n\n### attributes\n\nIf an `{}` object is passed in, it's values will be used to set attributes.\n\n``` js\nh('a', {href: 'https://npm.im/h'}, 'h')\n```\n\nhtml attributes names must be alphanumeric but may have hypens.\nattribute values will be escaped with `html-escape`.\n\n### innerHTML: non-escaped html content.\n\nsometimes it is necessary to output non-escaped html,\nfor example, rendered markdown, or the output of another templating library.\nto do this, use the `{innerHTML:html}` attribute. Note, this will cause any\nfollowing children to be ignored.\n\n### children - string\n\nIf an argument is a string, it will be escaped with `html-escape`\n\n### children - null.\n\nThis is just ignored.\n\n### children - Array\n\nEach item in the array is treated like a ordinary child. (string or HTMLElement)\nthis is uesful when you want to iterate over an object:\n\n```\n['table',\n  Object.keys(obj).map(function (k) {\n    return ['tr'\n      ['th', k],\n      ['td', obj[k]]\n    ]\n  }]\n\n```\n\n## License\n\nMIT\n","publish_time":1345480393637,"_cnpm_publish_time":1345480393637,"dist-tags":{"latest":"1.0.0"}}