{"action":"created","issue":{"url":"https://api.github.com/repos/atom/snippets/issues/83","labels_url":"https://api.github.com/repos/atom/snippets/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/atom/snippets/issues/83/comments","events_url":"https://api.github.com/repos/atom/snippets/issues/83/events","html_url":"https://github.com/atom/snippets/pull/83","id":49843867,"number":83,"title":"added special variables","user":{"login":"mark-hahn","id":811455,"avatar_url":"https://avatars.githubusercontent.com/u/811455?v=3","gravatar_id":"","url":"https://api.github.com/users/mark-hahn","html_url":"https://github.com/mark-hahn","followers_url":"https://api.github.com/users/mark-hahn/followers","following_url":"https://api.github.com/users/mark-hahn/following{/other_user}","gists_url":"https://api.github.com/users/mark-hahn/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-hahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-hahn/subscriptions","organizations_url":"https://api.github.com/users/mark-hahn/orgs","repos_url":"https://api.github.com/users/mark-hahn/repos","events_url":"https://api.github.com/users/mark-hahn/events{/privacy}","received_events_url":"https://api.github.com/users/mark-hahn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/atom/snippets/labels/needs-review","name":"needs-review","color":"bfe5bf"},{"url":"https://api.github.com/repos/atom/snippets/labels/requires-changes","name":"requires-changes","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-11-23T23:15:25Z","updated_at":"2015-12-09T09:21:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/atom/snippets/pulls/83","html_url":"https://github.com/atom/snippets/pull/83","diff_url":"https://github.com/atom/snippets/pull/83.diff","patch_url":"https://github.com/atom/snippets/pull/83.patch"},"body":"Adds variables like `${/filename}` that expand into special values, much like `__filename` in node.  The prefix character is designed to not conflict with normal variable names if/when they are supported.  I don't know where docs are supposed to go so here they are ...\r\n\r\n### Special variables in snippets package\r\n\r\nAdd variables of the form `${Xname}` where the first character `X` is one of `/`, `:`, or `-`.  The suffix `name` must follow specific values or syntax.  Examples ...\r\n\r\n### files and paths\r\n   - **${/filename}**   =>  /root/proj/lib/main.coffee\r\n   - **${/dirname}**   =>  /root/proj/lib   \r\n   - **${/basename}**   =>  main.coffee\r\n   - **${/extname}**   =>  .coffee\r\n   - **${/sep}**   =>  /\r\n   - **${/delimiter}**   =>  :\r\n   - **${/projectpath}**   => /root/proj\r\n   - **${/project}**   => proj\r\n   - **${/filenamerel}**   => lib/main.coffee\r\n   - **${/dirnamerel}**   => lib\r\n   - **${/line}**   => 27  (line number of cursor position)\r\n\r\n### date & times\r\n   - **${-any-moment-format}**  current time in any format provided by the [moment](http://momentjs.com/docs/#/displaying/) npm package\r\n      - ${-MMMM Do YYYY, h:mm:ss a} =>   November 22nd 2014, 2:24:26 am\r\n      - ${-dddd}                    =>   Saturday\r\n      - ${-MMM Do YY}               =>   Nov 22nd 14\r\n\r\n### package.json\r\n   - **${:path:in:project:json}**  Shows value from project.json file\r\n      - ${:name}   =>  moment\r\n      - ${:version} => 2.8.4\r\n      - ${:repository:url}   =>  https://github.com/moment/moment.git\r\n"},"comment":{"url":"https://api.github.com/repos/atom/snippets/issues/comments/163158944","html_url":"https://github.com/atom/snippets/pull/83#issuecomment-163158944","issue_url":"https://api.github.com/repos/atom/snippets/issues/83","id":163158944,"user":{"login":"dbackeus","id":3461,"avatar_url":"https://avatars.githubusercontent.com/u/3461?v=3","gravatar_id":"","url":"https://api.github.com/users/dbackeus","html_url":"https://github.com/dbackeus","followers_url":"https://api.github.com/users/dbackeus/followers","following_url":"https://api.github.com/users/dbackeus/following{/other_user}","gists_url":"https://api.github.com/users/dbackeus/gists{/gist_id}","starred_url":"https://api.github.com/users/dbackeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbackeus/subscriptions","organizations_url":"https://api.github.com/users/dbackeus/orgs","repos_url":"https://api.github.com/users/dbackeus/repos","events_url":"https://api.github.com/users/dbackeus/events{/privacy}","received_events_url":"https://api.github.com/users/dbackeus/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T09:21:12Z","updated_at":"2015-12-09T09:21:12Z","body":"+1"}}