{"action":"created","issue":{"url":"https://api.github.com/repos/substance/substance/issues/167","labels_url":"https://api.github.com/repos/substance/substance/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/substance/substance/issues/167/comments","events_url":"https://api.github.com/repos/substance/substance/issues/167/events","html_url":"https://github.com/substance/substance/issues/167","id":113038501,"number":167,"title":"Consistent node type categorization","user":{"login":"michael","id":2931,"avatar_url":"https://avatars.githubusercontent.com/u/2931?v=3","gravatar_id":"","url":"https://api.github.com/users/michael","html_url":"https://github.com/michael","followers_url":"https://api.github.com/users/michael/followers","following_url":"https://api.github.com/users/michael/following{/other_user}","gists_url":"https://api.github.com/users/michael/gists{/gist_id}","starred_url":"https://api.github.com/users/michael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael/subscriptions","organizations_url":"https://api.github.com/users/michael/orgs","repos_url":"https://api.github.com/users/michael/repos","events_url":"https://api.github.com/users/michael/events{/privacy}","received_events_url":"https://api.github.com/users/michael/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/substance/substance/milestones/2","html_url":"https://github.com/substance/substance/milestones/Beta%202","labels_url":"https://api.github.com/repos/substance/substance/milestones/2/labels","id":1271177,"number":2,"title":"Beta 2","description":"","creator":{"login":"michael","id":2931,"avatar_url":"https://avatars.githubusercontent.com/u/2931?v=3","gravatar_id":"","url":"https://api.github.com/users/michael","html_url":"https://github.com/michael","followers_url":"https://api.github.com/users/michael/followers","following_url":"https://api.github.com/users/michael/following{/other_user}","gists_url":"https://api.github.com/users/michael/gists{/gist_id}","starred_url":"https://api.github.com/users/michael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael/subscriptions","organizations_url":"https://api.github.com/users/michael/orgs","repos_url":"https://api.github.com/users/michael/repos","events_url":"https://api.github.com/users/michael/events{/privacy}","received_events_url":"https://api.github.com/users/michael/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":106,"state":"open","created_at":"2015-08-25T10:35:03Z","updated_at":"2015-11-20T10:40:44Z","due_on":"2015-11-22T23:00:00Z","closed_at":null},"comments":19,"created_at":"2015-10-23T15:05:36Z","updated_at":"2015-11-20T12:29:49Z","closed_at":null,"body":"We have the following node type categories, which are sometimes defined via inheritance chain, sometimes via a static property definition. Let's see if we can unify this to be able to better reason about in which category a given node is. However let's find use-cases so we don't engineer blindly what could be useful..\r\n\r\nSo far we are aware of the following categories:\r\n\r\n**Text**\r\n\r\nAny text-ish node, such as paragraph, heading, caption etc.\r\n\r\n**Block**\r\n\r\nParent is a container, so it's kind of a root node. E.g. image, paragraph, heading.\r\n\r\n**Container**\r\n\r\nManages a list of Block nodes (List, Paragraph, Codeblock, Blockquote)\r\n\r\n**Annotation**\r\n\r\nOverlays characters of a text property. E.g. Strong, Link, etc.\r\n\r\n**Inline**\r\n\r\nAn property annotation that also has content. E.g. a dynamically labelled FigureCaption where the label is the content. But this could also be an InlineImage. Or InlineFormula. Inline nodes wrap a fake character, that just says there is some content here that you can not edit.\r\n\r\n**ContainerAnnotation**\r\n\r\nSpecial annotation that sticks on a container rather then a text property.\r\n\r\nWe can not describe this entirely via inheritance chain. Because for instance a Paragraph would inherit from Block AND Text. \r\n\r\n```js\r\nNode.static = {\r\n  isText: false,\r\n  isBlock: false,\r\n  isInline: false,\r\n  isAnnotation: false,\r\n  isContainer: false,\r\n  isContainerAnnotation: false\r\n};\r\n```\r\n\r\nWe can have a class hierarchy like this and we just set the static properties accordingly. Except for isBlock, which needs to be set manually in all block implementations, much like it is the case already using blockType = true)\r\n\r\n```\r\n- Node\r\n   - Text\r\n   - Annotation\r\n      - Inline\r\n   - ContainerAnnotation\r\n   - Container\r\n```"},"comment":{"url":"https://api.github.com/repos/substance/substance/issues/comments/158384838","html_url":"https://github.com/substance/substance/issues/167#issuecomment-158384838","issue_url":"https://api.github.com/repos/substance/substance/issues/167","id":158384838,"user":{"login":"oliver----","id":284099,"avatar_url":"https://avatars.githubusercontent.com/u/284099?v=3","gravatar_id":"","url":"https://api.github.com/users/oliver----","html_url":"https://github.com/oliver----","followers_url":"https://api.github.com/users/oliver----/followers","following_url":"https://api.github.com/users/oliver----/following{/other_user}","gists_url":"https://api.github.com/users/oliver----/gists{/gist_id}","starred_url":"https://api.github.com/users/oliver----/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliver----/subscriptions","organizations_url":"https://api.github.com/users/oliver----/orgs","repos_url":"https://api.github.com/users/oliver----/repos","events_url":"https://api.github.com/users/oliver----/events{/privacy}","received_events_url":"https://api.github.com/users/oliver----/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T12:29:49Z","updated_at":"2015-11-20T12:29:49Z","body":"Yes, only implementation wise. But not semantically."}}