{"action":"created","comment":{"url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/comments/69914970","id":69914970,"diff_hunk":"@@ -0,0 +1,116 @@\n+# HOF-template-partials\n+\n+Home Office Forms template partials is a collection of mustache partials commonly used in HOF applications.  It also contains a collection of i18n translations used within the template partials. All contents are designed to be extended in your individual applications.\n+\n+## installation\n+\n+```bash\n+$ npm install --save hof-template-partials\n+```\n+\n+## Usage\n+\n+### Template partials\n+\n+#### Standalone\n+\n+Template partials can be used by adding the route to the views directory to your express application views setting. You will need to be using the HTML view engine with Hogan and Mustache.\n+\n+```js\n+var app = require('express')();\n+\n+app.set('view engine', 'html');\n+app.set('views', [\n+  // your application shared views\n+  path.resolve(__dirname, './path/to/views'),\n+  // the module exports paths to views and translations directories\n+  require('hof-template-partials').views\n+]);\n+```\n+\n+The views are now available when calling `res.render('view-name')` from express.\n+\n+#### HOF Application\n+\n+When used in a hof application in conjunction with [express-partial-templates](https://github.com/UKHomeOffice/express-partial-templates) the contents of the views directory are added to `res.locals.partials`. These are added right to left so conflicting views are resolved from the left-most directory.\n+\n+```js\n+var app = require('express')();\n+\n+app.set('view engine', 'html');\n+app.set('views', [\n+  path.resolve(__dirname, './path/to/views'),\n+  require('hof-template-partials').views\n+]);\n+app.use(require('express-partial-templates')(app));\n+\n+app.use(function (req, res, next) {\n+  // res.locals.partials contains all views from the views dir in this repo\n+  // which are extended by any local views in ./path/to/views\n+  next();\n+});\n+```\n+\n+### Translations\n+\n+#### Standalone\n+\n+The provided translations are designed to be used in conjunction with a translations library such as [i18n-future](https://github.com/lennym/i18n-future). The source files are compiled automatically post-install. If you need to re-compile run the following:\n+\n+```bash\n+$ npm run transpile\n+```\n+\n+The compiled translations file can be found at `hof-template-partials/translations/{lang}/default.json.`\n+\n+To use with i18n-future:\n+\n+app.js\n+```js\n+var i18n = require('i18n-future')({\n+  path: require('hof-template-partials').translations\n+});\n+\n+i18n.on('ready', function () {\n+  var lookedup = i18n.translate('key');","path":"README.md","position":75,"original_position":75,"commit_id":"5252cbe63b5f77559bd0506da80cfe5a0918a23d","original_commit_id":"5252cbe63b5f77559bd0506da80cfe5a0918a23d","user":{"login":"joefitter","id":3604142,"avatar_url":"https://avatars.githubusercontent.com/u/3604142?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitter","html_url":"https://github.com/joefitter","followers_url":"https://api.github.com/users/joefitter/followers","following_url":"https://api.github.com/users/joefitter/following{/other_user}","gists_url":"https://api.github.com/users/joefitter/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitter/subscriptions","organizations_url":"https://api.github.com/users/joefitter/orgs","repos_url":"https://api.github.com/users/joefitter/repos","events_url":"https://api.github.com/users/joefitter/events{/privacy}","received_events_url":"https://api.github.com/users/joefitter/received_events","type":"User","site_admin":false},"body":"not for docs","created_at":"2016-07-07T14:19:49Z","updated_at":"2016-07-07T14:19:49Z","html_url":"https://github.com/UKHomeOffice/hof-template-partials/pull/1#discussion_r69914970","pull_request_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/comments/69914970"},"html":{"href":"https://github.com/UKHomeOffice/hof-template-partials/pull/1#discussion_r69914970"},"pull_request":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1","id":76171020,"html_url":"https://github.com/UKHomeOffice/hof-template-partials/pull/1","diff_url":"https://github.com/UKHomeOffice/hof-template-partials/pull/1.diff","patch_url":"https://github.com/UKHomeOffice/hof-template-partials/pull/1.patch","issue_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/1","number":1,"state":"open","locked":false,"title":"initial commit - adding files","user":{"login":"joefitter","id":3604142,"avatar_url":"https://avatars.githubusercontent.com/u/3604142?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitter","html_url":"https://github.com/joefitter","followers_url":"https://api.github.com/users/joefitter/followers","following_url":"https://api.github.com/users/joefitter/following{/other_user}","gists_url":"https://api.github.com/users/joefitter/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitter/subscriptions","organizations_url":"https://api.github.com/users/joefitter/orgs","repos_url":"https://api.github.com/users/joefitter/repos","events_url":"https://api.github.com/users/joefitter/events{/privacy}","received_events_url":"https://api.github.com/users/joefitter/received_events","type":"User","site_admin":false},"body":"* added apps/common/views from GRO\r\n* added apps/common/translations\r\n* added hof-transpile\r\n* passed FIXME string to fix bug in transpiler when a shared option isn't passed","created_at":"2016-07-04T14:23:49Z","updated_at":"2016-07-07T14:19:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ead76de2529250dffd327a650008d6e3c99a7606","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1/commits","review_comments_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1/comments","review_comment_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/1/comments","statuses_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/statuses/5252cbe63b5f77559bd0506da80cfe5a0918a23d","head":{"label":"UKHomeOffice:initial","ref":"initial","sha":"5252cbe63b5f77559bd0506da80cfe5a0918a23d","user":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":62545187,"name":"hof-template-partials","full_name":"UKHomeOffice/hof-template-partials","owner":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UKHomeOffice/hof-template-partials","description":null,"fork":false,"url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials","forks_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/deployments","created_at":"2016-07-04T08:30:19Z","updated_at":"2016-07-04T08:30:58Z","pushed_at":"2016-07-07T11:09:48Z","git_url":"git://github.com/UKHomeOffice/hof-template-partials.git","ssh_url":"git@github.com:UKHomeOffice/hof-template-partials.git","clone_url":"https://github.com/UKHomeOffice/hof-template-partials.git","svn_url":"https://github.com/UKHomeOffice/hof-template-partials","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"UKHomeOffice:master","ref":"master","sha":"d0cd8ab7cb861e1c5266faa80f805ee0824ad2b5","user":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"repo":{"id":62545187,"name":"hof-template-partials","full_name":"UKHomeOffice/hof-template-partials","owner":{"login":"UKHomeOffice","id":3778081,"avatar_url":"https://avatars.githubusercontent.com/u/3778081?v=3","gravatar_id":"","url":"https://api.github.com/users/UKHomeOffice","html_url":"https://github.com/UKHomeOffice","followers_url":"https://api.github.com/users/UKHomeOffice/followers","following_url":"https://api.github.com/users/UKHomeOffice/following{/other_user}","gists_url":"https://api.github.com/users/UKHomeOffice/gists{/gist_id}","starred_url":"https://api.github.com/users/UKHomeOffice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UKHomeOffice/subscriptions","organizations_url":"https://api.github.com/users/UKHomeOffice/orgs","repos_url":"https://api.github.com/users/UKHomeOffice/repos","events_url":"https://api.github.com/users/UKHomeOffice/events{/privacy}","received_events_url":"https://api.github.com/users/UKHomeOffice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UKHomeOffice/hof-template-partials","description":null,"fork":false,"url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials","forks_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/forks","keys_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/teams","hooks_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/hooks","issue_events_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/events{/number}","events_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/events","assignees_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/assignees{/user}","branches_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/branches{/branch}","tags_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/tags","blobs_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/refs{/sha}","trees_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/statuses/{sha}","languages_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/languages","stargazers_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/stargazers","contributors_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/contributors","subscribers_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/subscribers","subscription_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/subscription","commits_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/commits{/sha}","git_commits_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/git/commits{/sha}","comments_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/comments{/number}","issue_comment_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/comments{/number}","contents_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/contents/{+path}","compare_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/merges","archive_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/downloads","issues_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues{/number}","pulls_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls{/number}","milestones_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/milestones{/number}","notifications_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/labels{/name}","releases_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/releases{/id}","deployments_url":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/deployments","created_at":"2016-07-04T08:30:19Z","updated_at":"2016-07-04T08:30:58Z","pushed_at":"2016-07-07T11:09:48Z","git_url":"git://github.com/UKHomeOffice/hof-template-partials.git","ssh_url":"git@github.com:UKHomeOffice/hof-template-partials.git","clone_url":"https://github.com/UKHomeOffice/hof-template-partials.git","svn_url":"https://github.com/UKHomeOffice/hof-template-partials","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1"},"html":{"href":"https://github.com/UKHomeOffice/hof-template-partials/pull/1"},"issue":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/1"},"comments":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/UKHomeOffice/hof-template-partials/statuses/5252cbe63b5f77559bd0506da80cfe5a0918a23d"}}}}
{"actor":{"display_login":"joefitter"}}