{"action":"created","comment":{"url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/comments/44695608","id":44695608,"diff_hunk":"@@ -0,0 +1,63 @@\n+## Mobiledoc Atoms\n+\n+Atoms are effectively read-only inline cards.\n+\n+An atom is an object with a name and at least one of several hooks defined. For example:\n+\n+```js\n+var demoAtom = {\n+  name: 'mention',\n+  display: {\n+    setup(element, options, env, text, payload) {\n+      element.innerHTML = `<span class=\"mention\">${text}</span>`;\n+    }\n+  }\n+}\n+```\n+\n+### Available hooks\n+\n+Like [CARDS](CARDS.md) there are several hooks an atom should define.\n+\n+```js\n+var exampleAtom = {\n+  name: 'example',\n+  display: {\n+    setup(element, options, env, text, payload) {},\n+    teardown(setupReturnValue) {}\n+  },\n+  html: {\n+    setup(buffer, options, env, text, payload) {},\n+    teardown(setupReturnValue) {}\n+  }\n+};\n+```\n+\n+|Hook|Used by Mobiledoc Kit|Used by DOM Renderer|Used by HTML Renderer|\n+|---|---|---|---|\n+|`display`|✓|✓||\n+|`html`|||✓|\n+\n+Atoms are read-only so, unlike cards, do not have an `edit` hook.\n+\n+Each hook has a `setup` and `teardown` method. The arguments are:\n+\n+* `element` is a DOM element for that section. Nodes of that view for a atom\n+  should be appended to the `element`.\n+* `buffer` is an array passed to the `html` hook instead of a DOM element.\n+  The content for the atom should be pushed on that array as a string.\n+* `options` is the `cardOptions` argument passed to the editor or renderer.\n+* `env` contains information about the running of this hook. It may contain\n+  the following properties:\n+  * `env.name` The name of this atom\n+  * `env.remove()` remove this atom. This calls the current mode's `teardown()`\n+    hook and removes the atom from DOM and from the post abstract.\n+    the instance to edit mode.\n+* `text` is the textual value used to display to the user.\n+* `payload` is the payload for this atom instance. It was either loaded from\n+  a Mobiledoc or set when the atom was inserted.\n+\n+Additionally, *renderers may offer the ability to configure a non-standard\n+hook name at runtime*. An example would be having the DOM renderer called with\n+an option specifying the hook name `mobile-placeholder`. This allows for\n+variants of an atom in different situations.","path":"ATOMS.md","position":63,"original_position":63,"commit_id":"5a40954535505222434553075248c65b34ca2c7b","original_commit_id":"5a40954535505222434553075248c65b34ca2c7b","user":{"login":"rlivsey","id":3740,"avatar_url":"https://avatars.githubusercontent.com/u/3740?v=3","gravatar_id":"","url":"https://api.github.com/users/rlivsey","html_url":"https://github.com/rlivsey","followers_url":"https://api.github.com/users/rlivsey/followers","following_url":"https://api.github.com/users/rlivsey/following{/other_user}","gists_url":"https://api.github.com/users/rlivsey/gists{/gist_id}","starred_url":"https://api.github.com/users/rlivsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlivsey/subscriptions","organizations_url":"https://api.github.com/users/rlivsey/orgs","repos_url":"https://api.github.com/users/rlivsey/repos","events_url":"https://api.github.com/users/rlivsey/events{/privacy}","received_events_url":"https://api.github.com/users/rlivsey/received_events","type":"User","site_admin":false},"body":"Yep, that's all copied & pasted from the card docs! We can probably merge the atoms & card docs together as there are certainly commonalities vs having them in two files.","created_at":"2015-11-12T18:36:01Z","updated_at":"2015-11-12T18:36:01Z","html_url":"https://github.com/bustlelabs/mobiledoc-kit/pull/226#discussion_r44695608","pull_request_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226","_links":{"self":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/comments/44695608"},"html":{"href":"https://github.com/bustlelabs/mobiledoc-kit/pull/226#discussion_r44695608"},"pull_request":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226"}}},"pull_request":{"url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226","id":50523196,"html_url":"https://github.com/bustlelabs/mobiledoc-kit/pull/226","diff_url":"https://github.com/bustlelabs/mobiledoc-kit/pull/226.diff","patch_url":"https://github.com/bustlelabs/mobiledoc-kit/pull/226.patch","issue_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues/226","number":226,"state":"open","locked":false,"title":"Atoms - WiP - DO NOT MERGE","user":{"login":"rlivsey","id":3740,"avatar_url":"https://avatars.githubusercontent.com/u/3740?v=3","gravatar_id":"","url":"https://api.github.com/users/rlivsey","html_url":"https://github.com/rlivsey","followers_url":"https://api.github.com/users/rlivsey/followers","following_url":"https://api.github.com/users/rlivsey/following{/other_user}","gists_url":"https://api.github.com/users/rlivsey/gists{/gist_id}","starred_url":"https://api.github.com/users/rlivsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlivsey/subscriptions","organizations_url":"https://api.github.com/users/rlivsey/orgs","repos_url":"https://api.github.com/users/rlivsey/repos","events_url":"https://api.github.com/users/rlivsey/events{/privacy}","received_events_url":"https://api.github.com/users/rlivsey/received_events","type":"User","site_admin":false},"body":"Work in progress thoughts on Atoms","created_at":"2015-11-12T15:19:37Z","updated_at":"2015-11-12T18:36:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"880eb8819dee63e1fc791d3fa5c51a4d42fb9d3f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226/commits","review_comments_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226/comments","review_comment_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues/226/comments","statuses_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/statuses/5a40954535505222434553075248c65b34ca2c7b","head":{"label":"rlivsey:atoms","ref":"atoms","sha":"5a40954535505222434553075248c65b34ca2c7b","user":{"login":"rlivsey","id":3740,"avatar_url":"https://avatars.githubusercontent.com/u/3740?v=3","gravatar_id":"","url":"https://api.github.com/users/rlivsey","html_url":"https://github.com/rlivsey","followers_url":"https://api.github.com/users/rlivsey/followers","following_url":"https://api.github.com/users/rlivsey/following{/other_user}","gists_url":"https://api.github.com/users/rlivsey/gists{/gist_id}","starred_url":"https://api.github.com/users/rlivsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlivsey/subscriptions","organizations_url":"https://api.github.com/users/rlivsey/orgs","repos_url":"https://api.github.com/users/rlivsey/repos","events_url":"https://api.github.com/users/rlivsey/events{/privacy}","received_events_url":"https://api.github.com/users/rlivsey/received_events","type":"User","site_admin":false},"repo":{"id":43965525,"name":"content-kit-editor","full_name":"rlivsey/content-kit-editor","owner":{"login":"rlivsey","id":3740,"avatar_url":"https://avatars.githubusercontent.com/u/3740?v=3","gravatar_id":"","url":"https://api.github.com/users/rlivsey","html_url":"https://github.com/rlivsey","followers_url":"https://api.github.com/users/rlivsey/followers","following_url":"https://api.github.com/users/rlivsey/following{/other_user}","gists_url":"https://api.github.com/users/rlivsey/gists{/gist_id}","starred_url":"https://api.github.com/users/rlivsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlivsey/subscriptions","organizations_url":"https://api.github.com/users/rlivsey/orgs","repos_url":"https://api.github.com/users/rlivsey/repos","events_url":"https://api.github.com/users/rlivsey/events{/privacy}","received_events_url":"https://api.github.com/users/rlivsey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rlivsey/content-kit-editor","description":"A modern, minimalist WYSIWYG editor","fork":true,"url":"https://api.github.com/repos/rlivsey/content-kit-editor","forks_url":"https://api.github.com/repos/rlivsey/content-kit-editor/forks","keys_url":"https://api.github.com/repos/rlivsey/content-kit-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rlivsey/content-kit-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rlivsey/content-kit-editor/teams","hooks_url":"https://api.github.com/repos/rlivsey/content-kit-editor/hooks","issue_events_url":"https://api.github.com/repos/rlivsey/content-kit-editor/issues/events{/number}","events_url":"https://api.github.com/repos/rlivsey/content-kit-editor/events","assignees_url":"https://api.github.com/repos/rlivsey/content-kit-editor/assignees{/user}","branches_url":"https://api.github.com/repos/rlivsey/content-kit-editor/branches{/branch}","tags_url":"https://api.github.com/repos/rlivsey/content-kit-editor/tags","blobs_url":"https://api.github.com/repos/rlivsey/content-kit-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rlivsey/content-kit-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rlivsey/content-kit-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/rlivsey/content-kit-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rlivsey/content-kit-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/rlivsey/content-kit-editor/languages","stargazers_url":"https://api.github.com/repos/rlivsey/content-kit-editor/stargazers","contributors_url":"https://api.github.com/repos/rlivsey/content-kit-editor/contributors","subscribers_url":"https://api.github.com/repos/rlivsey/content-kit-editor/subscribers","subscription_url":"https://api.github.com/repos/rlivsey/content-kit-editor/subscription","commits_url":"https://api.github.com/repos/rlivsey/content-kit-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/rlivsey/content-kit-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/rlivsey/content-kit-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/rlivsey/content-kit-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/rlivsey/content-kit-editor/contents/{+path}","compare_url":"https://api.github.com/repos/rlivsey/content-kit-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rlivsey/content-kit-editor/merges","archive_url":"https://api.github.com/repos/rlivsey/content-kit-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rlivsey/content-kit-editor/downloads","issues_url":"https://api.github.com/repos/rlivsey/content-kit-editor/issues{/number}","pulls_url":"https://api.github.com/repos/rlivsey/content-kit-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/rlivsey/content-kit-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/rlivsey/content-kit-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rlivsey/content-kit-editor/labels{/name}","releases_url":"https://api.github.com/repos/rlivsey/content-kit-editor/releases{/id}","created_at":"2015-10-09T15:53:03Z","updated_at":"2015-10-09T15:53:04Z","pushed_at":"2015-11-12T15:40:46Z","git_url":"git://github.com/rlivsey/content-kit-editor.git","ssh_url":"git@github.com:rlivsey/content-kit-editor.git","clone_url":"https://github.com/rlivsey/content-kit-editor.git","svn_url":"https://github.com/rlivsey/content-kit-editor","homepage":"","size":2120,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bustlelabs:master","ref":"master","sha":"88e990239067d843536ab5eafe52f8562b7c5af8","user":{"login":"bustlelabs","id":2198187,"avatar_url":"https://avatars.githubusercontent.com/u/2198187?v=3","gravatar_id":"","url":"https://api.github.com/users/bustlelabs","html_url":"https://github.com/bustlelabs","followers_url":"https://api.github.com/users/bustlelabs/followers","following_url":"https://api.github.com/users/bustlelabs/following{/other_user}","gists_url":"https://api.github.com/users/bustlelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/bustlelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bustlelabs/subscriptions","organizations_url":"https://api.github.com/users/bustlelabs/orgs","repos_url":"https://api.github.com/users/bustlelabs/repos","events_url":"https://api.github.com/users/bustlelabs/events{/privacy}","received_events_url":"https://api.github.com/users/bustlelabs/received_events","type":"Organization","site_admin":false},"repo":{"id":21694966,"name":"mobiledoc-kit","full_name":"bustlelabs/mobiledoc-kit","owner":{"login":"bustlelabs","id":2198187,"avatar_url":"https://avatars.githubusercontent.com/u/2198187?v=3","gravatar_id":"","url":"https://api.github.com/users/bustlelabs","html_url":"https://github.com/bustlelabs","followers_url":"https://api.github.com/users/bustlelabs/followers","following_url":"https://api.github.com/users/bustlelabs/following{/other_user}","gists_url":"https://api.github.com/users/bustlelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/bustlelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bustlelabs/subscriptions","organizations_url":"https://api.github.com/users/bustlelabs/orgs","repos_url":"https://api.github.com/users/bustlelabs/repos","events_url":"https://api.github.com/users/bustlelabs/events{/privacy}","received_events_url":"https://api.github.com/users/bustlelabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bustlelabs/mobiledoc-kit","description":"A toolkit for building WYSIWYG editors with Mobiledoc","fork":false,"url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit","forks_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/forks","keys_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/teams","hooks_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/hooks","issue_events_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues/events{/number}","events_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/events","assignees_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/assignees{/user}","branches_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/branches{/branch}","tags_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/tags","blobs_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/languages","stargazers_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/stargazers","contributors_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/contributors","subscribers_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/subscribers","subscription_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/subscription","commits_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/contents/{+path}","compare_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/merges","archive_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/downloads","issues_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues{/number}","pulls_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/labels{/name}","releases_url":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/releases{/id}","created_at":"2014-07-10T13:22:19Z","updated_at":"2015-11-12T07:26:41Z","pushed_at":"2015-11-12T17:08:09Z","git_url":"git://github.com/bustlelabs/mobiledoc-kit.git","ssh_url":"git@github.com:bustlelabs/mobiledoc-kit.git","clone_url":"https://github.com/bustlelabs/mobiledoc-kit.git","svn_url":"https://github.com/bustlelabs/mobiledoc-kit","homepage":"","size":3740,"stargazers_count":118,"watchers_count":118,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":13,"forks":13,"open_issues":13,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226"},"html":{"href":"https://github.com/bustlelabs/mobiledoc-kit/pull/226"},"issue":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues/226"},"comments":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/issues/226/comments"},"review_comments":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226/comments"},"review_comment":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/pulls/226/commits"},"statuses":{"href":"https://api.github.com/repos/bustlelabs/mobiledoc-kit/statuses/5a40954535505222434553075248c65b34ca2c7b"}}}}