{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/950","repository_url":"https://api.github.com/repos/bem/bem-forum-content-ru","labels_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/950/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/950/comments","events_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/950/events","html_url":"https://github.com/bem/bem-forum-content-ru/issues/950","id":144286101,"number":950,"title":"Сделайте кто-нибудь урок по bem-xjst","user":{"login":"cyberS7","id":10922727,"avatar_url":"https://avatars.githubusercontent.com/u/10922727?v=3","gravatar_id":"","url":"https://api.github.com/users/cyberS7","html_url":"https://github.com/cyberS7","followers_url":"https://api.github.com/users/cyberS7/followers","following_url":"https://api.github.com/users/cyberS7/following{/other_user}","gists_url":"https://api.github.com/users/cyberS7/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberS7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberS7/subscriptions","organizations_url":"https://api.github.com/users/cyberS7/orgs","repos_url":"https://api.github.com/users/cyberS7/repos","events_url":"https://api.github.com/users/cyberS7/events{/privacy}","received_events_url":"https://api.github.com/users/cyberS7/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/bemhtml","name":"bemhtml","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-29T14:41:58Z","updated_at":"2016-03-31T18:31:45Z","closed_at":null,"body":"Добрый день. Прошу сделать урок по bem-xjst. Я вот честно не врубаюсь как пользоваться. Спасибо."},"comment":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/comments/204067365","html_url":"https://github.com/bem/bem-forum-content-ru/issues/950#issuecomment-204067365","issue_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/950","id":204067365,"user":{"login":"tadatuta","id":475746,"avatar_url":"https://avatars.githubusercontent.com/u/475746?v=3","gravatar_id":"","url":"https://api.github.com/users/tadatuta","html_url":"https://github.com/tadatuta","followers_url":"https://api.github.com/users/tadatuta/followers","following_url":"https://api.github.com/users/tadatuta/following{/other_user}","gists_url":"https://api.github.com/users/tadatuta/gists{/gist_id}","starred_url":"https://api.github.com/users/tadatuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadatuta/subscriptions","organizations_url":"https://api.github.com/users/tadatuta/orgs","repos_url":"https://api.github.com/users/tadatuta/repos","events_url":"https://api.github.com/users/tadatuta/events{/privacy}","received_events_url":"https://api.github.com/users/tadatuta/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T18:31:45Z","updated_at":"2016-03-31T18:31:45Z","body":"@Oleg2tor в такой постановке минимальным и достаточным будет:\r\n`npm i bem-xjst` и `require('bem-xjst').bemhtml.compile('текст шаблона').apply(bemjson);`\r\n\r\nРаботающий пример:\r\n\r\n```sh\r\nmkdir myproj\r\ncd !$\r\nnpm init --yes\r\nnpm i bem-xjst --save # ставим пакет bem-xjst, который предоставляет технологии BEMHTML и BEMTREE\r\ntouch generateHtml.js # создаем файл, где будет вызываться применение шаблонов\r\ntouch templates.bemhtml.js # создаем файл, куда будем писать шаблоны (на самом деле опционально)\r\n```\r\n\r\n```js\r\n// templates.bemhtml.js \r\nblock('list')(\r\n    tag()('ul'),\r\n    elem('item').tag()('li')\r\n);\r\n```\r\n\r\n```js\r\n// generateHtml.js\r\nvar fs = require('fs');\r\nvar bemhtml = require('bem-xjst').bemhtml;\r\nvar bemjson = {\r\n    block: 'list',\r\n    content: ['e1', 'e2', 'e3'].map(e => ({ elem: 'item', content: e }))\r\n};\r\nvar html = bemhtml.compile(fs.readFileSync('templates.bemhtml.js', 'utf8')).apply(bemjson);\r\n\r\nfs.writeFileSync('page.html', html);\r\n// '<div class=\"list\"><div class=\"list__item\">e1</div><div class=\"list__item\">e2</div><div class=\"list__item\">e3</div></div>'\r\n```"}}