{"id":22092208,"url":"https://github.com/pirxpilot/el","last_synced_at":"2025-03-23T23:45:32.916Z","repository":{"id":12535453,"uuid":"15205443","full_name":"pirxpilot/el","owner":"pirxpilot","description":"creates HTML from jade like expressions","archived":false,"fork":false,"pushed_at":"2017-02-23T07:06:37.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-02T03:23:17.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-15T15:07:45.000Z","updated_at":"2017-02-23T06:58:25.000Z","dependencies_parsed_at":"2022-08-31T06:41:39.345Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/el","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/el/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186927,"owners_count":20574554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T03:08:45.703Z","updated_at":"2025-03-23T23:45:32.888Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/travis/pirxpilot/el.svg)](http://travis-ci.org/pirxpilot/el)\n[![Dependency Status](https://img.shields.io/gemnasium/pirxpilot/el.svg)](https://gemnasium.com/pirxpilot/el)\n[![NPM version](https://img.shields.io/npm/v/el-component.svg)](http://badge.fury.io/js/el-component)\n\n# el\n\ncreates HTML from jade like expressions\n\nParticularly useful if you are a fan of [`insertAdjacentHTML`][1] but if setting `innerHTML` is your\nthing `el` works just as well.\n\n## Installation\n\n  Install with [npm]:\n\n    $ npm install el-component\n\n## API\n\n### el(tag, content, attributes)\n\n- `tag` - can be the name of HTML tag (`span`, `img` etc.) or a jade-like expression\n- `content` - is an optional content of the tag\n- `attributes` - object with a map of attributes added to the generated HTML, class attribute is\n  merged with what was parsed from tag\n\nSome examples:\n\n    el('span', 'some text inside'); // \u003cspan\u003esome text inside\u003c/span\u003e\n    el('span.title', 'Title');      // \u003cspan class=\"title\"\u003eTitle\u003c/span\u003e\n    el('span.title.car', 'Title');  // \u003cspan class=\"title car\"\u003eTitle\u003c/span\u003e\n    el('span#title.car', 'Title');  // \u003cspan class=\"car\" id=\"title\"\u003eTitle\u003c/span\u003e\n\nyou can skip the tag name if you want `div`:\n\n    el('#title', 'Title');   // \u003cdiv id=\"title\"\u003eTitle\u003c/div\u003e\n    el();                    // \u003cdiv\u003e\u003c/div\u003e\n\nel knows about void elements:\n\n    el('img', { src: 'http://example.com/img.png' }); // \u003cimg src=\"http://example.com/img.png\"\u003e\n    el('iframe', { src: 'http://example.com' });      // \u003ciframe src=\"http://example.com\"\u003e\u003c/iframe\u003e\n\n\n### el.xml(tag, content, attributes)\n\nA version of `el` that can be used to render XML (SVG etc.). It has no notion of voids, which means it closes tags without content with `/\u003e`.\n\nSome examples:\n\n    el.xml('path', { d: 'M0 0H5V7Z' }); // \u003cpath d=\"M0 0H5V7Z\"/\u003e\n\n## License\n\n  MIT\n\n[1]: https://developer.mozilla.org/en-US/docs/Web/API/Element.insertAdjacentHTML\n[npm]: https://www.npmjs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fel/lists"}