{"id":16982041,"url":"https://github.com/tenphi/jml","last_synced_at":"2025-04-12T02:21:03.518Z","repository":{"id":2799914,"uuid":"3800452","full_name":"tenphi/jml","owner":"tenphi","description":"Data-driven content generation library","archived":false,"fork":false,"pushed_at":"2013-08-04T11:19:51.000Z","size":116,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T22:01:34.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tenphi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-22T17:47:27.000Z","updated_at":"2017-05-23T02:14:54.000Z","dependencies_parsed_at":"2022-07-12T14:59:42.393Z","dependency_job_id":null,"html_url":"https://github.com/tenphi/jml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fjml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fjml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fjml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fjml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenphi","download_url":"https://codeload.github.com/tenphi/jml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247882289,"owners_count":21012037,"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-10-14T02:07:09.226Z","updated_at":"2025-04-12T02:21:03.495Z","avatar_url":"https://github.com/tenphi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"JML\n===\n\nData-driven content generation library\n\n## Getting started\nInstall via NPM...\n\n```\n$ npm install jml\n```\n\n... or add script to your web page.\n\n```html\n\u003cscript type=\"text/javascript\" src=\"/path/to/jml.js\"\u003e\u003c/script\u003e\n```\n\n... or install script via bower and add via requirejs.\n\n```bash\nbower install git://github.com/tenphi/jml.git\n```\n\n```javascript\nrequire(['./components/jml/jml'], function(jml) {\n  jml.render(/* view *//*, state */);\n});\n```\n\n## Simple usage\n\n```javascript\njml.render([\n  ['div', \n    { class: 'container' },\n    ['a', {\n      class: 'link', \n      href: 'http://tenphi.me'\n    }, 'Link text'],\n    ['img', {\n      src: '/myphoto.jpg', \n      alt: '', \n      style: {\n        width: '100px'\n      }\n    }]\n  ]\n]);\n```\n\noutput:\n\n```html\n\u003cdiv class=\"container\"\u003e\u003ca class=\"link\" href=\"http://tenphi.me\"\u003eLink text\u003c/a\u003e\u003cimg src=\"/myphoto.jpg\" alt=\"\" style=\"width: 100px; \" /\u003e\u003c/div\u003e\n```\n\n### Render with state\nCreate template:\n\n```javascript\nvar link = jml.view([\n  ['a', {\n    href: 'http://tenphi.me',\n    target: function() {\n      return this.target;\n    }\n  }, function() {\n    return this.body;\n  }]\n]);\n```\n\nand render it with state:\n\n```javascript\nlink({\n  body: 'text',\n  target: '_blank'\n});\n```\n\noutput:\n\n```html\n\u003ca href=\"http://tenphi.me\" target=\"_blank\"\u003etext\u003c/a\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenphi%2Fjml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenphi%2Fjml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenphi%2Fjml/lists"}